1 ; RUN: llc -march=amdgcn -verify-machineinstrs < %s
2 ; RUN: llc -march=amdgcn -mcpu=bonaire -verify-machineinstrs < %s
3 ; RUN: llc -march=amdgcn -mcpu=tonga -mattr=-flat-for-global -verify-machineinstrs < %s
5 ; This should have the exactly the same output as the test for rint,
6 ; so no need to check anything.
8 declare float @llvm.nearbyint.f32(float) #0
9 declare <2 x float> @llvm.nearbyint.v2f32(<2 x float>) #0
10 declare <4 x float> @llvm.nearbyint.v4f32(<4 x float>) #0
11 declare double @llvm.nearbyint.f64(double) #0
12 declare <2 x double> @llvm.nearbyint.v2f64(<2 x double>) #0
13 declare <4 x double> @llvm.nearbyint.v4f64(<4 x double>) #0
16 define amdgpu_kernel void @fnearbyint_f32(float addrspace(1)* %out, float %in) #1 {
18 %0 = call float @llvm.nearbyint.f32(float %in)
19 store float %0, float addrspace(1)* %out
23 define amdgpu_kernel void @fnearbyint_v2f32(<2 x float> addrspace(1)* %out, <2 x float> %in) #1 {
25 %0 = call <2 x float> @llvm.nearbyint.v2f32(<2 x float> %in)
26 store <2 x float> %0, <2 x float> addrspace(1)* %out
30 define amdgpu_kernel void @fnearbyint_v4f32(<4 x float> addrspace(1)* %out, <4 x float> %in) #1 {
32 %0 = call <4 x float> @llvm.nearbyint.v4f32(<4 x float> %in)
33 store <4 x float> %0, <4 x float> addrspace(1)* %out
37 define amdgpu_kernel void @nearbyint_f64(double addrspace(1)* %out, double %in) {
39 %0 = call double @llvm.nearbyint.f64(double %in)
40 store double %0, double addrspace(1)* %out
43 define amdgpu_kernel void @nearbyint_v2f64(<2 x double> addrspace(1)* %out, <2 x double> %in) {
45 %0 = call <2 x double> @llvm.nearbyint.v2f64(<2 x double> %in)
46 store <2 x double> %0, <2 x double> addrspace(1)* %out
50 define amdgpu_kernel void @nearbyint_v4f64(<4 x double> addrspace(1)* %out, <4 x double> %in) {
52 %0 = call <4 x double> @llvm.nearbyint.v4f64(<4 x double> %in)
53 store <4 x double> %0, <4 x double> addrspace(1)* %out
57 attributes #0 = { nounwind readonly }
58 attributes #1 = { nounwind }