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
14111411
14121412 // TODO: Support options.
14131413
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)) {
14151430 case TOK_ASM_stcleq:
14161431 long_transfer = 1;
14171432 /* fallthrough */
@@ -1636,6 +1651,11 @@ ST_FUNC void asm_opcode(TCCState *s1, int token) · 218 unmodified lines
16361651 switch (token) {
16371652 case TOK_ASM_cdp2:
16381653 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);
16391659 default:
16401660 expect("instruction");
16411661 return;
arm-tok.h+4−0
@@ -73,6 +73,10 @@ · 72 unmodified lines
7373 /* instructions that have no condition code */
7474
7575 DEF_ASM(cdp2)
76+ DEF_ASM(ldc2)
77+ DEF_ASM(ldc2l)
78+ DEF_ASM(stc2)
79+ DEF_ASM(stc2l)
7680
7781 #define ARM_INSTRUCTION_GROUP(tok) ((((tok) - TOK_ASM_nopeq) & 0xFFFFFFF0) + TOK_ASM_nopeq)
7882

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