_mm256_slli_si256 and _mm256_srli_si256

_mm256_slli_si256 and _mm256_srli_si256

the intrinsics _mm256_slli_si256 and _mm256_srli_si256 map to the AVX2 instructions vpslldq and vpsrldq which shift 128-bit values according to the AVXprogramming reference and the behavior ofthe SDE

I'll suggest to rename these intrinsics as _mm256_slli_si128 and _mm256_srli_si128 to be consistent with the rest of the nomenclature

the intrinsics guide explanationalso requires a modification since they are explained as 256-bit shifts at the moment

7 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

Hello,

you're right that shifts are affecting both 128-bit lanes (for _mm256... variants). I've checked our documentation and it's (only) mentioned incorrectly in the Intrinsics Guide for Intel Advanced Vector Extensions 2 (v2.6).
I've filed a defect to fix that: DPD200272778.

Thank you for bringing this up!

Regarding the naming scheme: I don't see how your proposal would fit better, though. Post-fix si256 refers to the 256-bit size source vector register. That's still valid as we do 2x 128-bit value shifts. However, I agree that it's still a bit misleading... esp. for users who did not take a look a deeper look into the INTEL ADVANCED VECTOR EXTENSIONS (Ref. # 319433-011) document.
In the end it's also a question how compact you'd like those intrinsic names to be. Describing (full) semantics in the name would be too much.

Best regards,

Georg Zitzlsberger

"Post-fix si256 refers to the 256-bit size source vector register."

Ah yes I missed the "si" vs "epi"thing,but since the "s" in si256 means "scalar"it gives the wrong impressionthat it shifta single value when it's in fact shifting independently two packed value

I you insist keeping it as is, something that will make some sensewill be to introducesome aliases called "_mm256_srli_epi128" and "_mm256_slli_epi128" ? I'm sure it will be quite more clear for newbies

The compiler development team decided to introduce the new "_si128" names _mm256_slli_si128 and _mm256_srli_si128, and keepthe "_si256" names for compatibility since they were already released.

Thanks,
--mark

why not "_epi128" or "_pi128" instead ?, these are shifting two packed 128-bit values not a single scalar value

Thenew names will be"_mm_bs[rl]li_si128" and "_mm256_bs[rl]li_epi128" .

--mark

Hello,

the new names will be available with Intel Composer XE 2011 Update 10.
Thank you Mark for taking care!

DPD200272778 is still in the works.

Best regards,

Georg Zitzlsberger

Leave a Comment

Please sign in to add a comment. Not a member? Join today