64349d650e978c17af4bfa8c36797d29ad59d339
[oota-llvm.git] / test / CodeGen / ARM / neon_minmax.ll
1 ; RUN: llc < %s -march=arm -mcpu=cortex-a8 | FileCheck %s
2
3 define float @fmin_ole(float %x) nounwind {
4 ;CHECK: fmin_ole:
5 ;CHECK: vmin.f32
6   %cond = fcmp ole float 1.0, %x
7   %min1 = select i1 %cond, float 1.0, float %x
8   ret float %min1
9 }
10
11 define float @fmin_ult(float %x) nounwind {
12 ;CHECK: fmin_ult:
13 ;CHECK: vmin.f32
14   %cond = fcmp ult float %x, 1.0
15   %min1 = select i1 %cond, float %x, float 1.0
16   ret float %min1
17 }
18
19 define float @fmax_ogt(float %x) nounwind {
20 ;CHECK: fmax_ogt:
21 ;CHECK: vmax.f32
22   %cond = fcmp ogt float 1.0, %x
23   %max1 = select i1 %cond, float 1.0, float %x
24   ret float %max1
25 }
26
27 define float @fmax_uge(float %x) nounwind {
28 ;CHECK: fmax_uge:
29 ;CHECK: vmax.f32
30   %cond = fcmp uge float %x, 1.0
31   %max1 = select i1 %cond, float %x, float 1.0
32   ret float %max1
33 }
34
35 define float @fmax_olt_reverse(float %x) nounwind {
36 ;CHECK: fmax_olt_reverse:
37 ;CHECK: vmax.f32
38   %cond = fcmp olt float %x, 1.0
39   %max1 = select i1 %cond, float 1.0, float %x
40   ret float %max1
41 }
42
43 define float @fmax_ule_reverse(float %x) nounwind {
44 ;CHECK: fmax_ule_reverse:
45 ;CHECK: vmax.f32
46   %cond = fcmp ult float 1.0, %x
47   %max1 = select i1 %cond, float %x, float 1.0
48   ret float %max1
49 }
50
51 define float @fmin_oge_reverse(float %x) nounwind {
52 ;CHECK: fmin_oge_reverse:
53 ;CHECK: vmin.f32
54   %cond = fcmp oge float %x, 1.0
55   %min1 = select i1 %cond, float 1.0, float %x
56   ret float %min1
57 }
58
59 define float @fmin_ugt_reverse(float %x) nounwind {
60 ;CHECK: fmin_ugt_reverse:
61 ;CHECK: vmin.f32
62   %cond = fcmp ugt float 1.0, %x
63   %min1 = select i1 %cond, float %x, float 1.0
64   ret float %min1
65 }