target/i386: Move 3DNOW decoder
Handle 3DNOW instructions early to avoid complicating the MMX/SSE logic. Signed-off-by: Paul Brook <paul@nowt.org> Message-Id: <20220424220204.2493824-25-paul@nowt.org> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
parent
491f0f1962
commit
622ef8f291
@ -3216,6 +3216,11 @@ static void gen_sse(CPUX86State *env, DisasContext *s, int b,
|
||||
is_xmm = 1;
|
||||
}
|
||||
}
|
||||
if (sse_op_flags & SSE_OPF_3DNOW) {
|
||||
if (!(s->cpuid_ext2_features & CPUID_EXT2_3DNOW)) {
|
||||
goto illegal_op;
|
||||
}
|
||||
}
|
||||
/* simple MMX/SSE operation */
|
||||
if (s->flags & HF_TS_MASK) {
|
||||
gen_exception(s, EXCP07_PREX, pc_start - s->cs_base);
|
||||
@ -4567,21 +4572,20 @@ static void gen_sse(CPUX86State *env, DisasContext *s, int b,
|
||||
rm = (modrm & 7);
|
||||
op2_offset = offsetof(CPUX86State,fpregs[rm].mmx);
|
||||
}
|
||||
if (sse_op_flags & SSE_OPF_3DNOW) {
|
||||
/* 3DNow! data insns */
|
||||
val = x86_ldub_code(env, s);
|
||||
SSEFunc_0_epp op_3dnow = sse_op_table5[val];
|
||||
if (!op_3dnow) {
|
||||
goto unknown_op;
|
||||
}
|
||||
tcg_gen_addi_ptr(s->ptr0, cpu_env, op1_offset);
|
||||
tcg_gen_addi_ptr(s->ptr1, cpu_env, op2_offset);
|
||||
op_3dnow(cpu_env, s->ptr0, s->ptr1);
|
||||
return;
|
||||
}
|
||||
}
|
||||
switch(b) {
|
||||
case 0x0f: /* 3DNow! data insns */
|
||||
val = x86_ldub_code(env, s);
|
||||
sse_fn_epp = sse_op_table5[val];
|
||||
if (!sse_fn_epp) {
|
||||
goto unknown_op;
|
||||
}
|
||||
if (!(s->cpuid_ext2_features & CPUID_EXT2_3DNOW)) {
|
||||
goto illegal_op;
|
||||
}
|
||||
tcg_gen_addi_ptr(s->ptr0, cpu_env, op1_offset);
|
||||
tcg_gen_addi_ptr(s->ptr1, cpu_env, op2_offset);
|
||||
sse_fn_epp(cpu_env, s->ptr0, s->ptr1);
|
||||
break;
|
||||
case 0x70: /* pshufx insn */
|
||||
case 0xc6: /* pshufx insn */
|
||||
val = x86_ldub_code(env, s);
|
||||
|
Loading…
Reference in New Issue
Block a user