OSDN Git Service

* config/arm/thumb.md (extendqisi2_insn): Cope with REG +
authorlaw <law@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 19 Aug 1998 16:56:21 +0000 (16:56 +0000)
committerlaw <law@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 19 Aug 1998 16:56:21 +0000 (16:56 +0000)
        OFFSET addressing.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@21862 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/config/arm/thumb.md

index 0369bb1..93d0c05 100644 (file)
     {
       ops[1] = XEXP (XEXP (operands[1], 0), 0);
       ops[2] = XEXP (XEXP (operands[1], 0), 1);
-      output_asm_insn (\"ldrsb\\t%0, [%1, %2]\", ops);
+      
+      if (GET_CODE (ops[1]) == REG && GET_CODE (ops[2]) == REG)
+        output_asm_insn (\"ldrsb\\t%0, [%1, %2]\", ops);
+      else if (GET_CODE (ops[1]) == REG)
+        {
+          if (REGNO (ops[1]) == REGNO (operands[0]))
+            output_asm_insn (\"ldrb\\t%0, [%1, %2]\;lsl\\t%0, %0, #24\;asr\\t%0, %0, #24\", ops);
+         else
+            output_asm_insn (\"mov\\t%0, %2\;ldrsb\\t%0, [%1, %0]\", ops);
+       }
+      else
+        {
+          if (REGNO (ops[2]) == REGNO (operands[0]))
+            output_asm_insn (\"ldrb\\t%0, [%2, %1]\;lsl\\t%0, %0, #24\;asr\\t%0, %0, #24\", ops);
+         else
+            output_asm_insn (\"mov\\t%0, %2\;ldrsb\\t%0, [%1, %0]\", ops);
+        }
     }
   else if (REGNO (operands[0]) == REGNO (XEXP (operands[1], 0)))
     {