aboutsummaryrefslogtreecommitdiffstats
path: root/test/MC/PowerPC
diff options
context:
space:
mode:
authorUlrich Weigand <ulrich.weigand@de.ibm.com>2013-07-03 17:59:07 +0000
committerUlrich Weigand <ulrich.weigand@de.ibm.com>2013-07-03 17:59:07 +0000
commit33efedc0481c4b0d9866ff526eb1161372b5919f (patch)
treec00529c742b19693f0dd9a476197c8b0b87c5639 /test/MC/PowerPC
parent965b20e39c7fd73846e9b6ed55ba90e032ae3b1b (diff)
downloadexternal_llvm-33efedc0481c4b0d9866ff526eb1161372b5919f.zip
external_llvm-33efedc0481c4b0d9866ff526eb1161372b5919f.tar.gz
external_llvm-33efedc0481c4b0d9866ff526eb1161372b5919f.tar.bz2
[PowerPC] Use mtocrf when available
Just as with mfocrf, it is also preferable to use mtocrf instead of mtcrf when only a single CR register is to be written. Current code however always emits mtcrf. This probably does not matter when using an external assembler, since the GNU assembler will in fact automatically replace mtcrf with mtocrf when possible. It does create inefficient code with the integrated assembler, however. To fix this, this patch adds MTOCRF/MTOCRF8 instruction patterns and uses those instead of MTCRF/MTCRF8 everything. Just as done in the MFOCRF patch committed as 185556, these patterns will be converted back to MTCRF if MTOCRF is not available on the machine. As a side effect, this allows to modify the MTCRF pattern to accept the full range of mask operands for the benefit of the asm parser. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185561 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/MC/PowerPC')
-rw-r--r--test/MC/PowerPC/ppc64-encoding-ext.s2
-rw-r--r--test/MC/PowerPC/ppc64-encoding.s8
2 files changed, 6 insertions, 4 deletions
diff --git a/test/MC/PowerPC/ppc64-encoding-ext.s b/test/MC/PowerPC/ppc64-encoding-ext.s
index 79c8fdb..0bc1a39 100644
--- a/test/MC/PowerPC/ppc64-encoding-ext.s
+++ b/test/MC/PowerPC/ppc64-encoding-ext.s
@@ -1986,4 +1986,6 @@
not 2, 3
# CHECK: nor. 2, 3, 3 # encoding: [0x7c,0x62,0x18,0xf9]
not. 2, 3
+# CHECK: mtcrf 255, 2 # encoding: [0x7c,0x4f,0xf1,0x20]
+ mtcr 2
diff --git a/test/MC/PowerPC/ppc64-encoding.s b/test/MC/PowerPC/ppc64-encoding.s
index fbedf43..03d513c 100644
--- a/test/MC/PowerPC/ppc64-encoding.s
+++ b/test/MC/PowerPC/ppc64-encoding.s
@@ -508,12 +508,12 @@
mtspr 600, 2
# CHECK: mfspr 2, 600 # encoding: [0x7c,0x58,0x92,0xa6]
mfspr 2, 600
-# CHECK: mtcrf 16, 2 # encoding: [0x7c,0x41,0x01,0x20]
- mtcrf 16, 2
+# CHECK: mtcrf 123, 2 # encoding: [0x7c,0x47,0xb1,0x20]
+ mtcrf 123, 2
# CHECK: mfcr 2 # encoding: [0x7c,0x40,0x00,0x26]
mfcr 2
-# FIXME: mtocrf 16, 2
+# CHECK: mtocrf 16, 2 # encoding: [0x7c,0x51,0x01,0x20]
+ mtocrf 16, 2
# CHECK: mfocrf 16, 8 # encoding: [0x7e,0x10,0x80,0x26]
mfocrf 16, 8
-# FIXME: mcrxr 2