summaryrefslogtreecommitdiffstats
path: root/llvm/test/MC/SystemZ
diff options
context:
space:
mode:
authorZhan Jun Liau <zhanjunl@ca.ibm.com>2016-07-11 18:45:03 +0000
committerZhan Jun Liau <zhanjunl@ca.ibm.com>2016-07-11 18:45:03 +0000
commitdef708a0f9ff4331214fded128fa2d5d6459952c (patch)
tree92b4c43b783b4fbd1e1735af8bc3afd0209bc951 /llvm/test/MC/SystemZ
parent7614e178cb9c4ef66c39dc953f9804b0a6a64d4c (diff)
downloadbcm5719-llvm-def708a0f9ff4331214fded128fa2d5d6459952c.tar.gz
bcm5719-llvm-def708a0f9ff4331214fded128fa2d5d6459952c.zip
[SystemZ] Recognize Load On Condition Immediate (LOCHI/LOGHI) opportunities
Summary: Add support for the z13 instructions LOCHI and LOCGHI which conditionally load immediate values. Add target instruction info hooks so that if conversion will allow predication of LHI/LGHI. Author: RolandF Reviewers: uweigand Subscribers: zhanjunl Commiting on behalf of Roland. Differential Revision: http://reviews.llvm.org/D22117 llvm-svn: 275086
Diffstat (limited to 'llvm/test/MC/SystemZ')
-rw-r--r--llvm/test/MC/SystemZ/insn-bad-z13.s23
-rw-r--r--llvm/test/MC/SystemZ/insn-bad-zEC12.s11
-rw-r--r--llvm/test/MC/SystemZ/insn-good-z13.s68
3 files changed, 102 insertions, 0 deletions
diff --git a/llvm/test/MC/SystemZ/insn-bad-z13.s b/llvm/test/MC/SystemZ/insn-bad-z13.s
index 6468e3ae2ba..a07e1ac6cfe 100644
--- a/llvm/test/MC/SystemZ/insn-bad-z13.s
+++ b/llvm/test/MC/SystemZ/insn-bad-z13.s
@@ -1199,3 +1199,26 @@
wledb %v0, %v0, 0, 16
wledb %v0, %v0, -1, 0
wledb %v0, %v0, 16, 0
+
+#CHECK: error: invalid operand
+#CHECK: lochie %r0, 66000
+#CHECK: error: invalid operand
+#CHECK: lochie %f0, 0
+#CHECK: error: invalid operand
+#CHECK: lochie 0, %r0
+
+ lochie %r0, 66000
+ lochie %f0, 0
+ lochie 0, %r0
+
+#CHECK: error: invalid operand
+#CHECK: locghie %r0, 66000
+#CHECK: error: invalid operand
+#CHECK: locghie %f0, 0
+#CHECK: error: invalid operand
+#CHECK: locghie 0, %r0
+
+ locghie %r0, 66000
+ locghie %f0, 0
+ locghie 0, %r0
+
diff --git a/llvm/test/MC/SystemZ/insn-bad-zEC12.s b/llvm/test/MC/SystemZ/insn-bad-zEC12.s
index ee31f5707af..371dc72a167 100644
--- a/llvm/test/MC/SystemZ/insn-bad-zEC12.s
+++ b/llvm/test/MC/SystemZ/insn-bad-zEC12.s
@@ -1576,3 +1576,14 @@
#CHECK: wledb %v0, %v0, 0, 0
wledb %v0, %v0, 0, 0
+
+#CHECK: error: {{(instruction requires: load store on condition 2)?}}
+#CHECK: lochio %r11, 42
+
+ lochio %r11, 42
+
+#CHECK: error: {{(instruction requires: load store on condition 2)?}}
+#CHECK: locghio %r11, 42
+
+ locghio %r11, 42
+
diff --git a/llvm/test/MC/SystemZ/insn-good-z13.s b/llvm/test/MC/SystemZ/insn-good-z13.s
index db783295e54..411945a9b46 100644
--- a/llvm/test/MC/SystemZ/insn-good-z13.s
+++ b/llvm/test/MC/SystemZ/insn-good-z13.s
@@ -5089,3 +5089,71 @@
wledb %v0, %v31, 0, 0
wledb %v31, %v0, 0, 0
wledb %v14, %v17, 4, 10
+
+#CHECK: lochi %r11, 42, 0 # encoding: [0xec,0xb0,0x00,0x2a,0x00,0x42]
+#CHECK: lochio %r11, 42 # encoding: [0xec,0xb1,0x00,0x2a,0x00,0x42]
+#CHECK: lochih %r11, 42 # encoding: [0xec,0xb2,0x00,0x2a,0x00,0x42]
+#CHECK: lochinle %r11, 42 # encoding: [0xec,0xb3,0x00,0x2a,0x00,0x42]
+#CHECK: lochil %r11, -1 # encoding: [0xec,0xb4,0xff,0xff,0x00,0x42]
+#CHECK: lochinhe %r11, 42 # encoding: [0xec,0xb5,0x00,0x2a,0x00,0x42]
+#CHECK: lochilh %r11, -1 # encoding: [0xec,0xb6,0xff,0xff,0x00,0x42]
+#CHECK: lochine %r11, 0 # encoding: [0xec,0xb7,0x00,0x00,0x00,0x42]
+#CHECK: lochie %r11, 0 # encoding: [0xec,0xb8,0x00,0x00,0x00,0x42]
+#CHECK: lochinlh %r11, 42 # encoding: [0xec,0xb9,0x00,0x2a,0x00,0x42]
+#CHECK: lochihe %r11, 255 # encoding: [0xec,0xba,0x00,0xff,0x00,0x42]
+#CHECK: lochinl %r11, 255 # encoding: [0xec,0xbb,0x00,0xff,0x00,0x42]
+#CHECK: lochile %r11, 32767 # encoding: [0xec,0xbc,0x7f,0xff,0x00,0x42]
+#CHECK: lochinh %r11, 32767 # encoding: [0xec,0xbd,0x7f,0xff,0x00,0x42]
+#CHECK: lochino %r11, 32512 # encoding: [0xec,0xbe,0x7f,0x00,0x00,0x42]
+#CHECK: lochi %r11, 32512, 15 # encoding: [0xec,0xbf,0x7f,0x00,0x00,0x42]
+
+ lochi %r11, 42, 0
+ lochio %r11, 42
+ lochih %r11, 42
+ lochinle %r11, 42
+ lochil %r11, -1
+ lochinhe %r11, 42
+ lochilh %r11, -1
+ lochine %r11, 0
+ lochie %r11, 0
+ lochinlh %r11, 42
+ lochihe %r11, 255
+ lochinl %r11, 255
+ lochile %r11, 32767
+ lochinh %r11, 32767
+ lochino %r11, 32512
+ lochi %r11, 32512, 15
+
+#CHECK: locghi %r11, 42, 0 # encoding: [0xec,0xb0,0x00,0x2a,0x00,0x46]
+#CHECK: locghio %r11, 42 # encoding: [0xec,0xb1,0x00,0x2a,0x00,0x46]
+#CHECK: locghih %r11, 42 # encoding: [0xec,0xb2,0x00,0x2a,0x00,0x46]
+#CHECK: locghinle %r11, 42 # encoding: [0xec,0xb3,0x00,0x2a,0x00,0x46]
+#CHECK: locghil %r11, -1 # encoding: [0xec,0xb4,0xff,0xff,0x00,0x46]
+#CHECK: locghinhe %r11, 42 # encoding: [0xec,0xb5,0x00,0x2a,0x00,0x46]
+#CHECK: locghilh %r11, -1 # encoding: [0xec,0xb6,0xff,0xff,0x00,0x46]
+#CHECK: locghine %r11, 0 # encoding: [0xec,0xb7,0x00,0x00,0x00,0x46]
+#CHECK: locghie %r11, 0 # encoding: [0xec,0xb8,0x00,0x00,0x00,0x46]
+#CHECK: locghinlh %r11, 42 # encoding: [0xec,0xb9,0x00,0x2a,0x00,0x46]
+#CHECK: locghihe %r11, 255 # encoding: [0xec,0xba,0x00,0xff,0x00,0x46]
+#CHECK: locghinl %r11, 255 # encoding: [0xec,0xbb,0x00,0xff,0x00,0x46]
+#CHECK: locghile %r11, 32767 # encoding: [0xec,0xbc,0x7f,0xff,0x00,0x46]
+#CHECK: locghinh %r11, 32767 # encoding: [0xec,0xbd,0x7f,0xff,0x00,0x46]
+#CHECK: locghino %r11, 32512 # encoding: [0xec,0xbe,0x7f,0x00,0x00,0x46]
+#CHECK: locghi %r11, 32512, 15 # encoding: [0xec,0xbf,0x7f,0x00,0x00,0x46]
+
+ locghi %r11, 42, 0
+ locghio %r11, 42
+ locghih %r11, 42
+ locghinle %r11, 42
+ locghil %r11, -1
+ locghinhe %r11, 42
+ locghilh %r11, -1
+ locghine %r11, 0
+ locghie %r11, 0
+ locghinlh %r11, 42
+ locghihe %r11, 255
+ locghinl %r11, 255
+ locghile %r11, 32767
+ locghinh %r11, 32767
+ locghino %r11, 32512
+ locghi %r11, 32512, 15
OpenPOWER on IntegriCloud