]> git.proxmox.com Git - mirror_qemu.git/commitdiff
target/alpha: Use tcg_gen_movcond_i64 in gen_fold_mzero
authorRichard Henderson <richard.henderson@linaro.org>
Fri, 4 Aug 2023 23:40:42 +0000 (23:40 +0000)
committerRichard Henderson <richard.henderson@linaro.org>
Thu, 24 Aug 2023 18:22:42 +0000 (11:22 -0700)
The setcond + neg + and sequence is a complex method of
performing a conditional move.

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
target/alpha/translate.c

index 846f3d8091b10fa0233767718d9b2d0957a619c3..0839182a1f647582fea7c4f4c02a35589fcb2888 100644 (file)
@@ -517,10 +517,9 @@ static void gen_fold_mzero(TCGCond cond, TCGv dest, TCGv src)
 
     case TCG_COND_GE:
     case TCG_COND_LT:
-        /* For >= or <, map -0.0 to +0.0 via comparison and mask.  */
-        tcg_gen_setcondi_i64(TCG_COND_NE, dest, src, mzero);
-        tcg_gen_neg_i64(dest, dest);
-        tcg_gen_and_i64(dest, dest, src);
+        /* For >= or <, map -0.0 to +0.0. */
+        tcg_gen_movcond_i64(TCG_COND_NE, dest, src, tcg_constant_i64(mzero),
+                            src, tcg_constant_i64(0));
         break;
 
     default: