blob: 5cf3c57b5e9cc4349913e85ccb1ee2087ad1c0af [file] [log] [blame]
Sirish Pande69295b82012-05-10 20:20:25 +00001; 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
6define i32 @foo(float %y) nounwind {
7entry:
8 %retval = alloca i32, align 4
9 %y.addr = alloca float, align 4
10 store float %y, float* %y.addr, align 4
David Blaikiea79ac142015-02-27 21:17:42 +000011 %0 = load float, float* %y.addr, align 4
Sirish Pande69295b82012-05-10 20:20:25 +000012 %cmp = fcmp ogt float %0, 0x406AD7EFA0000000
13 br i1 %cmp, label %if.then, label %if.else
14
15if.then: ; preds = %entry
16 store i32 1, i32* %retval
17 br label %return
18
19if.else: ; preds = %entry
20 store i32 2, i32* %retval
21 br label %return
22
23return: ; preds = %if.else, %if.then
David Blaikiea79ac142015-02-27 21:17:42 +000024 %1 = load i32, i32* %retval
Sirish Pande69295b82012-05-10 20:20:25 +000025 ret i32 %1
26}
27
28define i32 @main() nounwind {
29entry:
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
David Blaikiea79ac142015-02-27 21:17:42 +000034 %0 = load float, float* %a, align 4
Sirish Pande69295b82012-05-10 20:20:25 +000035 %call = call i32 @foo(float %0)
36 ret i32 %call
37}