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 | 2896d044bd75f8f07e66b7ef7a1818d7b8d7baf1 (patch) | |
| tree | 9844e976bb11084bafb82a439078d3843a5c186c /llvm/test/CodeGen/SystemZ/fp-move-09.ll | |
| parent | d840745829ba8526def212da39024caf7e269179 (diff) | |
| download | bcm5719-llvm-2896d044bd75f8f07e66b7ef7a1818d7b8d7baf1.tar.gz bcm5719-llvm-2896d044bd75f8f07e66b7ef7a1818d7b8d7baf1.zip | |
[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.
llvm-svn: 191767
Diffstat (limited to 'llvm/test/CodeGen/SystemZ/fp-move-09.ll')
| -rw-r--r-- | llvm/test/CodeGen/SystemZ/fp-move-09.ll | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/llvm/test/CodeGen/SystemZ/fp-move-09.ll b/llvm/test/CodeGen/SystemZ/fp-move-09.ll index 8c3e9c9c863..52b2ee2e31a 100644 --- a/llvm/test/CodeGen/SystemZ/fp-move-09.ll +++ b/llvm/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 +} |

