Add drx_expand() function for VSIB AVX2/AVX-512 scatter/gather.
Created by: sdconsta
When encountering the following instruction:
c4 e2 65 90 14 80 vpgatherdd %ymm3,(%rax,%ymm0,4),%ymm2
compiled from the intrinsic
__m256i _mm256_i32gather_epi32 (int const* base_addr, __m256i vindex, const int scale)
#include <immintrin.h>
Instruction: vpgatherdd ymm, vm32x, ymm
CPUID Flags: AVX2
with either clang
or gcc
. DynamoRIO complains that
ERROR: Could not find encoding for: lea (%rax,%ymm0,4) -> %rbp
SYSLOG_ERROR: Application /home/scott/Documents/covert-cpp/build/bin/DynLoader (27816) DynamoRIO usage error : instr_encode error: no encoding found (see log)
SYSLOG_ERROR: Usage error: instr_encode error: no encoding found (see log) (/home/travis/build/DynamoRIO/dynamorio/core/arch/x86/encode.c, line 2423)
version 7.0.17598, custom build
It looks like DynamoRIO is expecting the base address to be 4 bytes, but the actual size is 8 bytes: https://github.com/DynamoRIO/dynamorio/blob/01357f8ae547b4f4ea66d39a3214aed662428a0d/suite/tests/api/ir_x86_3args.h#L384.