Intel® ISA Extensions
Use hardware-based isolation and memory encryption to provide more code protection in your solutions.
Avisos
FPGA community forums and blogs on community.intel.com are migrating to the new Altera Community and are read-only. For urgent support needs during this transition, please visit the FPGA Design Resources page or contact an Altera Authorized Distributor.
1135 Discusiones

Shifting __m256i variable by 4 bytes or 32 bits to read 32bit values

Caster
Nuevo Colaborador I
945 Vistas

I am trying to read uint32_t values from __m256i variable and store them into uint32_t array.

 

__m256i chunk0;
__m256i chunk1;

uint32_t field[80];

int main()
{
    chunk0 = _mm256_setr_epi32(0x6A6F6841, 0x34333231, 0x00000008, 0x0, 0x0, 0x0, 0x0, 0x0);
    chunk1 = _mm256_setr_epi32(0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x40);

    for (int i = 7; i >= 0; i--) {
        field[i] = _mm256_extract_epi32(chunk0, 7);
        chunk0 = _mm256_slli_si256(chunk0, 4);

    for (int i = 15; i >= 8; i--) {
        field[i] = _mm256_extract_epi32(chunk1, 7);
        chunk1 = _mm256_slli_si256(chunk1, 4);
    }

 

However I discovered that _mm256_slli_si256 works on 128 bit lane only. What function to use to do the job?

0 kudos
0 Respuestas
Responder