blob: 2c926341f78a012ece8d1a55128454b58f96d4e1 [file] [log] [blame]
Tom Stellard49f8bfd2015-01-06 18:00:21 +00001; RUN: llc -march=amdgcn -mcpu=bonaire -verify-machineinstrs < %s | FileCheck -check-prefix=CI -check-prefix=FUNC %s
2; RUN: llc -march=amdgcn -mcpu=SI -verify-machineinstrs < %s | FileCheck -check-prefix=SI -check-prefix=FUNC %s
Matt Arsenaulta90d22f2014-04-17 17:06:37 +00003
Tom Stellard79243d92014-10-01 17:15:17 +00004; FUNC-LABEL: {{^}}rint_f64:
Tom Stellard326d6ec2014-11-05 14:50:53 +00005; CI: v_rndne_f64_e32
Matt Arsenaulte8208ec2014-06-18 17:05:26 +00006
Tom Stellard326d6ec2014-11-05 14:50:53 +00007; SI-DAG: v_add_f64
8; SI-DAG: v_add_f64
9; SI-DAG v_cmp_gt_f64_e64
10; SI: v_cndmask_b32
11; SI: v_cndmask_b32
12; SI: s_endpgm
Matt Arsenaulte8208ec2014-06-18 17:05:26 +000013define void @rint_f64(double addrspace(1)* %out, double %in) {
Matt Arsenaulta90d22f2014-04-17 17:06:37 +000014entry:
15 %0 = call double @llvm.rint.f64(double %in)
16 store double %0, double addrspace(1)* %out
17 ret void
18}
19
Tom Stellard79243d92014-10-01 17:15:17 +000020; FUNC-LABEL: {{^}}rint_v2f64:
Tom Stellard326d6ec2014-11-05 14:50:53 +000021; CI: v_rndne_f64_e32
22; CI: v_rndne_f64_e32
Matt Arsenaulte8208ec2014-06-18 17:05:26 +000023define void @rint_v2f64(<2 x double> addrspace(1)* %out, <2 x double> %in) {
Matt Arsenaulta90d22f2014-04-17 17:06:37 +000024entry:
25 %0 = call <2 x double> @llvm.rint.v2f64(<2 x double> %in)
26 store <2 x double> %0, <2 x double> addrspace(1)* %out
27 ret void
28}
29
Tom Stellard79243d92014-10-01 17:15:17 +000030; FUNC-LABEL: {{^}}rint_v4f64:
Tom Stellard326d6ec2014-11-05 14:50:53 +000031; CI: v_rndne_f64_e32
32; CI: v_rndne_f64_e32
33; CI: v_rndne_f64_e32
34; CI: v_rndne_f64_e32
Matt Arsenaulte8208ec2014-06-18 17:05:26 +000035define void @rint_v4f64(<4 x double> addrspace(1)* %out, <4 x double> %in) {
Matt Arsenaulta90d22f2014-04-17 17:06:37 +000036entry:
37 %0 = call <4 x double> @llvm.rint.v4f64(<4 x double> %in)
38 store <4 x double> %0, <4 x double> addrspace(1)* %out
39 ret void
40}
41
42
43declare double @llvm.rint.f64(double) #0
44declare <2 x double> @llvm.rint.v2f64(<2 x double>) #0
45declare <4 x double> @llvm.rint.v4f64(<4 x double>) #0