aboutsummaryrefslogtreecommitdiff
path: root/test/CodeGen/Hexagon/maxuw.ll
diff options
context:
space:
mode:
Diffstat (limited to 'test/CodeGen/Hexagon/maxuw.ll')
-rw-r--r--test/CodeGen/Hexagon/maxuw.ll9
1 files changed, 9 insertions, 0 deletions
diff --git a/test/CodeGen/Hexagon/maxuw.ll b/test/CodeGen/Hexagon/maxuw.ll
new file mode 100644
index 000000000000..0dba1f5acdef
--- /dev/null
+++ b/test/CodeGen/Hexagon/maxuw.ll
@@ -0,0 +1,9 @@
+; RUN: llc -march=hexagon < %s | FileCheck %s
+; CHECK: maxu
+
+define i32 @f(i32 %src, i32 %maxval) nounwind readnone {
+entry:
+ %cmp = icmp ult i32 %maxval, %src
+ %cond = select i1 %cmp, i32 %src, i32 %maxval
+ ret i32 %cond
+}