On 12/10/25 07:16, Paolo Bonzini wrote:
@@ -2801,22 +2785,16 @@ static void gen_x87(DisasContext *s, X86DecodedInsn 
*decode)
              }
              break;
          case 0x00: case 0x01: case 0x04 ... 0x07: /* fxxx st, sti */
+            gen_helper_fmov_FT0_STN(tcg_env,
+                                    tcg_constant_i32(opreg));
+            gen_helper_fp_arith_ST0_FT0(op & 7);
+            break;
+
          case 0x20: case 0x21: case 0x24 ... 0x27: /* fxxx sti, st */
          case 0x30: case 0x31: case 0x34 ... 0x37: /* fxxxp sti, st */
-            {
-                int op1;
-
-                op1 = op & 7;
-                if (op >= 0x20) {
-                    gen_helper_fp_arith_STN_ST0(op1, opreg);
-                    if (op >= 0x30) {
-                        gen_helper_fpop(tcg_env);
-                    }
-                } else {
-                    gen_helper_fmov_FT0_STN(tcg_env,
-                                            tcg_constant_i32(opreg));
-                    gen_helper_fp_arith_ST0_FT0(op1);
-                }
+            gen_helper_fp_arith_STN_ST0(op & 7, opreg);
+            if (op >= 0x30) {
+                gen_helper_fpop(tcg_env);
              }
              break;

Leaving the op >= 30 check here?
I'd have expected

case 0x20: case 0x21: case 0x24 ... 0x27: /* fxxx sti, st */
    gen_helper_fp_arith_STN_ST0(op & 7, opreg);
    break;
case 0x30: case 0x31: case 0x34 ... 0x37: /* fxxxp sti, st */
    gen_helper_fp_arith_STN_ST0(op & 7, opreg);
    gen_helper_fpop(tcg_env);
    break;

Anyway,
Reviewed-by: Richard Henderson <[email protected]>


r~

Reply via email to