tinycc-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Tinycc-devel] [PATCH 5/8] arm-asm: Add ldc2, ldc2l, stc2, stc2l


From: Danny Milosavljevic
Subject: [Tinycc-devel] [PATCH 5/8] arm-asm: Add ldc2, ldc2l, stc2, stc2l
Date: Thu, 14 Jan 2021 23:22:24 +0100

---
 arm-asm.c | 22 +++++++++++++++++++++-
 arm-tok.h |  4 ++++
 2 files changed, 25 insertions(+), 1 deletion(-)

diff --git a/arm-asm.c b/arm-asm.c
index 9b5fa71..3591651 100644
--- a/arm-asm.c
+++ b/arm-asm.c
@@ -1406,7 +1406,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 */
@@ -1631,6 +1646,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;
diff --git a/arm-tok.h b/arm-tok.h
index 66f7178..28794e2 100644
--- a/arm-tok.h
+++ b/arm-tok.h
@@ -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)
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]