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

This commit is contained in:
Danny Milosavljevic 2021-01-14 02:43:35 +01:00
parent 7900a6bb61
commit 31dde11ad5
No known key found for this signature in database
GPG Key ID: E71A35542C30BAA5
2 changed files with 25 additions and 1 deletions

View File

@ -1411,7 +1411,22 @@ static void asm_coprocessor_data_transfer_opcode(TCCState *s1, int token)
// TODO: Support options.
switch (ARM_INSTRUCTION_GROUP(token)) {
if (token == TOK_ASM_ldc2 || token == TOK_ASM_stc2 || token == TOK_ASM_ldc2l || token == TOK_ASM_stc2l) {
switch (token) {
case TOK_ASM_ldc2l:
long_transfer = 1; // long transfer
/* fallthrough */
case TOK_ASM_ldc2:
asm_emit_coprocessor_data_transfer(0xF, coprocessor, coprocessor_destination_register, &ops[1], &ops[2], op2_minus, preincrement, exclam, long_transfer, 1);
break;
case TOK_ASM_stc2l:
long_transfer = 1; // long transfer
/* fallthrough */
case TOK_ASM_stc2:
asm_emit_coprocessor_data_transfer(0xF, coprocessor, coprocessor_destination_register, &ops[1], &ops[2], op2_minus, preincrement, exclam, long_transfer, 0);
break;
}
} else switch (ARM_INSTRUCTION_GROUP(token)) {
case TOK_ASM_stcleq:
long_transfer = 1;
/* fallthrough */
@ -1636,6 +1651,11 @@ ST_FUNC void asm_opcode(TCCState *s1, int token)
switch (token) {
case TOK_ASM_cdp2:
return asm_coprocessor_opcode(s1, token);
case TOK_ASM_ldc2:
case TOK_ASM_ldc2l:
case TOK_ASM_stc2:
case TOK_ASM_stc2l:
return asm_coprocessor_data_transfer_opcode(s1, token);
default:
expect("instruction");
return;

View File

@ -73,6 +73,10 @@
/* instructions that have no condition code */
DEF_ASM(cdp2)
DEF_ASM(ldc2)
DEF_ASM(ldc2l)
DEF_ASM(stc2)
DEF_ASM(stc2l)
#define ARM_INSTRUCTION_GROUP(tok) ((((tok) - TOK_ASM_nopeq) & 0xFFFFFFF0) + TOK_ASM_nopeq)