diff mbox

target-arm: implement WFE/YIELD as a yield for AArch64

Message ID 1397588401-20366-1-git-send-email-robherring2@gmail.com
State Superseded
Headers show

Commit Message

Rob Herring April 15, 2014, 7 p.m. UTC
From: Rob Herring <rob.herring@linaro.org>

Like was done for AArch32 for WFE, implement both WFE and YIELD as a
yield operation. This speeds up multi-core system emulation.

Signed-off-by: Rob Herring <rob.herring@linaro.org>
---
 target-arm/translate-a64.c | 6 ++++++
 1 file changed, 6 insertions(+)

Comments

Peter Maydell April 15, 2014, 7:04 p.m. UTC | #1
On 15 April 2014 20:00, Rob Herring <robherring2@gmail.com> wrote:
> From: Rob Herring <rob.herring@linaro.org>
>
> Like was done for AArch32 for WFE, implement both WFE and YIELD as a
> yield operation. This speeds up multi-core system emulation.
>
> Signed-off-by: Rob Herring <rob.herring@linaro.org>

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>

thanks
-- PMM
diff mbox

Patch

diff --git a/target-arm/translate-a64.c b/target-arm/translate-a64.c
index 226a1dd..0181d4b 100644
--- a/target-arm/translate-a64.c
+++ b/target-arm/translate-a64.c
@@ -1151,6 +1151,8 @@  static void handle_hint(DisasContext *s, uint32_t insn,
         return;
     case 1: /* YIELD */
     case 2: /* WFE */
+        s->is_jmp = DISAS_WFE;
+        return;
     case 4: /* SEV */
     case 5: /* SEVL */
         /* we treat all as NOP at least for now */
@@ -10769,6 +10771,10 @@  void gen_intermediate_code_internal_a64(ARMCPU *cpu,
         case DISAS_EXC:
         case DISAS_SWI:
             break;
+        case DISAS_WFE:
+            gen_a64_set_pc_im(dc->pc);
+            gen_helper_wfe(cpu_env);
+            break;
         case DISAS_WFI:
             /* This is a special case because we don't want to just halt the CPU
              * if trying to debug across a WFI.