diff options
author | Richard Sandiford <rsandifo@linux.vnet.ibm.com> | 2013-10-01 14:33:55 +0000 |
---|---|---|
committer | Richard Sandiford <rsandifo@linux.vnet.ibm.com> | 2013-10-01 14:33:55 +0000 |
commit | 00f5335ea0b62f0921d215a4d04e2fe5f33771ce (patch) | |
tree | 56a9decf33dd665bb28cb2fc2fde2cb11aff6ecd /test/CodeGen/SystemZ | |
parent | bba9390fc6c0d536172c6bb4a9c93db557c1aff4 (diff) | |
download | external_llvm-00f5335ea0b62f0921d215a4d04e2fe5f33771ce.zip external_llvm-00f5335ea0b62f0921d215a4d04e2fe5f33771ce.tar.gz external_llvm-00f5335ea0b62f0921d215a4d04e2fe5f33771ce.tar.bz2 |
[SystemZ] Extend pseudo conditional 8- and 16-bit stores to high words
As the comment says, we always want to use STOC for 32-bit stores.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191767 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGen/SystemZ')
-rw-r--r-- | test/CodeGen/SystemZ/fp-move-09.ll | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/test/CodeGen/SystemZ/fp-move-09.ll b/test/CodeGen/SystemZ/fp-move-09.ll index 8c3e9c9..52b2ee2 100644 --- a/test/CodeGen/SystemZ/fp-move-09.ll +++ b/test/CodeGen/SystemZ/fp-move-09.ll @@ -28,3 +28,35 @@ define void @f2(float %val, i8 *%ptr) { store i8 %trunc, i8 *%ptr ret void } + +; Like f2, but with a conditional store. +define void @f3(float %val, i8 *%ptr, i32 %which) { +; CHECK-LABEL: f3: +; CHECK: cijlh %r3, 0, +; CHECK: lgdr [[REG:%r[0-5]]], %f0 +; CHECK: stch [[REG]], 0(%r2) +; CHECK: br %r14 + %int = bitcast float %val to i32 + %trunc = trunc i32 %int to i8 + %old = load i8 *%ptr + %cmp = icmp eq i32 %which, 0 + %res = select i1 %cmp, i8 %trunc, i8 %old + store i8 %res, i8 *%ptr + ret void +} + +; ...and again with 16-bit memory. +define void @f4(float %val, i16 *%ptr, i32 %which) { +; CHECK-LABEL: f4: +; CHECK: cijlh %r3, 0, +; CHECK: lgdr [[REG:%r[0-5]]], %f0 +; CHECK: sthh [[REG]], 0(%r2) +; CHECK: br %r14 + %int = bitcast float %val to i32 + %trunc = trunc i32 %int to i16 + %old = load i16 *%ptr + %cmp = icmp eq i32 %which, 0 + %res = select i1 %cmp, i16 %trunc, i16 %old + store i16 %res, i16 *%ptr + ret void +} |