forked from OSchip/llvm-project
[AArch64] Rewrite floatdp_1source.ll test. NFC
Rewrite this test to not rely on volatile stores in a large function, just use separate functions like any other test would.
This commit is contained in:
parent
fe15347a1e
commit
7ff67d5bf8
|
@ -1,9 +1,6 @@
|
|||
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
|
||||
; RUN: llc -verify-machineinstrs -o - %s -mtriple=arm64-apple-ios7.0 | FileCheck %s
|
||||
|
||||
@varhalf = global half 0.0
|
||||
@varfloat = global float 0.0
|
||||
@vardouble = global double 0.0
|
||||
|
||||
declare float @fabsf(float) readonly
|
||||
declare double @fabs(double) readonly
|
||||
|
||||
|
@ -25,114 +22,200 @@ declare double @rint(double) readonly
|
|||
declare float @nearbyintf(float) readonly
|
||||
declare double @nearbyint(double) readonly
|
||||
|
||||
define void @simple_float() {
|
||||
; CHECK-LABEL: simple_float:
|
||||
%val1 = load volatile float, float* @varfloat
|
||||
|
||||
%valabs = call float @fabsf(float %val1)
|
||||
store volatile float %valabs, float* @varfloat
|
||||
; CHECK: fabs {{s[0-9]+}}, {{s[0-9]+}}
|
||||
|
||||
%valneg = fsub float -0.0, %val1
|
||||
store volatile float %valneg, float* @varfloat
|
||||
; CHECK: fneg {{s[0-9]+}}, {{s[0-9]+}}
|
||||
|
||||
%valsqrt = call float @llvm.sqrt.f32(float %val1)
|
||||
store volatile float %valsqrt, float* @varfloat
|
||||
; CHECK: fsqrt {{s[0-9]+}}, {{s[0-9]+}}
|
||||
|
||||
%valceil = call float @ceilf(float %val1)
|
||||
store volatile float %valceil, float* @varfloat
|
||||
; CHECK: frintp {{s[0-9]+}}, {{s[0-9]+}}
|
||||
|
||||
%valfloor = call float @floorf(float %val1)
|
||||
store volatile float %valfloor, float* @varfloat
|
||||
; CHECK: frintm {{s[0-9]+}}, {{s[0-9]+}}
|
||||
|
||||
%valtrunc = call float @truncf(float %val1)
|
||||
store volatile float %valtrunc, float* @varfloat
|
||||
; CHECK: frintz {{s[0-9]+}}, {{s[0-9]+}}
|
||||
|
||||
%valrint = call float @rintf(float %val1)
|
||||
store volatile float %valrint, float* @varfloat
|
||||
; CHECK: frintx {{s[0-9]+}}, {{s[0-9]+}}
|
||||
|
||||
%valnearbyint = call float @nearbyintf(float %val1)
|
||||
store volatile float %valnearbyint, float* @varfloat
|
||||
; CHECK: frinti {{s[0-9]+}}, {{s[0-9]+}}
|
||||
|
||||
ret void
|
||||
define float @fabs_f(float %v) {
|
||||
; CHECK-LABEL: fabs_f:
|
||||
; CHECK: ; %bb.0:
|
||||
; CHECK-NEXT: fabs s0, s0
|
||||
; CHECK-NEXT: ret
|
||||
%r = call float @fabsf(float %v)
|
||||
ret float %r
|
||||
}
|
||||
|
||||
define void @simple_double() {
|
||||
; CHECK-LABEL: simple_double:
|
||||
%val1 = load volatile double, double* @vardouble
|
||||
|
||||
%valabs = call double @fabs(double %val1)
|
||||
store volatile double %valabs, double* @vardouble
|
||||
; CHECK: fabs {{d[0-9]+}}, {{d[0-9]+}}
|
||||
|
||||
%valneg = fsub double -0.0, %val1
|
||||
store volatile double %valneg, double* @vardouble
|
||||
; CHECK: fneg {{d[0-9]+}}, {{d[0-9]+}}
|
||||
|
||||
%valsqrt = call double @llvm.sqrt.f64(double %val1)
|
||||
store volatile double %valsqrt, double* @vardouble
|
||||
; CHECK: fsqrt {{d[0-9]+}}, {{d[0-9]+}}
|
||||
|
||||
%valceil = call double @ceil(double %val1)
|
||||
store volatile double %valceil, double* @vardouble
|
||||
; CHECK: frintp {{d[0-9]+}}, {{d[0-9]+}}
|
||||
|
||||
%valfloor = call double @floor(double %val1)
|
||||
store volatile double %valfloor, double* @vardouble
|
||||
; CHECK: frintm {{d[0-9]+}}, {{d[0-9]+}}
|
||||
|
||||
%valtrunc = call double @trunc(double %val1)
|
||||
store volatile double %valtrunc, double* @vardouble
|
||||
; CHECK: frintz {{d[0-9]+}}, {{d[0-9]+}}
|
||||
|
||||
%valrint = call double @rint(double %val1)
|
||||
store volatile double %valrint, double* @vardouble
|
||||
; CHECK: frintx {{d[0-9]+}}, {{d[0-9]+}}
|
||||
|
||||
%valnearbyint = call double @nearbyint(double %val1)
|
||||
store volatile double %valnearbyint, double* @vardouble
|
||||
; CHECK: frinti {{d[0-9]+}}, {{d[0-9]+}}
|
||||
|
||||
ret void
|
||||
define float @fsub_f(float %v) {
|
||||
; CHECK-LABEL: fsub_f:
|
||||
; CHECK: ; %bb.0:
|
||||
; CHECK-NEXT: fneg s0, s0
|
||||
; CHECK-NEXT: ret
|
||||
%r = fsub float -0.0, %v
|
||||
ret float %r
|
||||
}
|
||||
|
||||
define void @converts() {
|
||||
; CHECK-LABEL: converts:
|
||||
|
||||
%val16 = load volatile half, half* @varhalf
|
||||
%val32 = load volatile float, float* @varfloat
|
||||
%val64 = load volatile double, double* @vardouble
|
||||
|
||||
%val16to32 = fpext half %val16 to float
|
||||
store volatile float %val16to32, float* @varfloat
|
||||
; CHECK: fcvt {{s[0-9]+}}, {{h[0-9]+}}
|
||||
|
||||
%val16to64 = fpext half %val16 to double
|
||||
store volatile double %val16to64, double* @vardouble
|
||||
; CHECK: fcvt {{d[0-9]+}}, {{h[0-9]+}}
|
||||
|
||||
%val32to16 = fptrunc float %val32 to half
|
||||
store volatile half %val32to16, half* @varhalf
|
||||
; CHECK: fcvt {{h[0-9]+}}, {{s[0-9]+}}
|
||||
|
||||
%val32to64 = fpext float %val32 to double
|
||||
store volatile double %val32to64, double* @vardouble
|
||||
; CHECK: fcvt {{d[0-9]+}}, {{s[0-9]+}}
|
||||
|
||||
%val64to16 = fptrunc double %val64 to half
|
||||
store volatile half %val64to16, half* @varhalf
|
||||
; CHECK: fcvt {{h[0-9]+}}, {{d[0-9]+}}
|
||||
|
||||
%val64to32 = fptrunc double %val64 to float
|
||||
store volatile float %val64to32, float* @varfloat
|
||||
; CHECK: fcvt {{s[0-9]+}}, {{d[0-9]+}}
|
||||
|
||||
ret void
|
||||
define float @sqrt_f(float %v) {
|
||||
; CHECK-LABEL: sqrt_f:
|
||||
; CHECK: ; %bb.0:
|
||||
; CHECK-NEXT: fsqrt s0, s0
|
||||
; CHECK-NEXT: ret
|
||||
%r = call float @llvm.sqrt.f32(float %v)
|
||||
ret float %r
|
||||
}
|
||||
|
||||
define float @ceil_f(float %v) {
|
||||
; CHECK-LABEL: ceil_f:
|
||||
; CHECK: ; %bb.0:
|
||||
; CHECK-NEXT: frintp s0, s0
|
||||
; CHECK-NEXT: ret
|
||||
%r = call float @ceilf(float %v)
|
||||
ret float %r
|
||||
}
|
||||
|
||||
define float @floor_f(float %v) {
|
||||
; CHECK-LABEL: floor_f:
|
||||
; CHECK: ; %bb.0:
|
||||
; CHECK-NEXT: frintm s0, s0
|
||||
; CHECK-NEXT: ret
|
||||
%r = call float @floorf(float %v)
|
||||
ret float %r
|
||||
}
|
||||
|
||||
define float @trunc_f(float %v) {
|
||||
; CHECK-LABEL: trunc_f:
|
||||
; CHECK: ; %bb.0:
|
||||
; CHECK-NEXT: frintz s0, s0
|
||||
; CHECK-NEXT: ret
|
||||
%r = call float @truncf(float %v)
|
||||
ret float %r
|
||||
}
|
||||
|
||||
define float @rint_f(float %v) {
|
||||
; CHECK-LABEL: rint_f:
|
||||
; CHECK: ; %bb.0:
|
||||
; CHECK-NEXT: frintx s0, s0
|
||||
; CHECK-NEXT: ret
|
||||
%r = call float @rintf(float %v)
|
||||
ret float %r
|
||||
}
|
||||
|
||||
define float @nearbyint_f(float %v) {
|
||||
; CHECK-LABEL: nearbyint_f:
|
||||
; CHECK: ; %bb.0:
|
||||
; CHECK-NEXT: frinti s0, s0
|
||||
; CHECK-NEXT: ret
|
||||
%r = call float @nearbyintf(float %v)
|
||||
ret float %r
|
||||
}
|
||||
|
||||
define double @fabs_d(double %v) {
|
||||
; CHECK-LABEL: fabs_d:
|
||||
; CHECK: ; %bb.0:
|
||||
; CHECK-NEXT: fabs d0, d0
|
||||
; CHECK-NEXT: ret
|
||||
%r = call double @fabs(double %v)
|
||||
ret double %r
|
||||
}
|
||||
|
||||
define double @fsub_d(double %v) {
|
||||
; CHECK-LABEL: fsub_d:
|
||||
; CHECK: ; %bb.0:
|
||||
; CHECK-NEXT: fneg d0, d0
|
||||
; CHECK-NEXT: ret
|
||||
%r = fsub double -0.0, %v
|
||||
ret double %r
|
||||
}
|
||||
|
||||
define double @sqrt_d(double %v) {
|
||||
; CHECK-LABEL: sqrt_d:
|
||||
; CHECK: ; %bb.0:
|
||||
; CHECK-NEXT: fsqrt d0, d0
|
||||
; CHECK-NEXT: ret
|
||||
%r = call double @llvm.sqrt.f64(double %v)
|
||||
ret double %r
|
||||
}
|
||||
|
||||
define double @ceil_d(double %v) {
|
||||
; CHECK-LABEL: ceil_d:
|
||||
; CHECK: ; %bb.0:
|
||||
; CHECK-NEXT: frintp d0, d0
|
||||
; CHECK-NEXT: ret
|
||||
%r = call double @ceil(double %v)
|
||||
ret double %r
|
||||
}
|
||||
|
||||
define double @floor_d(double %v) {
|
||||
; CHECK-LABEL: floor_d:
|
||||
; CHECK: ; %bb.0:
|
||||
; CHECK-NEXT: frintm d0, d0
|
||||
; CHECK-NEXT: ret
|
||||
%r = call double @floor(double %v)
|
||||
ret double %r
|
||||
}
|
||||
|
||||
define double @trunc_d(double %v) {
|
||||
; CHECK-LABEL: trunc_d:
|
||||
; CHECK: ; %bb.0:
|
||||
; CHECK-NEXT: frintz d0, d0
|
||||
; CHECK-NEXT: ret
|
||||
%r = call double @trunc(double %v)
|
||||
ret double %r
|
||||
}
|
||||
|
||||
define double @rint_d(double %v) {
|
||||
; CHECK-LABEL: rint_d:
|
||||
; CHECK: ; %bb.0:
|
||||
; CHECK-NEXT: frintx d0, d0
|
||||
; CHECK-NEXT: ret
|
||||
%r = call double @rint(double %v)
|
||||
ret double %r
|
||||
}
|
||||
|
||||
define double @nearbyint_d(double %v) {
|
||||
; CHECK-LABEL: nearbyint_d:
|
||||
; CHECK: ; %bb.0:
|
||||
; CHECK-NEXT: frinti d0, d0
|
||||
; CHECK-NEXT: ret
|
||||
%r = call double @nearbyint(double %v)
|
||||
ret double %r
|
||||
}
|
||||
|
||||
define float @conv_h_f(half %v) {
|
||||
; CHECK-LABEL: conv_h_f:
|
||||
; CHECK: ; %bb.0:
|
||||
; CHECK-NEXT: fcvt s0, h0
|
||||
; CHECK-NEXT: ret
|
||||
%r = fpext half %v to float
|
||||
ret float %r
|
||||
}
|
||||
|
||||
define double @conv_h_d(half %v) {
|
||||
; CHECK-LABEL: conv_h_d:
|
||||
; CHECK: ; %bb.0:
|
||||
; CHECK-NEXT: fcvt d0, h0
|
||||
; CHECK-NEXT: ret
|
||||
%r = fpext half %v to double
|
||||
ret double %r
|
||||
}
|
||||
|
||||
define half @conv_f_h(float %v) {
|
||||
; CHECK-LABEL: conv_f_h:
|
||||
; CHECK: ; %bb.0:
|
||||
; CHECK-NEXT: fcvt h0, s0
|
||||
; CHECK-NEXT: ret
|
||||
%r = fptrunc float %v to half
|
||||
ret half %r
|
||||
}
|
||||
|
||||
define double @conv_f_d(float %v) {
|
||||
; CHECK-LABEL: conv_f_d:
|
||||
; CHECK: ; %bb.0:
|
||||
; CHECK-NEXT: fcvt d0, s0
|
||||
; CHECK-NEXT: ret
|
||||
%r = fpext float %v to double
|
||||
ret double %r
|
||||
}
|
||||
|
||||
define half @conv_d_h(double %v) {
|
||||
; CHECK-LABEL: conv_d_h:
|
||||
; CHECK: ; %bb.0:
|
||||
; CHECK-NEXT: fcvt h0, d0
|
||||
; CHECK-NEXT: ret
|
||||
%r = fptrunc double %v to half
|
||||
ret half %r
|
||||
}
|
||||
|
||||
define float @conv_d_f(double %v) {
|
||||
; CHECK-LABEL: conv_d_f:
|
||||
; CHECK: ; %bb.0:
|
||||
; CHECK-NEXT: fcvt s0, d0
|
||||
; CHECK-NEXT: ret
|
||||
%r = fptrunc double %v to float
|
||||
ret float %r
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue