History

arm-asm: Add swi

Danny Milosavljevic committed 5 years ago

Commit c9e0c2a1 parent b4959592 files · +22 −0Browse files

Unified · Split

2 files
  1. arm-asm.c +21 −0
  2. arm-tok.h +1 −0
arm-asm.c+21−0
@@ -171,6 +171,25 @@ static void asm_nullary_opcode(int token) · 170 unmodified lines
171171 }
172172 }
173173
174+static void asm_unary_opcode(TCCState *s1, int token)
175+{
176+ Operand op;
177+ parse_operand(s1, &op);
178+
179+ switch (ARM_INSTRUCTION_GROUP(token)) {
180+ case TOK_ASM_swieq:
181+ if (op.type != OP_IM8)
182+ expect("immediate 8-bit unsigned integer");
183+ else {
184+ /* Note: Dummy operand (ignored by processor): ARM ref documented 0...255, ARM instruction set documented 24 bit */
185+ asm_emit_opcode(token, (0xf << 24) | op.e.v);
186+ }
187+ break;
188+ default:
189+ expect("unary instruction");
190+ }
191+}
192+
174193 static void asm_block_data_transfer_opcode(TCCState *s1, int token)
175194 {
176195 uint32_t opcode;
@@ -247,6 +266,8 @@ ST_FUNC void asm_opcode(TCCState *s1, int token) · 70 unmodified lines
247266 case TOK_ASM_wfeeq:
248267 case TOK_ASM_wfieq:
249268 return asm_nullary_opcode(token);
269+ case TOK_ASM_swieq:
270+ return asm_unary_opcode(s1, token);
250271 default:
251272 expect("known instruction");
252273 }
arm-tok.h+1−0
@@ -54,6 +54,7 @@ · 53 unmodified lines
5454 DEF_ASM_CONDED(nop)
5555 DEF_ASM_CONDED(wfe)
5656 DEF_ASM_CONDED(wfi)
57+ DEF_ASM_CONDED(swi)
5758
5859 /* instruction macros */
5960

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t