summaryrefslogtreecommitdiffstats
path: root/llvm/test/CodeGen/X86/select.ll
diff options
context:
space:
mode:
authorReid Spencer <rspencer@reidspencer.com>2007-01-17 07:59:14 +0000
committerReid Spencer <rspencer@reidspencer.com>2007-01-17 07:59:14 +0000
commit83b3d8267225d585678d5d3af9bba5735f4b415d (patch)
tree9d6c2ad7bfd568186e83a39e6f03e1c0bf415715 /llvm/test/CodeGen/X86/select.ll
parent100602d7561ca5e245db6194bddae86357d203d4 (diff)
downloadbcm5719-llvm-83b3d8267225d585678d5d3af9bba5735f4b415d.tar.gz
bcm5719-llvm-83b3d8267225d585678d5d3af9bba5735f4b415d.zip
Regression is gone, don't try to find it on clean target.
llvm-svn: 33296
Diffstat (limited to 'llvm/test/CodeGen/X86/select.ll')
-rw-r--r--llvm/test/CodeGen/X86/select.ll64
1 files changed, 64 insertions, 0 deletions
diff --git a/llvm/test/CodeGen/X86/select.ll b/llvm/test/CodeGen/X86/select.ll
new file mode 100644
index 00000000000..71f4742c08b
--- /dev/null
+++ b/llvm/test/CodeGen/X86/select.ll
@@ -0,0 +1,64 @@
+; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -mcpu=yonah &&
+; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -mcpu=pentium
+
+bool %boolSel(bool %A, bool %B, bool %C) {
+ %X = select bool %A, bool %B, bool %C
+ ret bool %X
+}
+
+sbyte %byteSel(bool %A, sbyte %B, sbyte %C) {
+ %X = select bool %A, sbyte %B, sbyte %C
+ ret sbyte %X
+}
+
+short %shortSel(bool %A, short %B, short %C) {
+ %X = select bool %A, short %B, short %C
+ ret short %X
+}
+
+int %intSel(bool %A, int %B, int %C) {
+ %X = select bool %A, int %B, int %C
+ ret int %X
+}
+
+long %longSel(bool %A, long %B, long %C) {
+ %X = select bool %A, long %B, long %C
+ ret long %X
+}
+
+double %doubleSel(bool %A, double %B, double %C) {
+ %X = select bool %A, double %B, double %C
+ ret double %X
+}
+
+sbyte %foldSel(bool %A, sbyte %B, sbyte %C) {
+ %Cond = setlt sbyte %B, %C
+ %X = select bool %Cond, sbyte %B, sbyte %C
+ ret sbyte %X
+}
+
+int %foldSel2(bool %A, int %B, int %C) {
+ %Cond = seteq int %B, %C
+ %X = select bool %Cond, int %B, int %C
+ ret int %X
+}
+
+int %foldSel2(bool %A, int %B, int %C, double %X, double %Y) {
+ %Cond = setlt double %X, %Y
+ %X = select bool %Cond, int %B, int %C
+ ret int %X
+}
+
+float %foldSel3(bool %A, float %B, float %C, uint %X, uint %Y) {
+ %Cond = setlt uint %X, %Y
+ %X = select bool %Cond, float %B, float %C
+ ret float %X
+}
+
+float %nofoldSel4(bool %A, float %B, float %C, int %X, int %Y) {
+ ; X86 doesn't have a cmov that reads the right flags for this!
+ %Cond = setlt int %X, %Y
+ %X = select bool %Cond, float %B, float %C
+ ret float %X
+}
+
OpenPOWER on IntegriCloud