News for hackers. Stuff that matters.
Re:A 94x speed improvement demonstrated using handwritten as... by jsheard on Monday November 04, 2024 @09:10AM (#42041659)
Intrinsics do have certain advantages besides convenience, since the compiler can reason about them in ways that it can't with an opaque blob of asssembly. For example if you set the compiler to tune for a specific CPU architecture then it can re-order intrinsics according to the instruction costs of that specific hardware, whereas with assembly you would have to manually write a separate implementation for each architecture (and AFAICT FFmpeg doesn't go that far).
Re:A 94x speed improvement demonstrated using handwritten as... by astrange on Monday November 04, 2024 @03:44PM (#42045809)
Those kind of optimizations aren't needed on big desktop CPUs these days, they don't need special scheduling or anything.

And yes, when it's important it does do that. They aren't stupid. (An example is that unaligned SSE loads are very slow on some CPUs but faster on others.)