Question Details

No question body available.

Tags

c++ intrinsics avx2

Answers (2)

January 13, 2026 Score: 6 Rep: 378,552 Quality: High Completeness: 100%

Sometimes Intel introduces a new intrinsics with "better" naming, like if they didn't like the first name they thought of, especially when also adding new versions of an instruction. (For load/store, also some with void arg instead of an inconvenient m128i that always requires a cast.)

mm512bslliepi128 is the only intrinsic listed for vpslldq zmm in their guide. The bslli names for the 256 and 128-bit version were almost certainly added at the same time. They don't remove old names from the intrinsics guide so you can look them up when reading old code. (They don't remove them from headers either so old code still compiles.)

I prefer the newer bslliepi128 name: it's better in two ways:

  • bslli indicates it's a byte shift, unlike slliepi64 epi32 and epi16 which are bit-shifts within elements.
  • epi128 indicates it's a shift within 128-bit halves, not across the full 32-byte vector like si256 could misleadingly imply.

The second problem is unique to the 256-bit and 512-bit versions: mmsllisi128 is a shift across the full vector.
The 128-bit bslli intrinsic is actually named mmbsllisi128 not epi128, which is inconsistent with the 256-bit version for no apparent reason. Welcome to the fun world Intel intrinsics naming...

The names used in their intrinsics guide are the most widely portable.

The names in the intrinsics section of the asm manual (when they're different from the intrinsics guide) aren't always supported across all of GCC/Clang/MSVC. In this case, https://www.felixcloutier.com/x86/pslldq (a scrape of a recent version of Intel's vol.2 PDF) lists

  • (V)PSLLDQ m128i mmsllisi128 ( m128i a, int imm)
  • VPSLLDQ m256i mm256sllisi256 ( m256i a, const int imm)
  • VPSLLDQ m512i mm512bslliepi128 ( m512i a, const int imm)

So I'm guessing the new bslli name was probably new with AVX-512, and they just added that without updating the older entries. They also added new void* loads/stores around then. See How to emulate mm256loaduepi32 with gcc or clang? / mm256loaduepi64, mm256storeuepi64 require avx512vl?

January 13, 2026 Score: 3 Rep: 5,530 Quality: Low Completeness: 0%

This would have been better as a Q&A. Good question, and excellent answer.