Sirish Pande | 7517bbc | 2012-05-10 20:20:25 +0000 | [diff] [blame] | 1 | ; RUN: llc -march=hexagon -mcpu=hexagonv5 < %s | FileCheck %s |
| 2 | ; Check that we generate floating point compare in V5 |
| 3 | |
| 4 | ; CHECK: p{{[0-2]+}} = sfcmp.{{.}} |
| 5 | |
| 6 | define i32 @foo(float %y) nounwind { |
| 7 | entry: |
| 8 | %retval = alloca i32, align 4 |
| 9 | %y.addr = alloca float, align 4 |
| 10 | store float %y, float* %y.addr, align 4 |
| 11 | %0 = load float* %y.addr, align 4 |
| 12 | %cmp = fcmp ogt float %0, 0x406AD7EFA0000000 |
| 13 | br i1 %cmp, label %if.then, label %if.else |
| 14 | |
| 15 | if.then: ; preds = %entry |
| 16 | store i32 1, i32* %retval |
| 17 | br label %return |
| 18 | |
| 19 | if.else: ; preds = %entry |
| 20 | store i32 2, i32* %retval |
| 21 | br label %return |
| 22 | |
| 23 | return: ; preds = %if.else, %if.then |
| 24 | %1 = load i32* %retval |
| 25 | ret i32 %1 |
| 26 | } |
| 27 | |
| 28 | define i32 @main() nounwind { |
| 29 | entry: |
| 30 | %retval = alloca i32, align 4 |
| 31 | %a = alloca float, align 4 |
| 32 | store i32 0, i32* %retval |
| 33 | store float 0x40012E0A00000000, float* %a, align 4 |
| 34 | %0 = load float* %a, align 4 |
| 35 | %call = call i32 @foo(float %0) |
| 36 | ret i32 %call |
| 37 | } |