summaryrefslogtreecommitdiffstats
path: root/llvm/test/CodeGen/SPARC
diff options
context:
space:
mode:
authorJakob Stoklund Olesen <stoklund@2pi.dk>2013-04-04 03:08:00 +0000
committerJakob Stoklund Olesen <stoklund@2pi.dk>2013-04-04 03:08:00 +0000
commit8cfaffaaded057aa2ff7be9443797f2c9f47224a (patch)
tree7d5e0cbd3c4872d1d60b0e2da6c428d0c5ff1795 /llvm/test/CodeGen/SPARC
parent584f7dcc0e5b273d84e173794a4f6e208f2ed11c (diff)
downloadbcm5719-llvm-8cfaffaaded057aa2ff7be9443797f2c9f47224a.tar.gz
bcm5719-llvm-8cfaffaaded057aa2ff7be9443797f2c9f47224a.zip
Add SPARC v9 support for select on 64-bit compares.
This requires v9 cmov instructions using the %xcc flags instead of the %icc flags. Still missing: - Select floats on %xcc flags. - Select i64 on %fcc flags. llvm-svn: 178737
Diffstat (limited to 'llvm/test/CodeGen/SPARC')
-rw-r--r--llvm/test/CodeGen/SPARC/64cond.ll22
1 files changed, 22 insertions, 0 deletions
diff --git a/llvm/test/CodeGen/SPARC/64cond.ll b/llvm/test/CodeGen/SPARC/64cond.ll
index 694909f9e72..6e66a262a4f 100644
--- a/llvm/test/CodeGen/SPARC/64cond.ll
+++ b/llvm/test/CodeGen/SPARC/64cond.ll
@@ -32,3 +32,25 @@ if.then:
if.end:
ret void
}
+
+; CHECK: selecti32_xcc
+; CHECK: subcc %i0, %i1
+; CHECK: movg %xcc, %i2, %i3
+; CHECK: or %g0, %i3, %i0
+define i32 @selecti32_xcc(i64 %x, i64 %y, i32 %a, i32 %b) {
+entry:
+ %tobool = icmp sgt i64 %x, %y
+ %rv = select i1 %tobool, i32 %a, i32 %b
+ ret i32 %rv
+}
+
+; CHECK: selecti64_xcc
+; CHECK: subcc %i0, %i1
+; CHECK: movg %xcc, %i2, %i3
+; CHECK: or %g0, %i3, %i0
+define i64 @selecti64_xcc(i64 %x, i64 %y, i64 %a, i64 %b) {
+entry:
+ %tobool = icmp sgt i64 %x, %y
+ %rv = select i1 %tobool, i64 %a, i64 %b
+ ret i64 %rv
+}
OpenPOWER on IntegriCloud