]> www.infradead.org Git - users/dwmw2/qemu.git/commitdiff
tcg/tci: Support TCG_COND_TST{EQ,NE}
authorRichard Henderson <richard.henderson@linaro.org>
Wed, 25 Oct 2023 05:52:26 +0000 (22:52 -0700)
committerRichard Henderson <richard.henderson@linaro.org>
Mon, 5 Feb 2024 22:45:41 +0000 (22:45 +0000)
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
tcg/tci.c
tcg/tci/tcg-target.h

index 3cc851b7bdf978cf99eb640652617c2e52f123c3..39adcb7d82e3e0511f6c2d67b6dfe2990eae0e08 100644 (file)
--- a/tcg/tci.c
+++ b/tcg/tci.c
@@ -228,6 +228,12 @@ static bool tci_compare32(uint32_t u0, uint32_t u1, TCGCond condition)
     case TCG_COND_GTU:
         result = (u0 > u1);
         break;
+    case TCG_COND_TSTEQ:
+        result = (u0 & u1) == 0;
+        break;
+    case TCG_COND_TSTNE:
+        result = (u0 & u1) != 0;
+        break;
     default:
         g_assert_not_reached();
     }
@@ -270,6 +276,12 @@ static bool tci_compare64(uint64_t u0, uint64_t u1, TCGCond condition)
     case TCG_COND_GTU:
         result = (u0 > u1);
         break;
+    case TCG_COND_TSTEQ:
+        result = (u0 & u1) == 0;
+        break;
+    case TCG_COND_TSTNE:
+        result = (u0 & u1) != 0;
+        break;
     default:
         g_assert_not_reached();
     }
@@ -1041,6 +1053,8 @@ static const char *str_c(TCGCond c)
         [TCG_COND_GEU] = "geu",
         [TCG_COND_LEU] = "leu",
         [TCG_COND_GTU] = "gtu",
+        [TCG_COND_TSTEQ] = "tsteq",
+        [TCG_COND_TSTNE] = "tstne",
     };
 
     assert((unsigned)c < ARRAY_SIZE(cond));
index 609b2f4e4a4952bf4ab5f0ed199f81a196a5fd78..a076f401d21602b12d42034e16fd889b98231d24 100644 (file)
 
 #define TCG_TARGET_HAS_qemu_ldst_i128   0
 
-#define TCG_TARGET_HAS_tst              0
+#define TCG_TARGET_HAS_tst              1
 
 /* Number of registers available. */
 #define TCG_TARGET_NB_REGS 16