I want to extract 8 bits from a register variable __mm256i src with 8 position specified by another __mm256i offset which is composed of 8 integers.
For example: if offset is [1,3,5,21,100,200,201,202], I want to get 1st,3rd,5th,100th,200th,201st,202nd bits from src and pack them to a int8.
This question is similar to Extracting bits using bit manipulation, but I want a solution with SIMD instructions, since it is much faster.