Dan Gohman | 36a0947 | 2009-09-08 23:54:48 +0000 | [diff] [blame] | 1 | ; RUN: llc < %s -march=x86-64 | grep min | count 1 |
| 2 | ; RUN: llc < %s -march=x86-64 | grep max | count 1 |
| 3 | ; RUN: llc < %s -march=x86-64 | grep mov | count 2 |
Dan Gohman | 02e25b7 | 2007-07-10 15:34:29 +0000 | [diff] [blame] | 4 | |
| 5 | declare float @bar() |
| 6 | |
Dan Gohman | 670e539 | 2009-09-21 18:03:22 +0000 | [diff] [blame] | 7 | define float @foo(float %a) nounwind |
Dan Gohman | 02e25b7 | 2007-07-10 15:34:29 +0000 | [diff] [blame] | 8 | { |
| 9 | %s = call float @bar() |
| 10 | %t = fcmp olt float %s, %a |
| 11 | %u = select i1 %t, float %s, float %a |
| 12 | ret float %u |
| 13 | } |
Dan Gohman | 670e539 | 2009-09-21 18:03:22 +0000 | [diff] [blame] | 14 | define float @hem(float %a) nounwind |
Dan Gohman | 02e25b7 | 2007-07-10 15:34:29 +0000 | [diff] [blame] | 15 | { |
| 16 | %s = call float @bar() |
Dan Gohman | 670e539 | 2009-09-21 18:03:22 +0000 | [diff] [blame] | 17 | %t = fcmp ogt float %s, %a |
Dan Gohman | 02e25b7 | 2007-07-10 15:34:29 +0000 | [diff] [blame] | 18 | %u = select i1 %t, float %s, float %a |
| 19 | ret float %u |
| 20 | } |