target/sparc: Implement MWAIT
authorRichard Henderson <richard.henderson@linaro.org>
Sun, 5 Nov 2023 05:12:24 +0000 (22:12 -0700)
committerRichard Henderson <richard.henderson@linaro.org>
Wed, 5 Jun 2024 16:10:02 +0000 (09:10 -0700)
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
target/sparc/insns.decode
target/sparc/translate.c

index a7720560f83ab3b42de77f97d4f9c5b7010f6889..fbcb4f7aef73affbd21d52032dcd873fa202d3f6 100644 (file)
@@ -124,6 +124,7 @@ CALL    01 i:s30
     WRTICK_CMPR     10 10111 110000 ..... . .............  @n_r_ri
     WRSTICK         10 11000 110000 ..... . .............  @n_r_ri
     WRSTICK_CMPR    10 11001 110000 ..... . .............  @n_r_ri
+    WRMWAIT         10 11100 110000 ..... . .............  @n_r_ri
   ]
   # Before v8, rs1==0 was WRY, and the rest executed as nop.
   [
index b10936a61a3376e5fe54d876945c7d89309e7d4f..6d0ad38fd5855872aec6f7058212804859f8d5bf 100644 (file)
@@ -3344,6 +3344,17 @@ static void do_wrpowerdown(DisasContext *dc, TCGv src)
 
 TRANS(WRPOWERDOWN, POWERDOWN, do_wr_special, a, supervisor(dc), do_wrpowerdown)
 
+static void do_wrmwait(DisasContext *dc, TCGv src)
+{
+    /*
+     * TODO: This is a stub version of mwait, which merely recognizes
+     * interrupts immediately and does not wait.
+     */
+    dc->base.is_jmp = DISAS_EXIT;
+}
+
+TRANS(WRMWAIT, VIS4, do_wr_special, a, true, do_wrmwait)
+
 static void do_wrpsr(DisasContext *dc, TCGv src)
 {
     gen_helper_wrpsr(tcg_env, src);