summaryrefslogtreecommitdiff
path: root/test/CodeGen/SystemZ/fp-move-09.ll
diff options
context:
space:
mode:
authorRichard Sandiford <rsandifo@linux.vnet.ibm.com>2013-10-01 14:31:50 +0000
committerRichard Sandiford <rsandifo@linux.vnet.ibm.com>2013-10-01 14:31:50 +0000
commit6d2158acae7ec731500a36fbb4ae79483ee10969 (patch)
treed0630e877a227fc7aba292ad1d98394d2c9a69cb /test/CodeGen/SystemZ/fp-move-09.ll
parent5fb8d3144fa5da2b8392b56136163809d8df0527 (diff)
downloadllvm-6d2158acae7ec731500a36fbb4ae79483ee10969.tar.gz
llvm-6d2158acae7ec731500a36fbb4ae79483ee10969.tar.bz2
llvm-6d2158acae7ec731500a36fbb4ae79483ee10969.tar.xz
[SystemZ] Add test missing from r191764.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191765 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGen/SystemZ/fp-move-09.ll')
-rw-r--r--test/CodeGen/SystemZ/fp-move-09.ll30
1 files changed, 30 insertions, 0 deletions
diff --git a/test/CodeGen/SystemZ/fp-move-09.ll b/test/CodeGen/SystemZ/fp-move-09.ll
new file mode 100644
index 0000000000..8c3e9c9c86
--- /dev/null
+++ b/test/CodeGen/SystemZ/fp-move-09.ll
@@ -0,0 +1,30 @@
+; Test moves between FPRs and GPRs for z196 and above.
+;
+; RUN: llc < %s -mtriple=s390x-linux-gnu -mcpu=z196 | FileCheck %s
+
+; Check that moves from i32s to floats can use high registers.
+define float @f1(i16 *%ptr) {
+; CHECK-LABEL: f1:
+; CHECK: llhh [[REG:%r[0-5]]], 0(%r2)
+; CHECK: oihh [[REG]], 16256
+; CHECK: ldgr %f0, [[REG]]
+; CHECK: br %r14
+ %base = load i16 *%ptr
+ %ext = zext i16 %base to i32
+ %full = or i32 %ext, 1065353216
+ %res = bitcast i32 %full to float
+ ret float %res
+}
+
+; Check that moves from floats to i32s can use high registers.
+; This "store the low byte" technique is used by llvmpipe, for example.
+define void @f2(float %val, i8 *%ptr) {
+; CHECK-LABEL: f2:
+; CHECK: lgdr [[REG:%r[0-5]]], %f0
+; CHECK: stch [[REG]], 0(%r2)
+; CHECK: br %r14
+ %res = bitcast float %val to i32
+ %trunc = trunc i32 %res to i8
+ store i8 %trunc, i8 *%ptr
+ ret void
+}