History

arm-asm: Add movw

Danny Milosavljevic committed 5 years ago

Commit 14b79731 parent c882d032 files · +11 −1Browse files

Unified · Split

2 files
  1. arm-asm.c +10 −1
  2. arm-tok.h +1 −0
arm-asm.c+10−1
@@ -228,10 +228,18 @@ static void asm_binary_opcode(TCCState *s1, int token) · 227 unmodified lines
228228 if (ops[1].type != OP_REG32) {
229229 switch (ARM_INSTRUCTION_GROUP(token)) {
230230 case TOK_ASM_movteq:
231+ case TOK_ASM_movweq:
231232 if (ops[1].type == OP_IM8 || ops[1].type == OP_IM8N || ops[1].type == OP_IM32) {
232233 if (ops[1].e.v >= 0 && ops[1].e.v <= 0xFFFF) {
233234 uint16_t immediate_value = ops[1].e.v;
234− asm_emit_opcode(token, 0x3400000 | (ops[0].reg << 12) | (immediate_value & 0xF000) << 4 | (immediate_value & 0xFFF));
235+ switch (ARM_INSTRUCTION_GROUP(token)) {
236+ case TOK_ASM_movteq:
237+ asm_emit_opcode(token, 0x3400000 | (ops[0].reg << 12) | (immediate_value & 0xF000) << 4 | (immediate_value & 0xFFF));
238+ break;
239+ case TOK_ASM_movweq:
240+ asm_emit_opcode(token, 0x3000000 | (ops[0].reg << 12) | (immediate_value & 0xF000) << 4 | (immediate_value & 0xFFF));
241+ break;
242+ }
235243 } else
236244 expect("(source operand) immediate 16 bit value");
237245 } else
@@ -1134,6 +1142,7 @@ ST_FUNC void asm_opcode(TCCState *s1, int token) · 896 unmodified lines
11341142 case TOK_ASM_uxtbeq:
11351143 case TOK_ASM_uxtheq:
11361144 case TOK_ASM_movteq:
1145+ case TOK_ASM_movweq:
11371146 return asm_binary_opcode(s1, token);
11381147
11391148 case TOK_ASM_ldreq:
arm-tok.h+1−0
@@ -70,6 +70,7 @@ · 69 unmodified lines
7070 DEF_ASM_CONDED(uxtb)
7171 DEF_ASM_CONDED(uxth)
7272 DEF_ASM_CONDED(movt)
73+ DEF_ASM_CONDED(movw)
7374
7475 /* multiplication */
7576

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