1 ; RUN: llc -mtriple=arm-eabi -mcpu=swift %s -o - | FileCheck %s 2 ; RUN: llc -mtriple=arm-eabi -mcpu=cortex-a8 -mattr=-neon %s -o - 3 4 define float @fmin_ole(float %x) nounwind { 5 ;CHECK-LABEL: fmin_ole: 6 ;CHECK: vmin.f32 7 %cond = fcmp ole float 1.0, %x 8 %min1 = select i1 %cond, float 1.0, float %x 9 ret float %min1 10 } 11 12 define float @fmin_ole_zero(float %x) nounwind { 13 ;CHECK-LABEL: fmin_ole_zero: 14 ;CHECK-NOT: vmin.f32 15 %cond = fcmp ole float 0.0, %x 16 %min1 = select i1 %cond, float 0.0, float %x 17 ret float %min1 18 } 19 20 define float @fmin_ult(float %x) nounwind { 21 ;CHECK-LABEL: fmin_ult: 22 ;CHECK: vmin.f32 23 %cond = fcmp ult float %x, 1.0 24 %min1 = select i1 %cond, float %x, float 1.0 25 ret float %min1 26 } 27 28 define float @fmax_ogt(float %x) nounwind { 29 ;CHECK-LABEL: fmax_ogt: 30 ;CHECK: vmax.f32 31 %cond = fcmp ogt float 1.0, %x 32 %max1 = select i1 %cond, float 1.0, float %x 33 ret float %max1 34 } 35 36 define float @fmax_uge(float %x) nounwind { 37 ;CHECK-LABEL: fmax_uge: 38 ;CHECK: vmax.f32 39 %cond = fcmp uge float %x, 1.0 40 %max1 = select i1 %cond, float %x, float 1.0 41 ret float %max1 42 } 43 44 define float @fmax_uge_zero(float %x) nounwind { 45 ;CHECK-LABEL: fmax_uge_zero: 46 ;CHECK-NOT: vmax.f32 47 %cond = fcmp uge float %x, 0.0 48 %max1 = select i1 %cond, float %x, float 0.0 49 ret float %max1 50 } 51 52 define float @fmax_olt_reverse(float %x) nounwind { 53 ;CHECK-LABEL: fmax_olt_reverse: 54 ;CHECK: vmax.f32 55 %cond = fcmp olt float %x, 1.0 56 %max1 = select i1 %cond, float 1.0, float %x 57 ret float %max1 58 } 59 60 define float @fmax_ule_reverse(float %x) nounwind { 61 ;CHECK-LABEL: fmax_ule_reverse: 62 ;CHECK: vmax.f32 63 %cond = fcmp ult float 1.0, %x 64 %max1 = select i1 %cond, float %x, float 1.0 65 ret float %max1 66 } 67 68 define float @fmin_oge_reverse(float %x) nounwind { 69 ;CHECK-LABEL: fmin_oge_reverse: 70 ;CHECK: vmin.f32 71 %cond = fcmp oge float %x, 1.0 72 %min1 = select i1 %cond, float 1.0, float %x 73 ret float %min1 74 } 75 76 define float @fmin_ugt_reverse(float %x) nounwind { 77 ;CHECK-LABEL: fmin_ugt_reverse: 78 ;CHECK: vmin.f32 79 %cond = fcmp ugt float 1.0, %x 80 %min1 = select i1 %cond, float %x, float 1.0 81 ret float %min1 82 } 83