summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target
diff options
context:
space:
mode:
authorTim Northover <tnorthover@apple.com>2014-05-15 11:16:19 +0000
committerTim Northover <tnorthover@apple.com>2014-05-15 11:16:19 +0000
commitdd8fca513682f6899d36b7161e48659fa216bba2 (patch)
treeb56b04f0b23d86964740abf14dae4fbb3890eb73 /llvm/lib/Target
parentdd2d84a223116f2ace36cbc513c04df161d7653b (diff)
downloadbcm5719-llvm-dd8fca513682f6899d36b7161e48659fa216bba2.tar.gz
bcm5719-llvm-dd8fca513682f6899d36b7161e48659fa216bba2.zip
ARM64: add correct vector registers during asm parsing
Previously, we ignored the difference between V64 and V128 when parsing assembly: they both got mapped to registers in the FPR128 class. This is basically harmless at the moment because they both print and encode the same way. However, it will affect the printing of aliases. llvm-svn: 208866
Diffstat (limited to 'llvm/lib/Target')
-rw-r--r--llvm/lib/Target/ARM64/ARM64RegisterInfo.td19
-rw-r--r--llvm/lib/Target/ARM64/AsmParser/ARM64AsmParser.cpp9
2 files changed, 23 insertions, 5 deletions
diff --git a/llvm/lib/Target/ARM64/ARM64RegisterInfo.td b/llvm/lib/Target/ARM64/ARM64RegisterInfo.td
index c6ce671d56f..fb82598ff7a 100644
--- a/llvm/lib/Target/ARM64/ARM64RegisterInfo.td
+++ b/llvm/lib/Target/ARM64/ARM64RegisterInfo.td
@@ -434,10 +434,21 @@ def QQQQ : RegisterClass<"ARM64", [untyped], 128, (add QSeqQuads)> {
// Vector operand versions of the FP registers. Alternate name printing and
// assmebler matching.
-def VectorRegAsmOperand : AsmOperandClass { let Name = "VectorReg"; }
-let ParserMatchClass = VectorRegAsmOperand in {
-def V64 : RegisterOperand<FPR64, "printVRegOperand">;
-def V128 : RegisterOperand<FPR128, "printVRegOperand">;
+def VectorReg64AsmOperand : AsmOperandClass {
+ let Name = "VectorReg64";
+ let PredicateMethod = "isVectorReg";
+}
+def VectorReg128AsmOperand : AsmOperandClass {
+ let Name = "VectorReg128";
+ let PredicateMethod = "isVectorReg";
+}
+
+def V64 : RegisterOperand<FPR64, "printVRegOperand"> {
+ let ParserMatchClass = VectorReg64AsmOperand;
+}
+
+def V128 : RegisterOperand<FPR128, "printVRegOperand"> {
+ let ParserMatchClass = VectorReg128AsmOperand;
}
def VectorRegLoAsmOperand : AsmOperandClass { let Name = "VectorRegLo"; }
diff --git a/llvm/lib/Target/ARM64/AsmParser/ARM64AsmParser.cpp b/llvm/lib/Target/ARM64/AsmParser/ARM64AsmParser.cpp
index a68f4db633a..d95a51167d5 100644
--- a/llvm/lib/Target/ARM64/AsmParser/ARM64AsmParser.cpp
+++ b/llvm/lib/Target/ARM64/AsmParser/ARM64AsmParser.cpp
@@ -1188,8 +1188,15 @@ public:
Inst.addOperand(MCOperand::CreateReg(getReg()));
}
- void addVectorRegOperands(MCInst &Inst, unsigned N) const {
+ void addVectorReg64Operands(MCInst &Inst, unsigned N) const {
assert(N == 1 && "Invalid number of operands!");
+ assert(ARM64MCRegisterClasses[ARM64::FPR128RegClassID].contains(getReg()));
+ Inst.addOperand(MCOperand::CreateReg(ARM64::D0 + getReg() - ARM64::Q0));
+ }
+
+ void addVectorReg128Operands(MCInst &Inst, unsigned N) const {
+ assert(N == 1 && "Invalid number of operands!");
+ assert(ARM64MCRegisterClasses[ARM64::FPR128RegClassID].contains(getReg()));
Inst.addOperand(MCOperand::CreateReg(getReg()));
}
OpenPOWER on IntegriCloud