R600/SI: Fix fmin_legacy / fmax_legacy matching for SI
[oota-llvm.git] / test / CodeGen / R600 / fmax_legacy.ll
1 ; RUN: llc -march=r600 -mcpu=SI < %s | FileCheck -check-prefix=SI -check-prefix=FUNC %s
2 ; RUN: llc -march=r600 -mcpu=redwood < %s | FileCheck -check-prefix=EG -check-prefix=FUNC %s
3
4 ; FUNC-LABEL: @test_fmax_legacy_uge_f32
5 ; SI: v_max_legacy_f32_e32
6 ; EG: MAX
7 define void @test_fmax_legacy_uge_f32(float addrspace(1)* %out, float %a, float %b) nounwind {
8   %cmp = fcmp uge float %a, %b
9   %val = select i1 %cmp, float %a, float %b
10   store float %val, float addrspace(1)* %out, align 4
11   ret void
12 }
13
14 ; FUNC-LABEL: @test_fmax_legacy_oge_f32
15 ; SI: v_max_legacy_f32_e32
16 ; EG: MAX
17 define void @test_fmax_legacy_oge_f32(float addrspace(1)* %out, float %a, float %b) nounwind {
18   %cmp = fcmp oge float %a, %b
19   %val = select i1 %cmp, float %a, float %b
20   store float %val, float addrspace(1)* %out, align 4
21   ret void
22 }
23
24 ; FUNC-LABEL: @test_fmax_legacy_ugt_f32
25 ; SI: v_max_legacy_f32_e32
26 ; EG: MAX
27 define void @test_fmax_legacy_ugt_f32(float addrspace(1)* %out, float %a, float %b) nounwind {
28   %cmp = fcmp ugt float %a, %b
29   %val = select i1 %cmp, float %a, float %b
30   store float %val, float addrspace(1)* %out, align 4
31   ret void
32 }
33
34 ; FUNC-LABEL: @test_fmax_legacy_ogt_f32
35 ; SI: v_max_legacy_f32_e32
36 ; EG: MAX
37 define void @test_fmax_legacy_ogt_f32(float addrspace(1)* %out, float %a, float %b) nounwind {
38   %cmp = fcmp ogt float %a, %b
39   %val = select i1 %cmp, float %a, float %b
40   store float %val, float addrspace(1)* %out, align 4
41   ret void
42 }