From e5dd3cc1cef8204bb0b251f9170c6f8c11021935 Mon Sep 17 00:00:00 2001 From: Matt Borgerson Date: Sun, 30 Jul 2023 21:16:01 -0700 Subject: [PATCH] tcg/i386: Simplify FP ops further when AVX is available --- tcg/i386/tcg-target.c.inc | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tcg/i386/tcg-target.c.inc b/tcg/i386/tcg-target.c.inc index 0e67d558af..a7ede4c2b6 100644 --- a/tcg/i386/tcg-target.c.inc +++ b/tcg/i386/tcg-target.c.inc @@ -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);