Skip to content

Commit

Permalink
tcg/i386: Simplify FP ops further when AVX is available
Browse files Browse the repository at this point in the history
  • Loading branch information
mborgerson committed Jul 31, 2023
1 parent f4ad692 commit e5dd3cc
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions tcg/i386/tcg-target.c.inc
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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);
Expand All @@ -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);
Expand All @@ -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);
Expand Down

0 comments on commit e5dd3cc

Please sign in to comment.