tinycc-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Tinycc-devel] [PATCH 06/16] arm-asm: Add wfe, wfi


From: Danny Milosavljevic
Subject: [Tinycc-devel] [PATCH 06/16] arm-asm: Add wfe, wfi
Date: Sat, 26 Dec 2020 22:58:07 +0100

---
 arm-asm.c | 7 +++++++
 arm-tok.h | 2 ++
 2 files changed, 9 insertions(+)

diff --git a/arm-asm.c b/arm-asm.c
index d4d4930..4c663c3 100644
--- a/arm-asm.c
+++ b/arm-asm.c
@@ -83,6 +83,11 @@ static void asm_nullary_opcode(int token)
     case TOK_ASM_nopeq:
         asm_emit_opcode(token, 0xd << 21); // mov r0, r0
         break;
+    case TOK_ASM_wfeeq:
+        asm_emit_opcode(token, 0x320f002);
+    case TOK_ASM_wfieq:
+        asm_emit_opcode(token, 0x320f003);
+        break;
     default:
         expect("nullary instruction");
     }
@@ -103,6 +108,8 @@ ST_FUNC void asm_opcode(TCCState *s1, int token)
 
     switch (ARM_INSTRUCTION_GROUP(token)) {
     case TOK_ASM_nopeq:
+    case TOK_ASM_wfeeq:
+    case TOK_ASM_wfieq:
         return asm_nullary_opcode(token);
     default:
         expect("known instruction");
diff --git a/arm-tok.h b/arm-tok.h
index bcbabe3..6d9c596 100644
--- a/arm-tok.h
+++ b/arm-tok.h
@@ -52,3 +52,5 @@
 /* Note: add new tokens after nop (MUST always use DEF_ASM_CONDED) */
 
  DEF_ASM_CONDED(nop)
+ DEF_ASM_CONDED(wfe)
+ DEF_ASM_CONDED(wfi)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]