4 ms·
Exactly - C++ compilers definitely can do this, and it's one of the things ICC's noticeably better than GCC and LLVM at, especially where intrinsics are involve
by berkut 10y ago
Exactly - C++ compilers definitely can do this, and it's one of the things ICC's noticeably better than GCC and LLVM at, especially where intrinsics are involved.
If you have a struct/class type union wrapper for SIMD instrinsics which contains something like __m128 and pass that by reference, GCC and LLVM will often implement this as an effective pointer onto the stack (or wherever the struct is). ICC can often detect this, and keep it as a by-value __m128, which is often more efficient and keeps stuff in the registers.
- Const-me 10y agoAnd MSVC has __vectorcall keyword for ICC-like calling convention that passes arguments in those SSE registers.