• jinbo's avatar
    x86 sse2,avx2 loongarch impl: let compiler to generate instructions based on imm8 · a8ae10d9
    jinbo authored
    On loongarch, for example simde_mm_srai_epi16, GCC will generate
    a vsrai.h instruction for '>>' operator if the imm8 is a real
    immediate const value, otherwise it will generate two instructions
    vsral.h and vreplgr2vr.h. But for clang it always generates two
    instructions. So don't use intrinsics directly, instead let the
    compiler itself to generate instructions based on imm8, which will
    save one instruction for GCC at least.
    
    Same for below:
    simde_mm_srai_epi32
    simde_mm_slli_epi[16/32/64]
    simde_mm_srli_epi[16/32/64]
    simde_mm256_slli_epi[16/32/64]
    simde_mm256_srai_epi[16/32]
    simde_mm256_srli_epi[16/32/64]
    a8ae10d9
sse2.h 294 KB