tcg/i386: Simplify FP ops further when AVX is available

This commit is contained in:
Matt Borgerson 2023-07-30 21:16:01 -07:00 committed by mborgerson
parent f4ad6927e7
commit e5dd3cc1ce

View File

@ -2567,6 +2567,8 @@ static inline void tcg_out_op(TCGContext *s, TCGOpcode opc,
tcg_out_modrm(s, mopc, a0, a2);
} else if (a0 == a2) {
tcg_out_modrm(s, mopc, a0, a1);
} else if (have_avx1) {
tcg_out_vex_modrm(s, mopc, a0, a1, a2);
} else {
tcg_out_mov(s, dp ? TCG_TYPE_F64 : TCG_TYPE_F32, a0, a1);
tcg_out_modrm(s, mopc, a0, a2);
@ -2578,6 +2580,8 @@ static inline void tcg_out_op(TCGContext *s, TCGOpcode opc,
int ft = dp ? TCG_TYPE_F64 : TCG_TYPE_F32;
if (a0 == a1) {
tcg_out_modrm(s, mopc, a0, a2);
} else if (have_avx1) {
tcg_out_vex_modrm(s, mopc, a0, a1, a2);
} else if (a0 == a2) {
tcg_out_stash_xmm(s, a2);
tcg_out_mov(s, ft, a0, a1);
@ -2594,6 +2598,8 @@ static inline void tcg_out_op(TCGContext *s, TCGOpcode opc,
tcg_out_modrm(s, mopc, a0, a2);
} else if (a0 == a2) {
tcg_out_modrm(s, mopc, a0, a1);
} else if (have_avx1) {
tcg_out_vex_modrm(s, mopc, a0, a1, a2);
} else {
tcg_out_mov(s, dp ? TCG_TYPE_F64 : TCG_TYPE_F32, a0, a1);
tcg_out_modrm(s, mopc, a0, a2);
@ -2605,6 +2611,8 @@ static inline void tcg_out_op(TCGContext *s, TCGOpcode opc,
int ft = dp ? TCG_TYPE_F64 : TCG_TYPE_F32;
if (a0 == a1) {
tcg_out_modrm(s, mopc, a0, a2);
} else if (have_avx1) {
tcg_out_vex_modrm(s, mopc, a0, a1, a2);
} else if (a0 == a2) {
tcg_out_stash_xmm(s, a2);
tcg_out_mov(s, ft, a0, a1);