I want to extract 8 bits from the __mm256i src register variable with 8 positions given by another __mm256i offset , which consists of 8 integers. For example: if offset is [1,3,5,21,100,200,201,202] , I want to get the 1, 3, 5, 100, 200, 201, 202nd bits from src and pack them in int8 .
This question is similar to Extracting bits using bit manipulation , but I want a solution with SIMD instructions, as it is much faster.
source share