[llvm] r214295 - SPRG 0 to 3 are valid outside BookE, so move them to the normal test
Joerg Sonnenberger
joerg at bec.de
Wed Jul 30 02:24:37 PDT 2014
Author: joerg
Date: Wed Jul 30 04:24:37 2014
New Revision: 214295
URL: http://llvm.org/viewvc/llvm-project?rev=214295&view=rev
Log:
SPRG 0 to 3 are valid outside BookE, so move them to the normal test
file. Add support for accessing SPRG 4 to 7 on BookE.
Modified:
llvm/trunk/lib/Target/PowerPC/AsmParser/PPCAsmParser.cpp
llvm/trunk/lib/Target/PowerPC/PPCInstrInfo.td
llvm/trunk/test/MC/PowerPC/ppc64-encoding-bookIII.s
llvm/trunk/test/MC/PowerPC/ppc64-encoding-ext.s
Modified: llvm/trunk/lib/Target/PowerPC/AsmParser/PPCAsmParser.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PowerPC/AsmParser/PPCAsmParser.cpp?rev=214295&r1=214294&r2=214295&view=diff
==============================================================================
--- llvm/trunk/lib/Target/PowerPC/AsmParser/PPCAsmParser.cpp (original)
+++ llvm/trunk/lib/Target/PowerPC/AsmParser/PPCAsmParser.cpp Wed Jul 30 04:24:37 2014
@@ -1624,6 +1624,10 @@ unsigned PPCAsmParser::validateTargetOpe
case MCK_1: ImmVal = 1; break;
case MCK_2: ImmVal = 2; break;
case MCK_3: ImmVal = 3; break;
+ case MCK_4: ImmVal = 4; break;
+ case MCK_5: ImmVal = 5; break;
+ case MCK_6: ImmVal = 6; break;
+ case MCK_7: ImmVal = 7; break;
default: return Match_InvalidOperand;
}
Modified: llvm/trunk/lib/Target/PowerPC/PPCInstrInfo.td
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PowerPC/PPCInstrInfo.td?rev=214295&r1=214294&r2=214295&view=diff
==============================================================================
--- llvm/trunk/lib/Target/PowerPC/PPCInstrInfo.td (original)
+++ llvm/trunk/lib/Target/PowerPC/PPCInstrInfo.td Wed Jul 30 04:24:37 2014
@@ -3199,21 +3199,37 @@ def : InstAlias<"mfsprg $RT, 0", (MFSPR
def : InstAlias<"mfsprg $RT, 1", (MFSPR gprc:$RT, 273)>;
def : InstAlias<"mfsprg $RT, 2", (MFSPR gprc:$RT, 274)>;
def : InstAlias<"mfsprg $RT, 3", (MFSPR gprc:$RT, 275)>;
+def : InstAlias<"mfsprg $RT, 4", (MFSPR gprc:$RT, 260)>, Requires<[IsBookE]>;
+def : InstAlias<"mfsprg $RT, 5", (MFSPR gprc:$RT, 261)>, Requires<[IsBookE]>;
+def : InstAlias<"mfsprg $RT, 6", (MFSPR gprc:$RT, 262)>, Requires<[IsBookE]>;
+def : InstAlias<"mfsprg $RT, 7", (MFSPR gprc:$RT, 263)>, Requires<[IsBookE]>;
def : InstAlias<"mfsprg0 $RT", (MFSPR gprc:$RT, 272)>;
def : InstAlias<"mfsprg1 $RT", (MFSPR gprc:$RT, 273)>;
def : InstAlias<"mfsprg2 $RT", (MFSPR gprc:$RT, 274)>;
def : InstAlias<"mfsprg3 $RT", (MFSPR gprc:$RT, 275)>;
+def : InstAlias<"mfsprg4 $RT", (MFSPR gprc:$RT, 260)>, Requires<[IsBookE]>;
+def : InstAlias<"mfsprg5 $RT", (MFSPR gprc:$RT, 261)>, Requires<[IsBookE]>;
+def : InstAlias<"mfsprg6 $RT", (MFSPR gprc:$RT, 262)>, Requires<[IsBookE]>;
+def : InstAlias<"mfsprg7 $RT", (MFSPR gprc:$RT, 263)>, Requires<[IsBookE]>;
def : InstAlias<"mtsprg 0, $RT", (MTSPR 272, gprc:$RT)>;
def : InstAlias<"mtsprg 1, $RT", (MTSPR 273, gprc:$RT)>;
def : InstAlias<"mtsprg 2, $RT", (MTSPR 274, gprc:$RT)>;
def : InstAlias<"mtsprg 3, $RT", (MTSPR 275, gprc:$RT)>;
+def : InstAlias<"mtsprg 4, $RT", (MTSPR 260, gprc:$RT)>, Requires<[IsBookE]>;
+def : InstAlias<"mtsprg 5, $RT", (MTSPR 261, gprc:$RT)>, Requires<[IsBookE]>;
+def : InstAlias<"mtsprg 6, $RT", (MTSPR 262, gprc:$RT)>, Requires<[IsBookE]>;
+def : InstAlias<"mtsprg 7, $RT", (MTSPR 263, gprc:$RT)>, Requires<[IsBookE]>;
def : InstAlias<"mtsprg0 $RT", (MTSPR 272, gprc:$RT)>;
def : InstAlias<"mtsprg1 $RT", (MTSPR 273, gprc:$RT)>;
def : InstAlias<"mtsprg2 $RT", (MTSPR 274, gprc:$RT)>;
def : InstAlias<"mtsprg3 $RT", (MTSPR 275, gprc:$RT)>;
+def : InstAlias<"mtsprg4 $RT", (MTSPR 260, gprc:$RT)>, Requires<[IsBookE]>;
+def : InstAlias<"mtsprg5 $RT", (MTSPR 261, gprc:$RT)>, Requires<[IsBookE]>;
+def : InstAlias<"mtsprg6 $RT", (MTSPR 262, gprc:$RT)>, Requires<[IsBookE]>;
+def : InstAlias<"mtsprg7 $RT", (MTSPR 263, gprc:$RT)>, Requires<[IsBookE]>;
def : InstAlias<"mtasr $RS", (MTSPR 280, gprc:$RS)>;
Modified: llvm/trunk/test/MC/PowerPC/ppc64-encoding-bookIII.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/PowerPC/ppc64-encoding-bookIII.s?rev=214295&r1=214294&r2=214295&view=diff
==============================================================================
--- llvm/trunk/test/MC/PowerPC/ppc64-encoding-bookIII.s (original)
+++ llvm/trunk/test/MC/PowerPC/ppc64-encoding-bookIII.s Wed Jul 30 04:24:37 2014
@@ -21,53 +21,66 @@
# CHECK-LE: mtmsrd 4, 1 # encoding: [0x64,0x01,0x81,0x7c]
mtmsrd %r4, 1
-# CHECK-BE: mfspr 4, 272 # encoding: [0x7c,0x90,0x42,0xa6]
-# CHECK-LE: mfspr 4, 272 # encoding: [0xa6,0x42,0x90,0x7c]
- mfsprg %r4, 0
-
-# CHECK-BE: mfspr 4, 273 # encoding: [0x7c,0x91,0x42,0xa6]
-# CHECK-LE: mfspr 4, 273 # encoding: [0xa6,0x42,0x91,0x7c]
- mfsprg %r4, 1
-
-# CHECK-BE: mfspr 4, 274 # encoding: [0x7c,0x92,0x42,0xa6]
-# CHECK-LE: mfspr 4, 274 # encoding: [0xa6,0x42,0x92,0x7c]
- mfsprg %r4, 2
-
-# CHECK-BE: mfspr 4, 275 # encoding: [0x7c,0x93,0x42,0xa6]
-# CHECK-LE: mfspr 4, 275 # encoding: [0xa6,0x42,0x93,0x7c]
- mfsprg %r4, 3
-
-# CHECK-BE: mtspr 272, 4 # encoding: [0x7c,0x90,0x43,0xa6]
-# CHECK-LE: mtspr 272, 4 # encoding: [0xa6,0x43,0x90,0x7c]
- mtsprg 0, %r4
-
-# CHECK-BE: mtspr 273, 4 # encoding: [0x7c,0x91,0x43,0xa6]
-# CHECK-LE: mtspr 273, 4 # encoding: [0xa6,0x43,0x91,0x7c]
- mtsprg 1, %r4
-
-# CHECK-BE: mtspr 274, 4 # encoding: [0x7c,0x92,0x43,0xa6]
-# CHECK-LE: mtspr 274, 4 # encoding: [0xa6,0x43,0x92,0x7c]
- mtsprg 2, %r4
-
-# CHECK-BE: mtspr 275, 4 # encoding: [0x7c,0x93,0x43,0xa6]
-# CHECK-LE: mtspr 275, 4 # encoding: [0xa6,0x43,0x93,0x7c]
- mtsprg 3, %r4
-
-# CHECK-BE: mtspr 272, 4 # encoding: [0x7c,0x90,0x43,0xa6]
-# CHECK-LE: mtspr 272, 4 # encoding: [0xa6,0x43,0x90,0x7c]
- mtsprg0 %r4
-
-# CHECK-BE: mtspr 273, 4 # encoding: [0x7c,0x91,0x43,0xa6]
-# CHECK-LE: mtspr 273, 4 # encoding: [0xa6,0x43,0x91,0x7c]
- mtsprg1 %r4
-
-# CHECK-BE: mtspr 274, 4 # encoding: [0x7c,0x92,0x43,0xa6]
-# CHECK-LE: mtspr 274, 4 # encoding: [0xa6,0x43,0x92,0x7c]
- mtsprg2 %r4
-
-# CHECK-BE: mtspr 275, 4 # encoding: [0x7c,0x93,0x43,0xa6]
-# CHECK-LE: mtspr 275, 4 # encoding: [0xa6,0x43,0x93,0x7c]
- mtsprg3 %r4
+# CHECK-BE: mfspr 4, 260 # encoding: [0x7c,0x84,0x42,0xa6]
+# CHECK-LE: mfspr 4, 260 # encoding: [0xa6,0x42,0x84,0x7c]
+ mfsprg %r4, 4
+
+# CHECK-BE: mfspr 4, 261 # encoding: [0x7c,0x85,0x42,0xa6]
+# CHECK-LE: mfspr 4, 261 # encoding: [0xa6,0x42,0x85,0x7c]
+ mfsprg %r4, 5
+
+# CHECK-BE: mfspr 4, 262 # encoding: [0x7c,0x86,0x42,0xa6]
+# CHECK-LE: mfspr 4, 262 # encoding: [0xa6,0x42,0x86,0x7c]
+ mfsprg %r4, 6
+
+# CHECK-BE: mfspr 4, 263 # encoding: [0x7c,0x87,0x42,0xa6]
+# CHECK-LE: mfspr 4, 263 # encoding: [0xa6,0x42,0x87,0x7c]
+ mfsprg %r4, 7
+
+# CHECK-BE: mfspr 2, 260 # encoding: [0x7c,0x44,0x42,0xa6]
+# CHECK-LE: mfspr 2, 260 # encoding: [0xa6,0x42,0x44,0x7c]
+ mfsprg4 %r2
+# CHECK-BE: mfspr 2, 261 # encoding: [0x7c,0x45,0x42,0xa6]
+# CHECK-LE: mfspr 2, 261 # encoding: [0xa6,0x42,0x45,0x7c]
+ mfsprg5 %r2
+# CHECK-BE: mfspr 2, 262 # encoding: [0x7c,0x46,0x42,0xa6]
+# CHECK-LE: mfspr 2, 262 # encoding: [0xa6,0x42,0x46,0x7c]
+ mfsprg6 %r2
+# CHECK-BE: mfspr 2, 263 # encoding: [0x7c,0x47,0x42,0xa6]
+# CHECK-LE: mfspr 2, 263 # encoding: [0xa6,0x42,0x47,0x7c]
+ mfsprg7 %r2
+
+# NOT-CHECK-BE: mtspr 260, 4 # encoding: [0x7c,0x90,0x43,0xa6]
+# NOT-CHECK-LE: mtspr 260, 4 # encoding: [0xa6,0x43,0x90,0x7c]
+ mtsprg 4, %r4
+
+# NOT-CHECK-BE: mtspr 261, 4 # encoding: [0x7c,0x91,0x43,0xa6]
+# NOT-CHECK-LE: mtspr 261, 4 # encoding: [0xa6,0x43,0x91,0x7c]
+ mtsprg 5, %r4
+
+# NOT-CHECK-BE: mtspr 262, 4 # encoding: [0x7c,0x92,0x43,0xa6]
+# NOT-CHECK-LE: mtspr 262, 4 # encoding: [0xa6,0x43,0x92,0x7c]
+ mtsprg 6, %r4
+
+# NOT-CHECK-BE: mtspr 263, 4 # encoding: [0x7c,0x93,0x43,0xa6]
+# NOT-CHECK-LE: mtspr 263, 4 # encoding: [0xa6,0x43,0x93,0x7c]
+ mtsprg 7, %r4
+
+# CHECK-BE: mtspr 260, 4 # encoding: [0x7c,0x84,0x43,0xa6]
+# CHECK-LE: mtspr 260, 4 # encoding: [0xa6,0x43,0x84,0x7c]
+ mtsprg4 %r4
+
+# CHECK-BE: mtspr 261, 4 # encoding: [0x7c,0x85,0x43,0xa6]
+# CHECK-LE: mtspr 261, 4 # encoding: [0xa6,0x43,0x85,0x7c]
+ mtsprg5 %r4
+
+# CHECK-BE: mtspr 262, 4 # encoding: [0x7c,0x86,0x43,0xa6]
+# CHECK-LE: mtspr 262, 4 # encoding: [0xa6,0x43,0x86,0x7c]
+ mtsprg6 %r4
+
+# CHECK-BE: mtspr 263, 4 # encoding: [0x7c,0x87,0x43,0xa6]
+# CHECK-LE: mtspr 263, 4 # encoding: [0xa6,0x43,0x87,0x7c]
+ mtsprg7 %r4
# CHECK-BE: mtspr 280, 4 # encoding: [0x7c,0x98,0x43,0xa6]
# CHECK-LE: mtspr 280, 4 # encoding: [0xa6,0x43,0x98,0x7c]
Modified: llvm/trunk/test/MC/PowerPC/ppc64-encoding-ext.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/PowerPC/ppc64-encoding-ext.s?rev=214295&r1=214294&r2=214295&view=diff
==============================================================================
--- llvm/trunk/test/MC/PowerPC/ppc64-encoding-ext.s (original)
+++ llvm/trunk/test/MC/PowerPC/ppc64-encoding-ext.s Wed Jul 30 04:24:37 2014
@@ -3519,3 +3519,63 @@
# CHECK-LE: mtcrf 255, 2 # encoding: [0x20,0xf1,0x4f,0x7c]
mtcr 2
+# CHECK-BE: mfspr 4, 272 # encoding: [0x7c,0x90,0x42,0xa6]
+# CHECK-LE: mfspr 4, 272 # encoding: [0xa6,0x42,0x90,0x7c]
+ mfsprg %r4, 0
+
+# CHECK-BE: mfspr 4, 273 # encoding: [0x7c,0x91,0x42,0xa6]
+# CHECK-LE: mfspr 4, 273 # encoding: [0xa6,0x42,0x91,0x7c]
+ mfsprg %r4, 1
+
+# CHECK-BE: mfspr 4, 274 # encoding: [0x7c,0x92,0x42,0xa6]
+# CHECK-LE: mfspr 4, 274 # encoding: [0xa6,0x42,0x92,0x7c]
+ mfsprg %r4, 2
+
+# CHECK-BE: mfspr 4, 275 # encoding: [0x7c,0x93,0x42,0xa6]
+# CHECK-LE: mfspr 4, 275 # encoding: [0xa6,0x42,0x93,0x7c]
+ mfsprg %r4, 3
+
+# CHECK-BE: mfspr 2, 272 # encoding: [0x7c,0x50,0x42,0xa6]
+# CHECK-LE: mfspr 2, 272 # encoding: [0xa6,0x42,0x50,0x7c]
+ mfsprg0 %r2
+# CHECK-BE: mfspr 2, 273 # encoding: [0x7c,0x51,0x42,0xa6]
+# CHECK-LE: mfspr 2, 273 # encoding: [0xa6,0x42,0x51,0x7c]
+ mfsprg1 %r2
+# CHECK-BE: mfspr 2, 274 # encoding: [0x7c,0x52,0x42,0xa6]
+# CHECK-LE: mfspr 2, 274 # encoding: [0xa6,0x42,0x52,0x7c]
+ mfsprg2 %r2
+# CHECK-BE: mfspr 2, 275 # encoding: [0x7c,0x53,0x42,0xa6]
+# CHECK-LE: mfspr 2, 275 # encoding: [0xa6,0x42,0x53,0x7c]
+ mfsprg3 %r2
+
+# CHECK-BE: mtspr 272, 4 # encoding: [0x7c,0x90,0x43,0xa6]
+# CHECK-LE: mtspr 272, 4 # encoding: [0xa6,0x43,0x90,0x7c]
+ mtsprg 0, %r4
+
+# CHECK-BE: mtspr 273, 4 # encoding: [0x7c,0x91,0x43,0xa6]
+# CHECK-LE: mtspr 273, 4 # encoding: [0xa6,0x43,0x91,0x7c]
+ mtsprg 1, %r4
+
+# CHECK-BE: mtspr 274, 4 # encoding: [0x7c,0x92,0x43,0xa6]
+# CHECK-LE: mtspr 274, 4 # encoding: [0xa6,0x43,0x92,0x7c]
+ mtsprg 2, %r4
+
+# CHECK-BE: mtspr 275, 4 # encoding: [0x7c,0x93,0x43,0xa6]
+# CHECK-LE: mtspr 275, 4 # encoding: [0xa6,0x43,0x93,0x7c]
+ mtsprg 3, %r4
+
+# CHECK-BE: mtspr 272, 4 # encoding: [0x7c,0x90,0x43,0xa6]
+# CHECK-LE: mtspr 272, 4 # encoding: [0xa6,0x43,0x90,0x7c]
+ mtsprg0 %r4
+
+# CHECK-BE: mtspr 273, 4 # encoding: [0x7c,0x91,0x43,0xa6]
+# CHECK-LE: mtspr 273, 4 # encoding: [0xa6,0x43,0x91,0x7c]
+ mtsprg1 %r4
+
+# CHECK-BE: mtspr 274, 4 # encoding: [0x7c,0x92,0x43,0xa6]
+# CHECK-LE: mtspr 274, 4 # encoding: [0xa6,0x43,0x92,0x7c]
+ mtsprg2 %r4
+
+# CHECK-BE: mtspr 275, 4 # encoding: [0x7c,0x93,0x43,0xa6]
+# CHECK-LE: mtspr 275, 4 # encoding: [0xa6,0x43,0x93,0x7c]
+ mtsprg3 %r4
More information about the llvm-commits
mailing list