2019-03-30 02:21:19 +08:00
|
|
|
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
|
|
|
|
; RUN: llc < %s -mtriple=thumbv7m-arm-none-eabi -mattr=+execute-only,+fp-armv8 | FileCheck %s --check-prefixes=CHECK,VMOVSR
|
|
|
|
; RUN: llc < %s -mtriple=thumbv7m-arm-none-eabi -mattr=+execute-only,+fp-armv8,+neon,+neonfp | FileCheck %s --check-prefixes=CHECK,NEON
|
2018-03-23 21:02:03 +08:00
|
|
|
|
2019-04-05 22:56:21 +08:00
|
|
|
define arm_aapcs_vfpcc float @foo0(float %a0) local_unnamed_addr {
|
2019-03-30 02:21:19 +08:00
|
|
|
; CHECK-LABEL: foo0:
|
|
|
|
; CHECK: @ %bb.0:
|
2019-10-08 16:25:42 +08:00
|
|
|
; CHECK-NEXT: vcmp.f32 s0, #0
|
2019-04-05 22:56:21 +08:00
|
|
|
; CHECK-NEXT: vmov.f32 s2, #5.000000e-01
|
2019-03-30 02:21:19 +08:00
|
|
|
; CHECK-NEXT: vmrs APSR_nzcv, fpscr
|
2019-04-05 22:56:21 +08:00
|
|
|
; CHECK-NEXT: vmov.f32 s4, #-5.000000e-01
|
2019-03-30 02:21:19 +08:00
|
|
|
; CHECK-NEXT: it mi
|
2019-04-05 22:56:21 +08:00
|
|
|
; CHECK-NEXT: vmovmi.f32 s2, s4
|
|
|
|
; CHECK-NEXT: vmov.f32 s0, s2
|
2019-03-30 02:21:19 +08:00
|
|
|
; CHECK-NEXT: bx lr
|
2019-04-05 22:56:21 +08:00
|
|
|
%1 = fcmp nsz olt float %a0, 0.000000e+00
|
2018-03-28 18:02:26 +08:00
|
|
|
%2 = select i1 %1, float -5.000000e-01, float 5.000000e-01
|
|
|
|
ret float %2
|
2018-03-23 21:02:03 +08:00
|
|
|
}
|
|
|
|
|
2019-04-05 22:56:21 +08:00
|
|
|
define arm_aapcs_vfpcc float @float1(float %a0) local_unnamed_addr {
|
2019-03-30 02:21:19 +08:00
|
|
|
; CHECK-LABEL: float1:
|
|
|
|
; CHECK: @ %bb.0: @ %.end
|
2019-04-05 22:56:21 +08:00
|
|
|
; CHECK-NEXT: vmov.f32 s2, #1.000000e+00
|
|
|
|
; CHECK-NEXT: vmov.f32 s4, #5.000000e-01
|
|
|
|
; CHECK-NEXT: vmov.f32 s6, #-5.000000e-01
|
2019-10-08 16:25:42 +08:00
|
|
|
; CHECK-NEXT: vcmp.f32 s2, s0
|
2019-03-30 02:21:19 +08:00
|
|
|
; CHECK-NEXT: vmrs APSR_nzcv, fpscr
|
2019-04-05 22:56:21 +08:00
|
|
|
; CHECK-NEXT: vselgt.f32 s0, s6, s4
|
2019-03-30 02:21:19 +08:00
|
|
|
; CHECK-NEXT: bx lr
|
2018-03-23 21:02:03 +08:00
|
|
|
br i1 undef, label %.end, label %1
|
|
|
|
|
2019-04-05 22:56:21 +08:00
|
|
|
%2 = fcmp nsz olt float %a0, 1.000000e+00
|
2018-03-23 21:02:03 +08:00
|
|
|
%3 = select i1 %2, float -5.000000e-01, float 5.000000e-01
|
|
|
|
br label %.end
|
|
|
|
|
|
|
|
.end:
|
2018-03-28 18:02:26 +08:00
|
|
|
%4 = phi float [ undef, %0 ], [ %3, %1]
|
|
|
|
ret float %4
|
2018-03-23 21:02:03 +08:00
|
|
|
}
|
|
|
|
|
2019-04-05 22:56:21 +08:00
|
|
|
define arm_aapcs_vfpcc float @float128(float %a0) local_unnamed_addr {
|
2019-03-30 02:21:19 +08:00
|
|
|
; VMOVSR-LABEL: float128:
|
|
|
|
; VMOVSR: @ %bb.0:
|
|
|
|
; VMOVSR-NEXT: mov.w r0, #1124073472
|
2019-04-05 22:56:21 +08:00
|
|
|
; VMOVSR-NEXT: vmov.f32 s4, #5.000000e-01
|
|
|
|
; VMOVSR-NEXT: vmov s2, r0
|
|
|
|
; VMOVSR-NEXT: vmov.f32 s6, #-5.000000e-01
|
2019-10-08 16:25:42 +08:00
|
|
|
; VMOVSR-NEXT: vcmp.f32 s2, s0
|
2019-03-30 02:21:19 +08:00
|
|
|
; VMOVSR-NEXT: vmrs APSR_nzcv, fpscr
|
2019-04-05 22:56:21 +08:00
|
|
|
; VMOVSR-NEXT: vselgt.f32 s0, s6, s4
|
2019-03-30 02:21:19 +08:00
|
|
|
; VMOVSR-NEXT: bx lr
|
|
|
|
;
|
|
|
|
; NEON-LABEL: float128:
|
|
|
|
; NEON: @ %bb.0:
|
|
|
|
; NEON-NEXT: mov.w r0, #1124073472
|
2019-04-05 22:56:21 +08:00
|
|
|
; NEON-NEXT: vmov.f32 s2, #5.000000e-01
|
|
|
|
; NEON-NEXT: vmov d3, r0, r0
|
|
|
|
; NEON-NEXT: vmov.f32 s4, #-5.000000e-01
|
2019-10-08 16:25:42 +08:00
|
|
|
; NEON-NEXT: vcmp.f32 s6, s0
|
2019-03-30 02:21:19 +08:00
|
|
|
; NEON-NEXT: vmrs APSR_nzcv, fpscr
|
2019-04-05 22:56:21 +08:00
|
|
|
; NEON-NEXT: vselgt.f32 s0, s4, s2
|
2019-03-30 02:21:19 +08:00
|
|
|
; NEON-NEXT: bx lr
|
2019-04-05 22:56:21 +08:00
|
|
|
%1 = fcmp nsz olt float %a0, 128.000000e+00
|
2018-03-28 18:02:26 +08:00
|
|
|
%2 = select i1 %1, float -5.000000e-01, float 5.000000e-01
|
|
|
|
ret float %2
|
2018-03-23 21:02:03 +08:00
|
|
|
}
|
|
|
|
|
2019-04-05 22:56:21 +08:00
|
|
|
define arm_aapcs_vfpcc double @double1(double %a0) local_unnamed_addr {
|
2019-03-30 02:21:19 +08:00
|
|
|
; CHECK-LABEL: double1:
|
|
|
|
; CHECK: @ %bb.0:
|
|
|
|
; CHECK-NEXT: vmov.f64 d18, #1.000000e+00
|
2019-10-08 16:25:42 +08:00
|
|
|
; CHECK-NEXT: vcmp.f64 d18, d0
|
2019-03-30 02:21:19 +08:00
|
|
|
; CHECK-NEXT: vmrs APSR_nzcv, fpscr
|
2019-04-05 22:56:21 +08:00
|
|
|
; CHECK-NEXT: vmov.f64 d16, #5.000000e-01
|
2019-03-30 02:21:19 +08:00
|
|
|
; CHECK-NEXT: vmov.f64 d17, #-5.000000e-01
|
|
|
|
; CHECK-NEXT: vselgt.f64 d0, d17, d16
|
|
|
|
; CHECK-NEXT: bx lr
|
2019-04-05 22:56:21 +08:00
|
|
|
%1 = fcmp nsz olt double %a0, 1.000000e+00
|
2018-03-28 18:02:26 +08:00
|
|
|
%2 = select i1 %1, double -5.000000e-01, double 5.000000e-01
|
|
|
|
ret double %2
|
2018-03-23 21:02:03 +08:00
|
|
|
}
|
|
|
|
|
2019-04-05 22:56:21 +08:00
|
|
|
define arm_aapcs_vfpcc double @double128(double %a0) local_unnamed_addr {
|
2019-03-30 02:21:19 +08:00
|
|
|
; CHECK-LABEL: double128:
|
|
|
|
; CHECK: @ %bb.0:
|
|
|
|
; CHECK-NEXT: movs r0, #0
|
|
|
|
; CHECK-NEXT: movs r1, #0
|
2019-04-05 22:56:21 +08:00
|
|
|
; CHECK-NEXT: movt r0, #16480
|
|
|
|
; CHECK-NEXT: vmov.f64 d16, #5.000000e-01
|
2019-03-30 02:21:19 +08:00
|
|
|
; CHECK-NEXT: vmov d18, r1, r0
|
2019-10-08 16:25:42 +08:00
|
|
|
; CHECK-NEXT: vcmp.f64 d18, d0
|
2019-03-30 02:21:19 +08:00
|
|
|
; CHECK-NEXT: vmrs APSR_nzcv, fpscr
|
|
|
|
; CHECK-NEXT: vmov.f64 d17, #-5.000000e-01
|
|
|
|
; CHECK-NEXT: vselgt.f64 d0, d17, d16
|
|
|
|
; CHECK-NEXT: bx lr
|
2019-04-05 22:56:21 +08:00
|
|
|
%1 = fcmp nsz olt double %a0, 128.000000e+00
|
2018-03-28 18:02:26 +08:00
|
|
|
%2 = select i1 %1, double -5.000000e-01, double 5.000000e-01
|
|
|
|
ret double %2
|
2018-03-23 21:02:03 +08:00
|
|
|
}
|