Unified · Split
| @@ -171,6 +171,25 @@ static void asm_nullary_opcode(int token) · 170 unmodified lines | |||
| 171 | } | 171 | } |
| 172 | } | 172 | } |
| 173 | 173 | ||
| 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 | |||
| 174 | static void asm_block_data_transfer_opcode(TCCState *s1, int token) | 193 | static void asm_block_data_transfer_opcode(TCCState *s1, int token) |
| 175 | { | 194 | { |
| 176 | uint32_t opcode; | 195 | uint32_t opcode; |
| @@ -247,6 +266,8 @@ ST_FUNC void asm_opcode(TCCState *s1, int token) · 70 unmodified lines | |||
| 247 | case TOK_ASM_wfeeq: | 266 | case TOK_ASM_wfeeq: |
| 248 | case TOK_ASM_wfieq: | 267 | case TOK_ASM_wfieq: |
| 249 | return asm_nullary_opcode(token); | 268 | return asm_nullary_opcode(token); |
| 269 | case TOK_ASM_swieq: | ||
| 270 | return asm_unary_opcode(s1, token); | ||
| 250 | default: | 271 | default: |
| 251 | expect("known instruction"); | 272 | expect("known instruction"); |
| 252 | } | 273 | } |
| @@ -54,6 +54,7 @@ · 53 unmodified lines | |||
| 54 | DEF_ASM_CONDED(nop) | 54 | DEF_ASM_CONDED(nop) |
| 55 | DEF_ASM_CONDED(wfe) | 55 | DEF_ASM_CONDED(wfe) |
| 56 | DEF_ASM_CONDED(wfi) | 56 | DEF_ASM_CONDED(wfi) |
| 57 | DEF_ASM_CONDED(swi) | ||
| 57 | 58 | ||
| 58 | /* instruction macros */ | 59 | /* instruction macros */ |
| 59 | 60 | ||