Use the full form of dccci and iccci from the early PPC 405 documents,
authorJoerg Sonnenberger <joerg@bec.de>
Sat, 9 Aug 2014 13:58:31 +0000 (13:58 +0000)
committerJoerg Sonnenberger <joerg@bec.de>
Sat, 9 Aug 2014 13:58:31 +0000 (13:58 +0000)
since the operands are actually used on those cores. Provide aliases for
the only documented case in the newer Power ISA speec.

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

lib/Target/PowerPC/PPCInstrInfo.td
test/MC/PowerPC/ppc64-encoding-4xx.s

index bdcf22fd57dfb364b688ec676eb8bdd6f99e01ed..e33ded03952e273f9f3695260dab0d1a97dc6bbc 100644 (file)
@@ -3128,21 +3128,15 @@ def WRTEEI: I<31, (outs), (ins i1imm:$E), "wrteei $E", IIC_SprMTMSR>,
   let Inst{21-30} = 163;
 }
 
-def DCI: I<31, (outs), (ins u4imm:$CT), "dci $CT", IIC_LdStLoad>,
-              Requires<[IsPPC4xx]> {
-  bits<4> CT;
-
-  let Inst{7-10} = CT;
-  let Inst{21-30} = 454;
-}
-
-def ICI: I<31, (outs), (ins u4imm:$CT), "ici $CT", IIC_LdStLoad>,
-              Requires<[IsPPC4xx]> {
-  bits<4> CT;
-
-  let Inst{7-10} = CT;
-  let Inst{21-30} = 966;
-}
+def DCCCI : XForm_tlb<454, (outs), (ins gprc:$A, gprc:$B),
+               "dccci $A, $B", IIC_LdStLoad>, Requires<[IsPPC4xx]>;
+def ICCCI : XForm_tlb<966, (outs), (ins gprc:$A, gprc:$B),
+               "iccci $A, $B", IIC_LdStLoad>, Requires<[IsPPC4xx]>;
+
+def : InstAlias<"dci 0", (DCCCI R0, R0)>, Requires<[IsPPC4xx]>;
+def : InstAlias<"dccci", (DCCCI R0, R0)>, Requires<[IsPPC4xx]>;
+def : InstAlias<"ici 0", (ICCCI R0, R0)>, Requires<[IsPPC4xx]>;
+def : InstAlias<"iccci", (ICCCI R0, R0)>, Requires<[IsPPC4xx]>;
 
 def MFMSR : XForm_rs<31, 83, (outs gprc:$RT), (ins),
                   "mfmsr $RT", IIC_SprMFMSR, []>;
index e6b92bd0c854d370cbe6b62853b4ef0aed93da4d..5414e1a49bfbcefb14521df68b5f64b01507847e 100644 (file)
 # CHECK-LE: mtspr 988, 2                    # encoding: [0xa6,0xf3,0x5c,0x7c]
             mttbhi %r2
 
-# CHECK-BE: dci 14                          # encoding: [0x7d,0xc0,0x03,0x8c]
-# CHECK-LE: dci 14                          # encoding: [0x8c,0x03,0xc0,0x7d]
-            dci 14
-# CHECK-BE: ici 14                          # encoding: [0x7d,0xc0,0x07,0x8c]
-# CHECK-LE: ici 14                          # encoding: [0x8c,0x07,0xc0,0x7d]
-            ici 14
+# CHECK-BE: dccci 5, 6                      # encoding: [0x7c,0x05,0x33,0x8c]
+# CHECK-LE: dccci 5, 6                      # encoding: [0x8c,0x33,0x05,0x7c]
+            dccci %r5,%r6
+# CHECK-BE: iccci 5, 6                      # encoding: [0x7c,0x05,0x37,0x8c]
+# CHECK-LE: iccci 5, 6                      # encoding: [0x8c,0x37,0x05,0x7c]
+            iccci %r5,%r6
+# CHECK-BE: dccci 0, 0                      # encoding: [0x7c,0x00,0x03,0x8c]
+# CHECK-LE: dccci 0, 0                      # encoding: [0x8c,0x03,0x00,0x7c]
+            dci %r0
+# CHECK-BE: iccci 0, 0                      # encoding: [0x7c,0x00,0x07,0x8c]
+# CHECK-LE: iccci 0, 0                      # encoding: [0x8c,0x07,0x00,0x7c]
+            ici 0
 
 # CHECK-BE: mfspr 2, 990                    # encoding: [0x7c,0x5e,0xf2,0xa6]
 # CHECK-LE: mfspr 2, 990                    # encoding: [0xa6,0xf2,0x5e,0x7c]