Merge remote-tracking branch 'mrexoida/avx-bug' into dev
This commit is contained in:
@@ -3378,6 +3378,10 @@ static void gen_sse(CPUX86State *env, DisasContext *s, int b,
|
|||||||
if (is_xmm)
|
if (is_xmm)
|
||||||
reg |= rex_r;
|
reg |= rex_r;
|
||||||
mod = (modrm >> 6) & 3;
|
mod = (modrm >> 6) & 3;
|
||||||
|
/* VEX.L (256 bit) encodings are not supported */
|
||||||
|
if (s->vex_l != 0) {
|
||||||
|
goto illegal_op; // perhaps it should be unknown_op?
|
||||||
|
}
|
||||||
if (sse_fn_epp == SSE_SPECIAL) {
|
if (sse_fn_epp == SSE_SPECIAL) {
|
||||||
b |= (b1 << 8);
|
b |= (b1 << 8);
|
||||||
switch(b) {
|
switch(b) {
|
||||||
|
|||||||
@@ -47,12 +47,37 @@ static void test_vmovdqu(void)
|
|||||||
OK(uc_close(uc));
|
OK(uc_close(uc));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* https://github.com/unicorn-engine/unicorn/issues/1656 */
|
||||||
|
static void test_vex_l(void)
|
||||||
|
{
|
||||||
|
uc_engine *uc;
|
||||||
|
uc_err err;
|
||||||
|
|
||||||
|
/* vmovdqu ymm1, [rcx] */
|
||||||
|
char code[] = { '\xC5', '\xFE', '\x6F', '\x09' };
|
||||||
|
|
||||||
|
/* initialize memory and run emulation */
|
||||||
|
OK(uc_open(UC_ARCH_X86, UC_MODE_64, &uc));
|
||||||
|
OK(uc_mem_map(uc, 0, 2 * 1024 * 1024, UC_PROT_ALL));
|
||||||
|
|
||||||
|
OK(uc_mem_write(uc, 0, code, sizeof(code) / sizeof(code[0])));
|
||||||
|
|
||||||
|
err = uc_emu_start(uc, 0, sizeof(code) / sizeof(code[0]), 0, 0);
|
||||||
|
if(err != UC_ERR_INSN_INVALID) {
|
||||||
|
fprintf(stderr, "%s", uc_strerror(err));
|
||||||
|
assert(false);
|
||||||
|
}
|
||||||
|
|
||||||
|
OK(uc_close(uc));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/* TODO: Add more vex prefixed instructions
|
/* TODO: Add more vex prefixed instructions
|
||||||
Suggestions: vxorpd, vxorps, vandpd, ... */
|
Suggestions: vxorpd, vxorps, vandpd, ... */
|
||||||
int main(int argc, char **argv, char **envp)
|
int main(int argc, char **argv, char **envp)
|
||||||
{
|
{
|
||||||
test_vmovdqu();
|
test_vmovdqu();
|
||||||
|
test_vex_l();
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user