blob: 4056bc39448d5f5cae79b5080542ee03886939b8 [file] [log] [blame]
Matt Arsenault6689abe2016-05-05 20:07:37 +00001; RUN: llc -march=amdgcn -verify-machineinstrs < %s | FileCheck -check-prefix=SI -check-prefix=FUNC %s
Marek Olsak75170772015-01-27 17:27:15 +00002; RUN: llc -march=amdgcn -mcpu=tonga -verify-machineinstrs < %s | FileCheck -check-prefix=SI -check-prefix=FUNC %s
Matt Arsenault6689abe2016-05-05 20:07:37 +00003; RUN: llc -march=r600 -mcpu=redwood < %s | FileCheck %s -check-prefix=R600 -check-prefix=FUNC
Tom Stellardb249b752013-08-16 23:51:33 +00004
Tom Stellard79243d92014-10-01 17:15:17 +00005; FUNC-LABEL: {{^}}rint_f32:
Matt Arsenaulta90d22f2014-04-17 17:06:37 +00006; R600: RNDNE
7
Tom Stellard326d6ec2014-11-05 14:50:53 +00008; SI: v_rndne_f32_e32
Matt Arsenault3dbeefa2017-03-21 21:39:51 +00009define amdgpu_kernel void @rint_f32(float addrspace(1)* %out, float %in) {
Tom Stellardb249b752013-08-16 23:51:33 +000010entry:
Matt Arsenault5d47d4a2014-06-12 21:15:44 +000011 %0 = call float @llvm.rint.f32(float %in) #0
Tom Stellardb249b752013-08-16 23:51:33 +000012 store float %0, float addrspace(1)* %out
13 ret void
14}
15
Tom Stellard79243d92014-10-01 17:15:17 +000016; FUNC-LABEL: {{^}}rint_v2f32:
Matt Arsenaulta90d22f2014-04-17 17:06:37 +000017; R600: RNDNE
18; R600: RNDNE
19
Tom Stellard326d6ec2014-11-05 14:50:53 +000020; SI: v_rndne_f32_e32
21; SI: v_rndne_f32_e32
Matt Arsenault3dbeefa2017-03-21 21:39:51 +000022define amdgpu_kernel void @rint_v2f32(<2 x float> addrspace(1)* %out, <2 x float> %in) {
Tom Stellardb249b752013-08-16 23:51:33 +000023entry:
Matt Arsenault5d47d4a2014-06-12 21:15:44 +000024 %0 = call <2 x float> @llvm.rint.v2f32(<2 x float> %in) #0
Tom Stellardb249b752013-08-16 23:51:33 +000025 store <2 x float> %0, <2 x float> addrspace(1)* %out
26 ret void
27}
28
Tom Stellard79243d92014-10-01 17:15:17 +000029; FUNC-LABEL: {{^}}rint_v4f32:
Matt Arsenaulta90d22f2014-04-17 17:06:37 +000030; R600: RNDNE
31; R600: RNDNE
32; R600: RNDNE
33; R600: RNDNE
34
Tom Stellard326d6ec2014-11-05 14:50:53 +000035; SI: v_rndne_f32_e32
36; SI: v_rndne_f32_e32
37; SI: v_rndne_f32_e32
38; SI: v_rndne_f32_e32
Matt Arsenault3dbeefa2017-03-21 21:39:51 +000039define amdgpu_kernel void @rint_v4f32(<4 x float> addrspace(1)* %out, <4 x float> %in) {
Tom Stellardb249b752013-08-16 23:51:33 +000040entry:
Matt Arsenault5d47d4a2014-06-12 21:15:44 +000041 %0 = call <4 x float> @llvm.rint.v4f32(<4 x float> %in) #0
Tom Stellardb249b752013-08-16 23:51:33 +000042 store <4 x float> %0, <4 x float> addrspace(1)* %out
43 ret void
44}
45
Tom Stellardb249b752013-08-16 23:51:33 +000046declare float @llvm.rint.f32(float) #0
Tom Stellardb249b752013-08-16 23:51:33 +000047declare <2 x float> @llvm.rint.v2f32(<2 x float>) #0
Tom Stellardb249b752013-08-16 23:51:33 +000048declare <4 x float> @llvm.rint.v4f32(<4 x float>) #0
49
Matt Arsenault5d47d4a2014-06-12 21:15:44 +000050attributes #0 = { nounwind readnone }