arm-asm: Add wfe, wfi

This commit is contained in:
Danny Milosavljevic 2020-12-26 16:46:08 +01:00
parent aaf052391d
commit a16678e9f3
No known key found for this signature in database
GPG Key ID: E71A35542C30BAA5
2 changed files with 9 additions and 0 deletions

View File

@ -83,6 +83,11 @@ static void asm_nullary_opcode(int token)
case TOK_ASM_nopeq: case TOK_ASM_nopeq:
asm_emit_opcode(token, 0xd << 21); // mov r0, r0 asm_emit_opcode(token, 0xd << 21); // mov r0, r0
break; break;
case TOK_ASM_wfeeq:
asm_emit_opcode(token, 0x320f002);
case TOK_ASM_wfieq:
asm_emit_opcode(token, 0x320f003);
break;
default: default:
expect("nullary instruction"); expect("nullary instruction");
} }
@ -103,6 +108,8 @@ ST_FUNC void asm_opcode(TCCState *s1, int token)
switch (ARM_INSTRUCTION_GROUP(token)) { switch (ARM_INSTRUCTION_GROUP(token)) {
case TOK_ASM_nopeq: case TOK_ASM_nopeq:
case TOK_ASM_wfeeq:
case TOK_ASM_wfieq:
return asm_nullary_opcode(token); return asm_nullary_opcode(token);
default: default:
expect("known instruction"); expect("known instruction");

View File

@ -52,3 +52,5 @@
/* Note: add new tokens after nop (MUST always use DEF_ASM_CONDED) */ /* Note: add new tokens after nop (MUST always use DEF_ASM_CONDED) */
DEF_ASM_CONDED(nop) DEF_ASM_CONDED(nop)
DEF_ASM_CONDED(wfe)
DEF_ASM_CONDED(wfi)