blob: 496cf07e7ca87d436ed1c959f6010fbab131f58e [file] [log] [blame]
Matt Arsenaulta90d22f2014-04-17 17:06:37 +00001; RUN: llc -march=r600 -mcpu=redwood < %s | FileCheck %s -check-prefix=R600 -check-prefix=FUNC
Tom Stellard49f8bfd2015-01-06 18:00:21 +00002; RUN: llc -march=amdgcn -mcpu=SI -verify-machineinstrs < %s | FileCheck -check-prefix=SI -check-prefix=FUNC %s
Tom Stellardb249b752013-08-16 23:51:33 +00003
Tom Stellard79243d92014-10-01 17:15:17 +00004; FUNC-LABEL: {{^}}rint_f32:
Matt Arsenaulta90d22f2014-04-17 17:06:37 +00005; R600: RNDNE
6
Tom Stellard326d6ec2014-11-05 14:50:53 +00007; SI: v_rndne_f32_e32
Matt Arsenault5d47d4a2014-06-12 21:15:44 +00008define void @rint_f32(float addrspace(1)* %out, float %in) {
Tom Stellardb249b752013-08-16 23:51:33 +00009entry:
Matt Arsenault5d47d4a2014-06-12 21:15:44 +000010 %0 = call float @llvm.rint.f32(float %in) #0
Tom Stellardb249b752013-08-16 23:51:33 +000011 store float %0, float addrspace(1)* %out
12 ret void
13}
14
Tom Stellard79243d92014-10-01 17:15:17 +000015; FUNC-LABEL: {{^}}rint_v2f32:
Matt Arsenaulta90d22f2014-04-17 17:06:37 +000016; R600: RNDNE
17; R600: RNDNE
18
Tom Stellard326d6ec2014-11-05 14:50:53 +000019; SI: v_rndne_f32_e32
20; SI: v_rndne_f32_e32
Matt Arsenault5d47d4a2014-06-12 21:15:44 +000021define void @rint_v2f32(<2 x float> addrspace(1)* %out, <2 x float> %in) {
Tom Stellardb249b752013-08-16 23:51:33 +000022entry:
Matt Arsenault5d47d4a2014-06-12 21:15:44 +000023 %0 = call <2 x float> @llvm.rint.v2f32(<2 x float> %in) #0
Tom Stellardb249b752013-08-16 23:51:33 +000024 store <2 x float> %0, <2 x float> addrspace(1)* %out
25 ret void
26}
27
Tom Stellard79243d92014-10-01 17:15:17 +000028; FUNC-LABEL: {{^}}rint_v4f32:
Matt Arsenaulta90d22f2014-04-17 17:06:37 +000029; R600: RNDNE
30; R600: RNDNE
31; R600: RNDNE
32; R600: RNDNE
33
Tom Stellard326d6ec2014-11-05 14:50:53 +000034; SI: v_rndne_f32_e32
35; SI: v_rndne_f32_e32
36; SI: v_rndne_f32_e32
37; SI: v_rndne_f32_e32
Matt Arsenault5d47d4a2014-06-12 21:15:44 +000038define void @rint_v4f32(<4 x float> addrspace(1)* %out, <4 x float> %in) {
Tom Stellardb249b752013-08-16 23:51:33 +000039entry:
Matt Arsenault5d47d4a2014-06-12 21:15:44 +000040 %0 = call <4 x float> @llvm.rint.v4f32(<4 x float> %in) #0
Tom Stellardb249b752013-08-16 23:51:33 +000041 store <4 x float> %0, <4 x float> addrspace(1)* %out
42 ret void
43}
44
Tom Stellard79243d92014-10-01 17:15:17 +000045; FUNC-LABEL: {{^}}legacy_amdil_round_nearest_f32:
Matt Arsenault5d47d4a2014-06-12 21:15:44 +000046; R600: RNDNE
47
Tom Stellard326d6ec2014-11-05 14:50:53 +000048; SI: v_rndne_f32_e32
Matt Arsenault5d47d4a2014-06-12 21:15:44 +000049define void @legacy_amdil_round_nearest_f32(float addrspace(1)* %out, float %in) {
50entry:
51 %0 = call float @llvm.AMDIL.round.nearest.f32(float %in) #0
52 store float %0, float addrspace(1)* %out
53 ret void
54}
55
56declare float @llvm.AMDIL.round.nearest.f32(float) #0
Tom Stellardb249b752013-08-16 23:51:33 +000057declare float @llvm.rint.f32(float) #0
Tom Stellardb249b752013-08-16 23:51:33 +000058declare <2 x float> @llvm.rint.v2f32(<2 x float>) #0
Tom Stellardb249b752013-08-16 23:51:33 +000059declare <4 x float> @llvm.rint.v4f32(<4 x float>) #0
60
Matt Arsenault5d47d4a2014-06-12 21:15:44 +000061attributes #0 = { nounwind readnone }