2015-08-14 01:28:16 +08:00
|
|
|
; RUN: llc < %s -mtriple armv8 -mattr=+neon,+fp-armv8 -enable-unsafe-fp-math -enable-no-nans-fp-math | FileCheck %s
|
2013-07-17 22:03:49 +08:00
|
|
|
|
2015-04-09 01:18:28 +08:00
|
|
|
; scalars
|
|
|
|
|
2013-09-13 21:46:57 +08:00
|
|
|
define float @fp-armv8_vminnm_o(float %a, float %b) {
|
2014-10-27 17:23:02 +08:00
|
|
|
; CHECK-LABEL: "fp-armv8_vminnm_o":
|
2015-08-14 01:28:16 +08:00
|
|
|
; CHECK-NOT: vcmp
|
|
|
|
; CHECK: vminnm.f32
|
|
|
|
%cmp = fcmp fast olt float %a, %b
|
2013-08-23 20:01:13 +08:00
|
|
|
%cond = select i1 %cmp, float %a, float %b
|
|
|
|
ret float %cond
|
|
|
|
}
|
|
|
|
|
2015-04-09 01:18:28 +08:00
|
|
|
define double @fp-armv8_vminnm_ole(double %a, double %b) {
|
|
|
|
; CHECK-LABEL: "fp-armv8_vminnm_ole":
|
2015-08-14 01:28:16 +08:00
|
|
|
; CHECK-NOT: vcmp
|
|
|
|
; CHECK: vminnm.f64
|
|
|
|
%cmp = fcmp fast ole double %a, %b
|
2015-04-09 01:18:28 +08:00
|
|
|
%cond = select i1 %cmp, double %a, double %b
|
|
|
|
ret double %cond
|
|
|
|
}
|
|
|
|
|
2014-10-27 17:23:02 +08:00
|
|
|
define float @fp-armv8_vminnm_o_rev(float %a, float %b) {
|
|
|
|
; CHECK-LABEL: "fp-armv8_vminnm_o_rev":
|
2015-08-14 01:28:16 +08:00
|
|
|
; CHECK-NOT: vcmp
|
|
|
|
; CHECK: vminnm.f32
|
|
|
|
%cmp = fcmp fast ogt float %a, %b
|
2014-10-27 17:23:02 +08:00
|
|
|
%cond = select i1 %cmp, float %b, float %a
|
|
|
|
ret float %cond
|
|
|
|
}
|
|
|
|
|
2015-04-09 01:18:28 +08:00
|
|
|
define double @fp-armv8_vminnm_oge_rev(double %a, double %b) {
|
|
|
|
; CHECK-LABEL: "fp-armv8_vminnm_oge_rev":
|
2015-08-14 01:28:16 +08:00
|
|
|
; CHECK-NOT: vcmp
|
|
|
|
; CHECK: vminnm.f64
|
|
|
|
%cmp = fcmp fast oge double %a, %b
|
2015-04-09 01:18:28 +08:00
|
|
|
%cond = select i1 %cmp, double %b, double %a
|
|
|
|
ret double %cond
|
|
|
|
}
|
|
|
|
|
2013-09-13 21:46:57 +08:00
|
|
|
define float @fp-armv8_vminnm_u(float %a, float %b) {
|
2014-10-27 17:23:02 +08:00
|
|
|
; CHECK-LABEL: "fp-armv8_vminnm_u":
|
2015-08-14 01:28:16 +08:00
|
|
|
; CHECK-NOT: vcmp
|
|
|
|
; CHECK: vminnm.f32
|
|
|
|
%cmp = fcmp fast ult float %a, %b
|
2013-08-23 20:01:13 +08:00
|
|
|
%cond = select i1 %cmp, float %a, float %b
|
|
|
|
ret float %cond
|
|
|
|
}
|
|
|
|
|
2015-04-09 01:18:28 +08:00
|
|
|
define float @fp-armv8_vminnm_ule(float %a, float %b) {
|
|
|
|
; CHECK-LABEL: "fp-armv8_vminnm_ule":
|
2015-08-14 01:28:16 +08:00
|
|
|
; CHECK-NOT: vcmp
|
|
|
|
; CHECK: vminnm.f32
|
|
|
|
%cmp = fcmp fast ule float %a, %b
|
2015-04-09 01:18:28 +08:00
|
|
|
%cond = select i1 %cmp, float %a, float %b
|
|
|
|
ret float %cond
|
|
|
|
}
|
|
|
|
|
2014-10-27 17:23:02 +08:00
|
|
|
define float @fp-armv8_vminnm_u_rev(float %a, float %b) {
|
|
|
|
; CHECK-LABEL: "fp-armv8_vminnm_u_rev":
|
2015-08-14 01:28:16 +08:00
|
|
|
; CHECK-NOT: vcmp
|
|
|
|
; CHECK: vminnm.f32
|
|
|
|
%cmp = fcmp fast ugt float %a, %b
|
2014-10-27 17:23:02 +08:00
|
|
|
%cond = select i1 %cmp, float %b, float %a
|
|
|
|
ret float %cond
|
|
|
|
}
|
|
|
|
|
2015-04-09 01:18:28 +08:00
|
|
|
define double @fp-armv8_vminnm_uge_rev(double %a, double %b) {
|
|
|
|
; CHECK-LABEL: "fp-armv8_vminnm_uge_rev":
|
2015-08-14 01:28:16 +08:00
|
|
|
; CHECK-NOT: vcmp
|
|
|
|
; CHECK: vminnm.f64
|
|
|
|
%cmp = fcmp fast uge double %a, %b
|
2015-04-09 01:18:28 +08:00
|
|
|
%cond = select i1 %cmp, double %b, double %a
|
|
|
|
ret double %cond
|
|
|
|
}
|
|
|
|
|
2013-09-13 21:46:57 +08:00
|
|
|
define float @fp-armv8_vmaxnm_o(float %a, float %b) {
|
2014-10-27 17:23:02 +08:00
|
|
|
; CHECK-LABEL: "fp-armv8_vmaxnm_o":
|
2015-08-14 01:28:16 +08:00
|
|
|
; CHECK-NOT: vcmp
|
|
|
|
; CHECK: vmaxnm.f32
|
|
|
|
%cmp = fcmp fast ogt float %a, %b
|
2013-08-23 20:01:13 +08:00
|
|
|
%cond = select i1 %cmp, float %a, float %b
|
|
|
|
ret float %cond
|
|
|
|
}
|
|
|
|
|
2015-04-09 01:18:28 +08:00
|
|
|
define float @fp-armv8_vmaxnm_oge(float %a, float %b) {
|
|
|
|
; CHECK-LABEL: "fp-armv8_vmaxnm_oge":
|
2015-08-14 01:28:16 +08:00
|
|
|
; CHECK-NOT: vcmp
|
|
|
|
; CHECK: vmaxnm.f32
|
|
|
|
%cmp = fcmp fast oge float %a, %b
|
2015-04-09 01:18:28 +08:00
|
|
|
%cond = select i1 %cmp, float %a, float %b
|
|
|
|
ret float %cond
|
|
|
|
}
|
|
|
|
|
2014-10-27 17:23:02 +08:00
|
|
|
define float @fp-armv8_vmaxnm_o_rev(float %a, float %b) {
|
|
|
|
; CHECK-LABEL: "fp-armv8_vmaxnm_o_rev":
|
2015-08-14 01:28:16 +08:00
|
|
|
; CHECK-NOT: vcmp
|
|
|
|
; CHECK: vmaxnm.f32
|
|
|
|
%cmp = fcmp fast olt float %a, %b
|
2014-10-27 17:23:02 +08:00
|
|
|
%cond = select i1 %cmp, float %b, float %a
|
|
|
|
ret float %cond
|
|
|
|
}
|
|
|
|
|
2015-04-09 01:18:28 +08:00
|
|
|
define float @fp-armv8_vmaxnm_ole_rev(float %a, float %b) {
|
|
|
|
; CHECK-LABEL: "fp-armv8_vmaxnm_ole_rev":
|
2015-08-14 01:28:16 +08:00
|
|
|
; CHECK-NOT: vcmp
|
|
|
|
; CHECK: vmaxnm.f32
|
|
|
|
%cmp = fcmp fast ole float %a, %b
|
2015-04-09 01:18:28 +08:00
|
|
|
%cond = select i1 %cmp, float %b, float %a
|
|
|
|
ret float %cond
|
|
|
|
}
|
|
|
|
|
2013-09-13 21:46:57 +08:00
|
|
|
define float @fp-armv8_vmaxnm_u(float %a, float %b) {
|
2014-10-27 17:23:02 +08:00
|
|
|
; CHECK-LABEL: "fp-armv8_vmaxnm_u":
|
2015-08-14 01:28:16 +08:00
|
|
|
; CHECK-NOT: vcmp
|
|
|
|
; CHECK: vmaxnm.f32
|
|
|
|
%cmp = fcmp fast ugt float %a, %b
|
2013-08-23 20:01:13 +08:00
|
|
|
%cond = select i1 %cmp, float %a, float %b
|
|
|
|
ret float %cond
|
|
|
|
}
|
|
|
|
|
2015-04-09 01:18:28 +08:00
|
|
|
define float @fp-armv8_vmaxnm_uge(float %a, float %b) {
|
|
|
|
; CHECK-LABEL: "fp-armv8_vmaxnm_uge":
|
2015-08-14 01:28:16 +08:00
|
|
|
; CHECK-NOT: vcmp
|
|
|
|
; CHECK: vmaxnm.f32
|
|
|
|
%cmp = fcmp fast uge float %a, %b
|
2015-04-09 01:18:28 +08:00
|
|
|
%cond = select i1 %cmp, float %a, float %b
|
|
|
|
ret float %cond
|
|
|
|
}
|
|
|
|
|
2014-10-27 17:23:02 +08:00
|
|
|
define float @fp-armv8_vmaxnm_u_rev(float %a, float %b) {
|
|
|
|
; CHECK-LABEL: "fp-armv8_vmaxnm_u_rev":
|
2015-08-14 01:28:16 +08:00
|
|
|
; CHECK-NOT: vcmp
|
|
|
|
; CHECK: vmaxnm.f32
|
|
|
|
%cmp = fcmp fast ult float %a, %b
|
2014-10-27 17:23:02 +08:00
|
|
|
%cond = select i1 %cmp, float %b, float %a
|
|
|
|
ret float %cond
|
|
|
|
}
|
|
|
|
|
2015-04-09 01:18:28 +08:00
|
|
|
define double @fp-armv8_vmaxnm_ule_rev(double %a, double %b) {
|
|
|
|
; CHECK-LABEL: "fp-armv8_vmaxnm_ule_rev":
|
2015-08-14 01:28:16 +08:00
|
|
|
; CHECK-NOT: vcmp
|
|
|
|
; CHECK: vmaxnm.f64
|
|
|
|
%cmp = fcmp fast ule double %a, %b
|
2015-04-09 01:18:28 +08:00
|
|
|
%cond = select i1 %cmp, double %b, double %a
|
|
|
|
ret double %cond
|
|
|
|
}
|
|
|
|
|
2015-05-06 19:44:10 +08:00
|
|
|
; known non-NaNs
|
|
|
|
|
|
|
|
define float @fp-armv8_vminnm_NNNo(float %a) {
|
|
|
|
; CHECK-LABEL: "fp-armv8_vminnm_NNNo":
|
|
|
|
; CHECK: vminnm.f32
|
2015-08-14 01:28:16 +08:00
|
|
|
; CHECK: vminnm.f32
|
|
|
|
%cmp1 = fcmp fast olt float %a, 12.
|
2015-05-06 19:44:10 +08:00
|
|
|
%cond1 = select i1 %cmp1, float %a, float 12.
|
2015-08-14 01:28:16 +08:00
|
|
|
%cmp2 = fcmp fast olt float 34., %cond1
|
2015-05-06 19:44:10 +08:00
|
|
|
%cond2 = select i1 %cmp2, float 34., float %cond1
|
|
|
|
ret float %cond2
|
|
|
|
}
|
|
|
|
|
|
|
|
define double @fp-armv8_vminnm_NNNole(double %a) {
|
|
|
|
; CHECK-LABEL: "fp-armv8_vminnm_NNNole":
|
|
|
|
; CHECK: vminnm.f64
|
2015-08-14 01:28:16 +08:00
|
|
|
; CHECK: vminnm.f64
|
|
|
|
%cmp1 = fcmp fast ole double %a, 34.
|
2015-05-06 19:44:10 +08:00
|
|
|
%cond1 = select i1 %cmp1, double %a, double 34.
|
2015-08-14 01:28:16 +08:00
|
|
|
%cmp2 = fcmp fast ole double 56., %cond1
|
2015-05-06 19:44:10 +08:00
|
|
|
%cond2 = select i1 %cmp2, double 56., double %cond1
|
|
|
|
ret double %cond2
|
|
|
|
}
|
|
|
|
|
|
|
|
define float @fp-armv8_vminnm_NNNo_rev(float %a) {
|
|
|
|
; CHECK-LABEL: "fp-armv8_vminnm_NNNo_rev":
|
|
|
|
; CHECK: vminnm.f32
|
2015-08-14 01:28:16 +08:00
|
|
|
; CHECK: vminnm.f32
|
|
|
|
%cmp1 = fcmp fast ogt float %a, 56.
|
2015-05-06 19:44:10 +08:00
|
|
|
%cond1 = select i1 %cmp1, float 56., float %a
|
2015-08-14 01:28:16 +08:00
|
|
|
%cmp2 = fcmp fast ogt float 78., %cond1
|
2015-05-06 19:44:10 +08:00
|
|
|
%cond2 = select i1 %cmp2, float %cond1, float 78.
|
|
|
|
ret float %cond2
|
|
|
|
}
|
|
|
|
|
|
|
|
define double @fp-armv8_vminnm_NNNoge_rev(double %a) {
|
|
|
|
; CHECK-LABEL: "fp-armv8_vminnm_NNNoge_rev":
|
|
|
|
; CHECK: vminnm.f64
|
2015-08-14 01:28:16 +08:00
|
|
|
; CHECK: vminnm.f64
|
|
|
|
%cmp1 = fcmp fast oge double %a, 78.
|
2015-05-06 19:44:10 +08:00
|
|
|
%cond1 = select i1 %cmp1, double 78., double %a
|
2015-08-14 01:28:16 +08:00
|
|
|
%cmp2 = fcmp fast oge double 90., %cond1
|
2015-05-06 19:44:10 +08:00
|
|
|
%cond2 = select i1 %cmp2, double %cond1, double 90.
|
|
|
|
ret double %cond2
|
|
|
|
}
|
|
|
|
|
|
|
|
define float @fp-armv8_vminnm_NNNu(float %b) {
|
|
|
|
; CHECK-LABEL: "fp-armv8_vminnm_NNNu":
|
|
|
|
; CHECK: vminnm.f32
|
2015-08-14 01:28:16 +08:00
|
|
|
; CHECK: vminnm.f32
|
|
|
|
%cmp1 = fcmp fast ult float 12., %b
|
2015-05-06 19:44:10 +08:00
|
|
|
%cond1 = select i1 %cmp1, float 12., float %b
|
2015-08-14 01:28:16 +08:00
|
|
|
%cmp2 = fcmp fast ult float %cond1, 34.
|
2015-05-06 19:44:10 +08:00
|
|
|
%cond2 = select i1 %cmp2, float %cond1, float 34.
|
|
|
|
ret float %cond2
|
|
|
|
}
|
|
|
|
|
|
|
|
define float @fp-armv8_vminnm_NNNule(float %b) {
|
|
|
|
; CHECK-LABEL: "fp-armv8_vminnm_NNNule":
|
|
|
|
; CHECK: vminnm.f32
|
2015-08-14 01:28:16 +08:00
|
|
|
; CHECK: vminnm.f32
|
|
|
|
%cmp1 = fcmp fast ule float 34., %b
|
2015-05-06 19:44:10 +08:00
|
|
|
%cond1 = select i1 %cmp1, float 34., float %b
|
2015-08-14 01:28:16 +08:00
|
|
|
%cmp2 = fcmp fast ule float %cond1, 56.
|
2015-05-06 19:44:10 +08:00
|
|
|
%cond2 = select i1 %cmp2, float %cond1, float 56.
|
|
|
|
ret float %cond2
|
|
|
|
}
|
|
|
|
|
|
|
|
define float @fp-armv8_vminnm_NNNu_rev(float %b) {
|
|
|
|
; CHECK-LABEL: "fp-armv8_vminnm_NNNu_rev":
|
|
|
|
; CHECK: vminnm.f32
|
2015-08-14 01:28:16 +08:00
|
|
|
; CHECK: vminnm.f32
|
|
|
|
%cmp1 = fcmp fast ugt float 56., %b
|
2015-05-06 19:44:10 +08:00
|
|
|
%cond1 = select i1 %cmp1, float %b, float 56.
|
2015-08-14 01:28:16 +08:00
|
|
|
%cmp2 = fcmp fast ugt float %cond1, 78.
|
2015-05-06 19:44:10 +08:00
|
|
|
%cond2 = select i1 %cmp2, float 78., float %cond1
|
|
|
|
ret float %cond2
|
|
|
|
}
|
|
|
|
|
|
|
|
define double @fp-armv8_vminnm_NNNuge_rev(double %b) {
|
|
|
|
; CHECK-LABEL: "fp-armv8_vminnm_NNNuge_rev":
|
|
|
|
; CHECK: vminnm.f64
|
2015-08-14 01:28:16 +08:00
|
|
|
; CHECK: vminnm.f64
|
|
|
|
%cmp1 = fcmp fast uge double 78., %b
|
2015-05-06 19:44:10 +08:00
|
|
|
%cond1 = select i1 %cmp1, double %b, double 78.
|
2015-08-14 01:28:16 +08:00
|
|
|
%cmp2 = fcmp fast uge double %cond1, 90.
|
2015-05-06 19:44:10 +08:00
|
|
|
%cond2 = select i1 %cmp2, double 90., double %cond1
|
|
|
|
ret double %cond2
|
|
|
|
}
|
|
|
|
|
|
|
|
define float @fp-armv8_vmaxnm_NNNo(float %a) {
|
|
|
|
; CHECK-LABEL: "fp-armv8_vmaxnm_NNNo":
|
|
|
|
; CHECK: vmaxnm.f32
|
2015-08-14 01:28:16 +08:00
|
|
|
; CHECK: vmaxnm.f32
|
|
|
|
%cmp1 = fcmp fast ogt float %a, 12.
|
2015-05-06 19:44:10 +08:00
|
|
|
%cond1 = select i1 %cmp1, float %a, float 12.
|
2015-08-14 01:28:16 +08:00
|
|
|
%cmp2 = fcmp fast ogt float 34., %cond1
|
2015-05-06 19:44:10 +08:00
|
|
|
%cond2 = select i1 %cmp2, float 34., float %cond1
|
|
|
|
ret float %cond2
|
|
|
|
}
|
|
|
|
|
|
|
|
define float @fp-armv8_vmaxnm_NNNoge(float %a) {
|
|
|
|
; CHECK-LABEL: "fp-armv8_vmaxnm_NNNoge":
|
|
|
|
; CHECK: vmaxnm.f32
|
2015-08-14 01:28:16 +08:00
|
|
|
; CHECK: vmaxnm.f32
|
|
|
|
%cmp1 = fcmp fast oge float %a, 34.
|
2015-05-06 19:44:10 +08:00
|
|
|
%cond1 = select i1 %cmp1, float %a, float 34.
|
2015-08-14 01:28:16 +08:00
|
|
|
%cmp2 = fcmp fast oge float 56., %cond1
|
2015-05-06 19:44:10 +08:00
|
|
|
%cond2 = select i1 %cmp2, float 56., float %cond1
|
|
|
|
ret float %cond2
|
|
|
|
}
|
|
|
|
|
|
|
|
define float @fp-armv8_vmaxnm_NNNo_rev(float %a) {
|
|
|
|
; CHECK-LABEL: "fp-armv8_vmaxnm_NNNo_rev":
|
|
|
|
; CHECK: vmaxnm.f32
|
2015-08-14 01:28:16 +08:00
|
|
|
; CHECK: vmaxnm.f32
|
|
|
|
%cmp1 = fcmp fast olt float %a, 56.
|
2015-05-06 19:44:10 +08:00
|
|
|
%cond1 = select i1 %cmp1, float 56., float %a
|
2015-08-14 01:28:16 +08:00
|
|
|
%cmp2 = fcmp fast olt float 78., %cond1
|
2015-05-06 19:44:10 +08:00
|
|
|
%cond2 = select i1 %cmp2, float %cond1, float 78.
|
|
|
|
ret float %cond2
|
|
|
|
}
|
|
|
|
|
|
|
|
define float @fp-armv8_vmaxnm_NNNole_rev(float %a) {
|
|
|
|
; CHECK-LABEL: "fp-armv8_vmaxnm_NNNole_rev":
|
|
|
|
; CHECK: vmaxnm.f32
|
2015-08-14 01:28:16 +08:00
|
|
|
; CHECK: vmaxnm.f32
|
|
|
|
%cmp1 = fcmp fast ole float %a, 78.
|
2015-05-06 19:44:10 +08:00
|
|
|
%cond1 = select i1 %cmp1, float 78., float %a
|
2015-08-14 01:28:16 +08:00
|
|
|
%cmp2 = fcmp fast ole float 90., %cond1
|
2015-05-06 19:44:10 +08:00
|
|
|
%cond2 = select i1 %cmp2, float %cond1, float 90.
|
|
|
|
ret float %cond2
|
|
|
|
}
|
|
|
|
|
|
|
|
define float @fp-armv8_vmaxnm_NNNu(float %b) {
|
|
|
|
; CHECK-LABEL: "fp-armv8_vmaxnm_NNNu":
|
|
|
|
; CHECK: vmaxnm.f32
|
2015-08-14 01:28:16 +08:00
|
|
|
; CHECK: vmaxnm.f32
|
|
|
|
%cmp1 = fcmp fast ugt float 12., %b
|
2015-05-06 19:44:10 +08:00
|
|
|
%cond1 = select i1 %cmp1, float 12., float %b
|
2015-08-14 01:28:16 +08:00
|
|
|
%cmp2 = fcmp fast ugt float %cond1, 34.
|
2015-05-06 19:44:10 +08:00
|
|
|
%cond2 = select i1 %cmp2, float %cond1, float 34.
|
|
|
|
ret float %cond2
|
|
|
|
}
|
|
|
|
|
|
|
|
define float @fp-armv8_vmaxnm_NNNuge(float %b) {
|
|
|
|
; CHECK-LABEL: "fp-armv8_vmaxnm_NNNuge":
|
|
|
|
; CHECK: vmaxnm.f32
|
2015-08-14 01:28:16 +08:00
|
|
|
; CHECK: vmaxnm.f32
|
|
|
|
%cmp1 = fcmp fast uge float 34., %b
|
2015-05-06 19:44:10 +08:00
|
|
|
%cond1 = select i1 %cmp1, float 34., float %b
|
2015-08-14 01:28:16 +08:00
|
|
|
%cmp2 = fcmp fast uge float %cond1, 56.
|
2015-05-06 19:44:10 +08:00
|
|
|
%cond2 = select i1 %cmp2, float %cond1, float 56.
|
|
|
|
ret float %cond2
|
|
|
|
}
|
|
|
|
|
|
|
|
define float @fp-armv8_vmaxnm_NNNu_rev(float %b) {
|
|
|
|
; CHECK-LABEL: "fp-armv8_vmaxnm_NNNu_rev":
|
|
|
|
; CHECK: vmaxnm.f32
|
2015-08-14 01:28:16 +08:00
|
|
|
; CHECK: vmaxnm.f32
|
|
|
|
%cmp1 = fcmp fast ult float 56., %b
|
2015-05-06 19:44:10 +08:00
|
|
|
%cond1 = select i1 %cmp1, float %b, float 56.
|
2015-08-14 01:28:16 +08:00
|
|
|
%cmp2 = fcmp fast ult float %cond1, 78.
|
2015-05-06 19:44:10 +08:00
|
|
|
%cond2 = select i1 %cmp2, float 78., float %cond1
|
|
|
|
ret float %cond2
|
|
|
|
}
|
|
|
|
|
|
|
|
define double @fp-armv8_vmaxnm_NNNule_rev( double %b) {
|
|
|
|
; CHECK-LABEL: "fp-armv8_vmaxnm_NNNule_rev":
|
|
|
|
; CHECK: vmaxnm.f64
|
2015-08-14 01:28:16 +08:00
|
|
|
; CHECK: vmaxnm.f64
|
|
|
|
%cmp1 = fcmp fast ule double 78., %b
|
2015-05-06 19:44:10 +08:00
|
|
|
%cond1 = select i1 %cmp1, double %b, double 78.
|
2015-08-14 01:28:16 +08:00
|
|
|
%cmp2 = fcmp fast ule double %cond1, 90.
|
2015-05-06 19:44:10 +08:00
|
|
|
%cond2 = select i1 %cmp2, double 90., double %cond1
|
|
|
|
ret double %cond2
|
|
|
|
}
|
|
|
|
|
|
|
|
define float @fp-armv8_vminmaxnm_0(float %a) {
|
|
|
|
; CHECK-LABEL: "fp-armv8_vminmaxnm_0":
|
2015-08-14 01:28:16 +08:00
|
|
|
; CHECK-NOT: vcmp
|
|
|
|
; CHECK: vminnm.f32
|
2015-05-06 19:44:10 +08:00
|
|
|
; CHECK: vmaxnm.f32
|
2015-08-14 01:28:16 +08:00
|
|
|
%cmp1 = fcmp fast olt float %a, 0.
|
2015-05-06 19:44:10 +08:00
|
|
|
%cond1 = select i1 %cmp1, float %a, float 0.
|
2015-08-14 01:28:16 +08:00
|
|
|
%cmp2 = fcmp fast ogt float %cond1, 0.
|
2015-05-06 19:44:10 +08:00
|
|
|
%cond2 = select i1 %cmp2, float %cond1, float 0.
|
|
|
|
ret float %cond2
|
|
|
|
}
|
|
|
|
|
|
|
|
define float @fp-armv8_vminmaxnm_neg0(float %a) {
|
|
|
|
; CHECK-LABEL: "fp-armv8_vminmaxnm_neg0":
|
2015-08-14 01:28:16 +08:00
|
|
|
; CHECK-NOT: vcmp
|
2015-05-06 19:44:10 +08:00
|
|
|
; CHECK: vminnm.f32
|
2015-08-14 01:28:16 +08:00
|
|
|
; CHECK: vmaxnm.f32
|
|
|
|
%cmp1 = fcmp fast olt float %a, -0.
|
2015-05-06 19:44:10 +08:00
|
|
|
%cond1 = select i1 %cmp1, float %a, float -0.
|
2015-08-17 15:13:10 +08:00
|
|
|
%cmp2 = fcmp fast ugt float %cond1, -0.
|
2015-05-06 19:44:10 +08:00
|
|
|
%cond2 = select i1 %cmp2, float %cond1, float -0.
|
|
|
|
ret float %cond2
|
|
|
|
}
|
|
|
|
|
|
|
|
define float @fp-armv8_vminmaxnm_e_0(float %a) {
|
|
|
|
; CHECK-LABEL: "fp-armv8_vminmaxnm_e_0":
|
2015-08-14 01:28:16 +08:00
|
|
|
; CHECK-NOT: vcmp
|
|
|
|
; CHECK: vminnm.f32
|
2015-05-06 19:44:10 +08:00
|
|
|
; CHECK: vmaxnm.f32
|
2015-08-14 01:28:16 +08:00
|
|
|
%cmp1 = fcmp fast ule float 0., %a
|
2015-05-06 19:44:10 +08:00
|
|
|
%cond1 = select i1 %cmp1, float 0., float %a
|
2015-08-14 01:28:16 +08:00
|
|
|
%cmp2 = fcmp fast uge float 0., %cond1
|
2015-05-06 19:44:10 +08:00
|
|
|
%cond2 = select i1 %cmp2, float 0., float %cond1
|
|
|
|
ret float %cond2
|
|
|
|
}
|
|
|
|
|
|
|
|
define float @fp-armv8_vminmaxnm_e_neg0(float %a) {
|
|
|
|
; CHECK-LABEL: "fp-armv8_vminmaxnm_e_neg0":
|
2015-08-14 01:28:16 +08:00
|
|
|
; CHECK-NOT: vcmp
|
2015-05-06 19:44:10 +08:00
|
|
|
; CHECK: vminnm.f32
|
2015-08-14 01:28:16 +08:00
|
|
|
; CHECK: vmaxnm.f32
|
|
|
|
%cmp1 = fcmp fast ule float -0., %a
|
2015-05-06 19:44:10 +08:00
|
|
|
%cond1 = select i1 %cmp1, float -0., float %a
|
2015-08-14 01:28:16 +08:00
|
|
|
%cmp2 = fcmp fast oge float -0., %cond1
|
2015-05-06 19:44:10 +08:00
|
|
|
%cond2 = select i1 %cmp2, float -0., float %cond1
|
|
|
|
ret float %cond2
|
|
|
|
}
|
2013-08-23 20:01:13 +08:00
|
|
|
|
2013-07-17 22:03:49 +08:00
|
|
|
declare <4 x float> @llvm.arm.neon.vminnm.v4f32(<4 x float>, <4 x float>) nounwind readnone
|
|
|
|
declare <2 x float> @llvm.arm.neon.vminnm.v2f32(<2 x float>, <2 x float>) nounwind readnone
|
|
|
|
declare <4 x float> @llvm.arm.neon.vmaxnm.v4f32(<4 x float>, <4 x float>) nounwind readnone
|
|
|
|
declare <2 x float> @llvm.arm.neon.vmaxnm.v2f32(<2 x float>, <2 x float>) nounwind readnone
|