summaryrefslogtreecommitdiffstats
path: root/llvm
diff options
context:
space:
mode:
authorOwen Anderson <resistor@mac.com>2011-08-12 17:58:32 +0000
committerOwen Anderson <resistor@mac.com>2011-08-12 17:58:32 +0000
commitc5798a3a59d5fde7c60f9224c7f2954e38d7950c (patch)
treebc3c1b4947cce063da6ddfe20aa4fadf31f85d4f /llvm
parentdd7feaf664969541280dd7d2bbe49a444fed7431 (diff)
downloadbcm5719-llvm-c5798a3a59d5fde7c60f9224c7f2954e38d7950c.tar.gz
bcm5719-llvm-c5798a3a59d5fde7c60f9224c7f2954e38d7950c.zip
Separate decoding for STREXD and LDREXD to make each work better.
llvm-svn: 137476
Diffstat (limited to 'llvm')
-rw-r--r--llvm/lib/Target/ARM/ARMInstrInfo.td4
-rw-r--r--llvm/lib/Target/ARM/Disassembler/ARMDisassembler.cpp27
2 files changed, 24 insertions, 7 deletions
diff --git a/llvm/lib/Target/ARM/ARMInstrInfo.td b/llvm/lib/Target/ARM/ARMInstrInfo.td
index fe6a27c1c00..bfcb0f23d93 100644
--- a/llvm/lib/Target/ARM/ARMInstrInfo.td
+++ b/llvm/lib/Target/ARM/ARMInstrInfo.td
@@ -4082,7 +4082,7 @@ def LDREX : AIldrex<0b00, (outs GPR:$Rt), (ins addr_offset_none:$addr),
let hasExtraDefRegAllocReq = 1 in
def LDREXD: AIldrex<0b01, (outs GPR:$Rt, GPR:$Rt2),(ins addr_offset_none:$addr),
NoItinerary, "ldrexd", "\t$Rt, $Rt2, $addr", []> {
- let DecoderMethod = "DecodeDoubleRegExclusive";
+ let DecoderMethod = "DecodeDoubleRegLoad";
}
}
@@ -4099,7 +4099,7 @@ let hasExtraSrcRegAllocReq = 1, Constraints = "@earlyclobber $Rd" in
def STREXD : AIstrex<0b01, (outs GPR:$Rd),
(ins GPR:$Rt, GPR:$Rt2, addr_offset_none:$addr),
NoItinerary, "strexd", "\t$Rd, $Rt, $Rt2, $addr", []> {
- let DecoderMethod = "DecodeDoubleRegExclusive";
+ let DecoderMethod = "DecodeDoubleRegStore";
}
def CLREX : AXI<(outs), (ins), MiscFrm, NoItinerary, "clrex", []>,
diff --git a/llvm/lib/Target/ARM/Disassembler/ARMDisassembler.cpp b/llvm/lib/Target/ARM/Disassembler/ARMDisassembler.cpp
index 201ccf88928..805cf544734 100644
--- a/llvm/lib/Target/ARM/Disassembler/ARMDisassembler.cpp
+++ b/llvm/lib/Target/ARM/Disassembler/ARMDisassembler.cpp
@@ -135,9 +135,10 @@ static bool DecodeMemBarrierOption(llvm::MCInst &Inst, unsigned Insn,
uint64_t Address, const void *Decoder);
static bool DecodeMSRMask(llvm::MCInst &Inst, unsigned Insn,
uint64_t Address, const void *Decoder);
-static bool DecodeDoubleRegExclusive(llvm::MCInst &Inst, unsigned Insn,
+static bool DecodeDoubleRegLoad(llvm::MCInst &Inst, unsigned Insn,
+ uint64_t Address, const void *Decoder);
+static bool DecodeDoubleRegStore(llvm::MCInst &Inst, unsigned Insn,
uint64_t Address, const void *Decoder);
-
static bool DecodeThumbAddSpecialReg(llvm::MCInst &Inst, uint16_t Insn,
uint64_t Address, const void *Decoder);
@@ -2486,15 +2487,31 @@ static bool DecodeMSRMask(llvm::MCInst &Inst, unsigned Val,
return true;
}
-static bool DecodeDoubleRegExclusive(llvm::MCInst &Inst, unsigned Insn,
+static bool DecodeDoubleRegLoad(llvm::MCInst &Inst, unsigned Insn,
+ uint64_t Address, const void *Decoder) {
+ unsigned Rt = fieldFromInstruction32(Insn, 12, 4);
+ unsigned Rn = fieldFromInstruction32(Insn, 16, 4);
+ unsigned pred = fieldFromInstruction32(Insn, 28, 4);
+
+ if ((Rt & 1) || Rt == 0xE || Rn == 0xF) return false;
+
+ if (!DecodeGPRRegisterClass(Inst, Rt, Address, Decoder)) return false;
+ if (!DecodeGPRRegisterClass(Inst, Rt+1, Address, Decoder)) return false;
+ if (!DecodeGPRRegisterClass(Inst, Rn, Address, Decoder)) return false;
+ if (!DecodePredicateOperand(Inst, pred, Address, Decoder)) return false;
+
+ return true;
+}
+
+
+static bool DecodeDoubleRegStore(llvm::MCInst &Inst, unsigned Insn,
uint64_t Address, const void *Decoder) {
unsigned Rd = fieldFromInstruction32(Insn, 12, 4);
unsigned Rt = fieldFromInstruction32(Insn, 0, 4);
unsigned Rn = fieldFromInstruction32(Insn, 16, 4);
unsigned pred = fieldFromInstruction32(Insn, 28, 4);
- if (Inst.getOpcode() == ARM::STREXD)
- if (!DecoderGPRRegisterClass(Inst, Rd, Address, Decoder)) return false;
+ if (!DecoderGPRRegisterClass(Inst, Rd, Address, Decoder)) return false;
if ((Rt & 1) || Rt == 0xE || Rn == 0xF) return false;
if (Rd == Rn || Rd == Rt || Rd == Rt+1) return false;
OpenPOWER on IntegriCloud