From c9eb5dd9ce567a1d4ae553c50fa7fed2646066fe Mon Sep 17 00:00:00 2001 From: Matt Borgerson Date: Fri, 28 Jul 2023 14:20:32 -0700 Subject: [PATCH] tcg/i386: Support fabs,fchs with unique out,in --- tcg/i386/tcg-target.c.inc | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/tcg/i386/tcg-target.c.inc b/tcg/i386/tcg-target.c.inc index 81d315474e..e49723a2e2 100644 --- a/tcg/i386/tcg-target.c.inc +++ b/tcg/i386/tcg-target.c.inc @@ -2618,13 +2618,17 @@ static inline void tcg_out_op(TCGContext *s, TCGOpcode opc, break; } OP_f32_f64(abs): - assert(a0 == a1); /* FIXME: add mov */ + if (a0 != a1) { + tcg_out_mov(s, dp ? TCG_TYPE_F64 : TCG_TYPE_F32, a0, a1); + } tcg_out_modrm_pool(s, OPC_PAND, a0); new_pool_l2(s, R_386_PC32, s->code_ptr - 4, -4, dp ? fabs_mask64 : fabs_mask32, 0); break; OP_f32_f64(chs): - assert(a0 == a1); /* FIXME: add mov */ + if (a0 != a1) { + tcg_out_mov(s, dp ? TCG_TYPE_F64 : TCG_TYPE_F32, a0, a1); + } tcg_out_modrm_pool(s, OPC_PXOR, a0); new_pool_l2(s, R_386_PC32, s->code_ptr - 4, -4, dp ? fchs_mask64 : fchs_mask32, 0);