Intel® C++ Compiler
Community support and assistance for creating C++ code that runs on platforms based on Intel® processors.
7956 Discussions

_mm256_slli_si256 and _mm256_srli_si256

bronxzv
New Contributor II
1,066 Views
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
0 Kudos
6 Replies
Georg_Z_Intel
Employee
1,066 Views
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
0 Kudos
bronxzv
New Contributor II
1,066 Views
"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

0 Kudos
Mark_S_Intel1
Employee
1,066 Views
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
0 Kudos
bronxzv
New Contributor II
1,066 Views
why not "_epi128" or "_pi128" instead ?, these are shifting two packed 128-bit values not a single scalar value
0 Kudos
Mark_S_Intel1
Employee
1,066 Views
Thenew names will be"_mm_bs[rl]li_si128" and "_mm256_bs[rl]li_epi128" .

--mark
0 Kudos
Georg_Z_Intel
Employee
1,066 Views
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
0 Kudos
Reply