History

arm-asm: Add ldc2, ldc2l, stc2, stc2l

Danny Milosavljevic committed 5 years ago

Commit 31dde111 parent 7900a6b2 files · +25 −1Browse files

Unified · Split

2 files
  1. arm-asm.c +21 −1
  2. arm-tok.h +4 −0
arm-asm.c+21−1
@@ -1411,7 +1411,22 @@ static void asm_coprocessor_data_transfer_opcode(TCCState *s1, int token) · 1410 unmodified lines
1411 1411
1412 // TODO: Support options.1412 // TODO: Support options.
1413 1413
1414 switch (ARM_INSTRUCTION_GROUP(token)) {1414 if (token == TOK_ASM_ldc2 || token == TOK_ASM_stc2 || token == TOK_ASM_ldc2l || token == TOK_ASM_stc2l) {
1415 switch (token) {
1416 case TOK_ASM_ldc2l:
1417 long_transfer = 1; // long transfer
1418 /* fallthrough */
1419 case TOK_ASM_ldc2:
1420 asm_emit_coprocessor_data_transfer(0xF, coprocessor, coprocessor_destination_register, &ops[1], &ops[2], op2_minus, preincrement, exclam, long_transfer, 1);
1421 break;
1422 case TOK_ASM_stc2l:
1423 long_transfer = 1; // long transfer
1424 /* fallthrough */
1425 case TOK_ASM_stc2:
1426 asm_emit_coprocessor_data_transfer(0xF, coprocessor, coprocessor_destination_register, &ops[1], &ops[2], op2_minus, preincrement, exclam, long_transfer, 0);
1427 break;
1428 }
1429 } else switch (ARM_INSTRUCTION_GROUP(token)) {
1415 case TOK_ASM_stcleq:1430 case TOK_ASM_stcleq:
1416 long_transfer = 1;1431 long_transfer = 1;
1417 /* fallthrough */1432 /* fallthrough */
@@ -1636,6 +1651,11 @@ ST_FUNC void asm_opcode(TCCState *s1, int token) · 218 unmodified lines
1636 switch (token) {1651 switch (token) {
1637 case TOK_ASM_cdp2:1652 case TOK_ASM_cdp2:
1638 return asm_coprocessor_opcode(s1, token);1653 return asm_coprocessor_opcode(s1, token);
1654 case TOK_ASM_ldc2:
1655 case TOK_ASM_ldc2l:
1656 case TOK_ASM_stc2:
1657 case TOK_ASM_stc2l:
1658 return asm_coprocessor_data_transfer_opcode(s1, token);
1639 default:1659 default:
1640 expect("instruction");1660 expect("instruction");
1641 return;1661 return;
arm-tok.h+4−0
@@ -73,6 +73,10 @@ · 72 unmodified lines
73 /* instructions that have no condition code */73 /* instructions that have no condition code */
74 74
75 DEF_ASM(cdp2)75 DEF_ASM(cdp2)
76 DEF_ASM(ldc2)
77 DEF_ASM(ldc2l)
78 DEF_ASM(stc2)
79 DEF_ASM(stc2l)
76 80
77#define ARM_INSTRUCTION_GROUP(tok) ((((tok) - TOK_ASM_nopeq) & 0xFFFFFFF0) + TOK_ASM_nopeq)81#define ARM_INSTRUCTION_GROUP(tok) ((((tok) - TOK_ASM_nopeq) & 0xFFFFFFF0) + TOK_ASM_nopeq)
78 82

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