4 ms·
I simply meant that the bare xxxintrin.h stuff is annoying enough that if you're using it directly you might as well write assembly. I absolutely agree that on
by obl 8y ago
I simply meant that the bare xxxintrin.h stuff is annoying enough that if you're using it directly you might as well write assembly.
I absolutely agree that once wrapped up there are good reasons to use a language-level interface instead of asm for most things.
- gameswithgo 8y agoAs I get more familiar with rust macros I may compress this down a bunch. It will make it easier to maintain.
- stagger87 8y agoAs another example, this morning I needed to perform a small convolution in an inner loop. Since I'm targeting x64 under the msvc compiler I can't write an external assembly function and have it inlined into the inner loop. Therefore I was left with just using the raw intrinsics from intrin.h for like, 10 lines of code. The simplicity of the convolution means the compiler will have no problems generating optimal code.
- gameswithgo 8y agoFor me the ugliness of the intrinsics has gone away, like parens do for a lisp programmer.
- burntsushi 8y ago> I simply meant that the bare xxxintrin.h stuff is annoying enough that if you're using it directly you might as well write assembly. The compiler is aware of many of those intrinsics and can perform optimizations around them. Hand rolling all of that in Assembly would be quite the chore. Using these intrinsics is, IMO, considerably easier.