OSDN Git Service

[XCore] Add missing l2rus instructions.
authorRichard Osborne <richard@xmos.com>
Sun, 27 Jan 2013 22:28:30 +0000 (22:28 +0000)
committerRichard Osborne <richard@xmos.com>
Sun, 27 Jan 2013 22:28:30 +0000 (22:28 +0000)
These instructions are not targeted by the compiler but they are
needed for the MC layer.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173634 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/XCore/Disassembler/XCoreDisassembler.cpp
lib/Target/XCore/XCoreInstrInfo.td
test/MC/Disassembler/XCore/xcore.txt

index a94f5b9..c995a9c 100644 (file)
@@ -449,6 +449,12 @@ DecodeL2OpInstructionFail(MCInst &Inst, unsigned Insn, uint64_t Address,
   case 0x12c:
     Inst.setOpcode(XCore::ASHR_l2rus);
     return DecodeL2RUSBitpInstruction(Inst, Insn, Address, Decoder);
+  case 0x12d:
+    Inst.setOpcode(XCore::OUTPW_l2rus);
+    return DecodeL2RUSBitpInstruction(Inst, Insn, Address, Decoder);
+  case 0x12e:
+    Inst.setOpcode(XCore::INPW_l2rus);
+    return DecodeL2RUSBitpInstruction(Inst, Insn, Address, Decoder);
   case 0x13c:
     Inst.setOpcode(XCore::LDAWF_l2rus);
     return DecodeL2RUSInstruction(Inst, Insn, Address, Decoder);
index 613f9cb..befc096 100644 (file)
@@ -451,7 +451,6 @@ def CRC_l3r : _FL3RSrcDst<0b101011100, (outs GRRegs:$dst),
                              (int_xcore_crc32 GRRegs:$src1, GRRegs:$src2,
                                               GRRegs:$src3))]>;
 
-// TODO inpw, outpw
 let mayStore=1 in {
 def ST16_l3r : _FL3R<0b100001100, (outs),
                      (ins GRRegs:$val, GRRegs:$addr, GRRegs:$offset),
@@ -462,6 +461,14 @@ def ST8_l3r : _FL3R<0b100011100, (outs),
                     "st8 $val, $addr[$offset]", []>;
 }
 
+def INPW_l2rus : _FL2RUSBitp<0b100101110, (outs GRRegs:$a),
+                             (ins GRRegs:$b, i32imm:$c), "inpw $a, res[$b], $c",
+                             []>;
+
+def OUTPW_l2rus : _FL2RUSBitp<0b100101101, (outs),
+                              (ins GRRegs:$a, GRRegs:$b, i32imm:$c),
+                              "outpw res[$b], $a, $c", []>;
+
 // Four operand long
 let Constraints = "$e = $a,$f = $b" in {
 def MACCU_l4r : _FL4RSrcDstSrcDst<
index 21b053b..f1ec31d 100644 (file)
 # CHECK: ldaw r8, r2[-9]
 0x09 0xfd 0xec 0xa7
 
+# CHECK: inpw r6, res[r1], 8
+0xe4 0xfc 0xee 0x97
+
+# CHECK: outpw res[r3], r0, 2
+0x0e 0xf8 0xed 0x97
+
 # ru6 / lru6 instructions
 
 # CHECK: bt r6, -5