AArch64: error when both positional & named operands are used.
authorTim Northover <tnorthover@apple.com>
Thu, 13 Mar 2014 09:00:13 +0000 (09:00 +0000)
committerTim Northover <tnorthover@apple.com>
Thu, 13 Mar 2014 09:00:13 +0000 (09:00 +0000)
Only one instruction pair needed changing: SMULH & UMULH. The previous
code worked, but MC was doing extra work treating Ra as a valid
operand (which then got completely overwritten in MCCodeEmitter).

No behaviour change, so no tests.

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

lib/Target/AArch64/AArch64.td
lib/Target/AArch64/AArch64InstrFormats.td
lib/Target/AArch64/AArch64InstrInfo.td

index d0f9bd4600262c4ad2641c0c90018aa72cfc3adf..e49afd60c8e33498552f883674d37db62555c2be 100644 (file)
@@ -70,7 +70,9 @@ include "AArch64CallingConv.td"
 
 include "AArch64InstrInfo.td"
 
-def AArch64InstrInfo : InstrInfo;
+def AArch64InstrInfo : InstrInfo {
+  let noNamedPositionallyEncodedOperands = 1;
+}
 
 //===----------------------------------------------------------------------===//
 // Declare the target which we are implementing
index 34f917caabe7a225bb498e716d46214f41758afb..4cc3813203ce3a2cf0823fc0bf57bf71465096b0 100644 (file)
@@ -346,15 +346,13 @@ class A64I_dp3<bit sf, bits<6> opcode,
                dag outs, dag ins, string asmstr,
                list<dag> patterns, InstrItinClass itin>
   : A64InstRdnm<outs, ins, asmstr, patterns, itin> {
-  bits<5> Ra;
-
   let Inst{31} = sf;
   let Inst{30-29} = opcode{5-4};
   let Inst{28-24} = 0b11011;
   let Inst{23-21} = opcode{3-1};
   // Inherits Rm in 20-16
   let Inst{15} = opcode{0};
-  let Inst{14-10} = Ra;
+  // {14-10} mostly Ra, but unspecified for SMULH/UMULH
   // Inherits Rn in 9-5
   // Inherits Rd in 4-0
 }
index 4588eb73c5d0b20101bad5831a0b8d3ef0dc2fec..3dc66a1f238793d0a6c463c771422270a4f3fe48 100644 (file)
@@ -1881,6 +1881,9 @@ class A64I_dp3_4operand<bit sf, bits<6> opcode, RegisterClass AccReg,
              !strconcat(asmop, "\t$Rd, $Rn, $Rm, $Ra"),
              [(set AccTy:$Rd, pattern)], NoItinerary>,
     Sched<[WriteMAC, ReadMAC, ReadMAC, ReadMAC]> {
+  bits<5> Ra;
+  let Inst{14-10} = Ra;
+
   RegisterClass AccGPR = AccReg;
   RegisterClass SrcGPR = SrcReg;
 }