]> git.ipfire.org Git - thirdparty/qemu.git/commitdiff
target/i386/tcg: move fcom/fcomp differentiation to gen_helper_fp_arith_ST0_FT0
authorPaolo Bonzini <pbonzini@redhat.com>
Wed, 24 Apr 2024 10:20:17 +0000 (12:20 +0200)
committerPaolo Bonzini <pbonzini@redhat.com>
Sat, 27 Dec 2025 09:11:12 +0000 (10:11 +0100)
There is only one call site for gen_helper_fp_arith_ST0_FT0(), therefore
there is no need to check the op1 == 3 in the caller.  Once this is done,
eliminate the goto to that call site.

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
target/i386/tcg/translate.c

index 68f41b374237fc3f3f7c9d6105b46423f452a2d1..4b77cff8ee791c55826f33345ee26336f1b80275 100644 (file)
@@ -1485,6 +1485,7 @@ static void gen_helper_fp_arith_ST0_FT0(int op)
         break;
     case 3:
         gen_helper_fcom_ST0_FT0(tcg_env);
+        gen_helper_fpop(tcg_env);
         break;
     case 4:
         gen_helper_fsub_ST0_FT0(tcg_env);
@@ -2460,36 +2461,28 @@ static void gen_x87(DisasContext *s, X86DecodedInsn *decode)
             tcg_gen_qemu_ld_i32(s->tmp2_i32, s->A0,
                                 s->mem_index, MO_LEUL);
             gen_helper_flds_FT0(tcg_env, s->tmp2_i32);
-            goto fp_arith_ST0_FT0;
+            gen_helper_fp_arith_ST0_FT0(op & 7);
+            break;
 
         case 0x10 ... 0x17: /* fixxxl */
             tcg_gen_qemu_ld_i32(s->tmp2_i32, s->A0,
                                 s->mem_index, MO_LEUL);
             gen_helper_fildl_FT0(tcg_env, s->tmp2_i32);
-            goto fp_arith_ST0_FT0;
+            gen_helper_fp_arith_ST0_FT0(op & 7);
+            break;
 
         case 0x20 ... 0x27: /* fxxxl */
             tcg_gen_qemu_ld_i64(s->tmp1_i64, s->A0,
                                 s->mem_index, MO_LEUQ);
             gen_helper_fldl_FT0(tcg_env, s->tmp1_i64);
-            goto fp_arith_ST0_FT0;
+            gen_helper_fp_arith_ST0_FT0(op & 7);
+            break;
 
         case 0x30 ... 0x37: /* fixxx */
             tcg_gen_qemu_ld_i32(s->tmp2_i32, s->A0,
                                 s->mem_index, MO_LESW);
             gen_helper_fildl_FT0(tcg_env, s->tmp2_i32);
-            goto fp_arith_ST0_FT0;
-
-fp_arith_ST0_FT0:
-            {
-                int op1 = op & 7;
-
-                gen_helper_fp_arith_ST0_FT0(op1);
-                if (op1 == 3) {
-                    /* fcomp needs pop */
-                    gen_helper_fpop(tcg_env);
-                }
-            }
+            gen_helper_fp_arith_ST0_FT0(op & 7);
             break;
 
         case 0x08: /* flds */