diff options
author | Richard Sandiford <rsandifo@linux.vnet.ibm.com> | 2013-10-01 14:36:20 +0000 |
---|---|---|
committer | Richard Sandiford <rsandifo@linux.vnet.ibm.com> | 2013-10-01 14:36:20 +0000 |
commit | f985f01574956da0d42e33d440deb63bf153d354 (patch) | |
tree | f3cc5929248fc53d930d39969c549079f96f8abc /test/CodeGen/SystemZ | |
parent | 00f5335ea0b62f0921d215a4d04e2fe5f33771ce (diff) | |
download | external_llvm-f985f01574956da0d42e33d440deb63bf153d354.zip external_llvm-f985f01574956da0d42e33d440deb63bf153d354.tar.gz external_llvm-f985f01574956da0d42e33d440deb63bf153d354.tar.bz2 |
[SystemZ] Extend 32-bit RISBG optimizations to high words
This involves using RISB[LH]G, whereas the equivalent z10 optimization
uses RISBG.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191770 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGen/SystemZ')
-rw-r--r-- | test/CodeGen/SystemZ/asm-18.ll | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/test/CodeGen/SystemZ/asm-18.ll b/test/CodeGen/SystemZ/asm-18.ll index 0ecca7f..b393b6e 100644 --- a/test/CodeGen/SystemZ/asm-18.ll +++ b/test/CodeGen/SystemZ/asm-18.ll @@ -500,3 +500,28 @@ define i32 @f23(i32 %old) { "=r,h,h,0"(i32 %res1, i32 %and3, i32 %and4) ret i32 %res2 } + +; Test RISB[LH]G insertions involving mixtures of high and low registers. +define i32 @f24(i32 %old) { +; CHECK-LABEL: f24: +; CHECK-DAG: risblg [[REG1:%r[0-5]]], %r2, 28, 158, 1 +; CHECK-DAG: risbhg [[REG2:%r[0-5]]], %r2, 24, 158, 29 +; CHECK: stepa %r2, [[REG1]], [[REG2]] +; CHECK-DAG: risbhg [[REG3:%r[0-5]]], [[REG2]], 25, 159, 62 +; CHECK-DAG: risblg %r2, [[REG2]], 24, 152, 37 +; CHECK: stepb [[REG2]], [[REG3]], %r2 +; CHECK: br %r14 + %shift1 = shl i32 %old, 1 + %and1 = and i32 %shift1, 14 + %shift2 = lshr i32 %old, 3 + %and2 = and i32 %shift2, 254 + %res1 = call i32 asm "stepa $1, $2, $3", + "=h,r,r,0"(i32 %old, i32 %and1, i32 %and2) + %shift3 = lshr i32 %res1, 2 + %and3 = and i32 %shift3, 127 + %shift4 = shl i32 %res1, 5 + %and4 = and i32 %shift4, 128 + %res2 = call i32 asm "stepb $1, $2, $3", + "=r,h,h,0"(i32 %res1, i32 %and3, i32 %and4) + ret i32 %res2 +} |