blob: c459a6a63eb66ace7847e7cc825e152f5bea978f [file] [log] [blame]
Matt Arsenaultbecd6562014-12-03 05:22:35 +00001; RUN: llc -march=r600 -mcpu=bonaire -verify-machineinstrs < %s | FileCheck -check-prefix=CI -check-prefix=FUNC %s
2; RUN: llc -march=r600 -mcpu=SI -verify-machineinstrs < %s | FileCheck -check-prefix=SI -check-prefix=FUNC %s
Jan Vesely85f0dbc2014-06-18 17:57:29 +00003
4declare double @llvm.ceil.f64(double) nounwind readnone
5declare <2 x double> @llvm.ceil.v2f64(<2 x double>) nounwind readnone
6declare <3 x double> @llvm.ceil.v3f64(<3 x double>) nounwind readnone
7declare <4 x double> @llvm.ceil.v4f64(<4 x double>) nounwind readnone
8declare <8 x double> @llvm.ceil.v8f64(<8 x double>) nounwind readnone
9declare <16 x double> @llvm.ceil.v16f64(<16 x double>) nounwind readnone
10
Tom Stellard79243d92014-10-01 17:15:17 +000011; FUNC-LABEL: {{^}}fceil_f64:
Tom Stellard326d6ec2014-11-05 14:50:53 +000012; CI: v_ceil_f64_e32
13; SI: s_bfe_u32 [[SEXP:s[0-9]+]], {{s[0-9]+}}, 0xb0014
14; SI: s_add_i32 s{{[0-9]+}}, [[SEXP]], 0xfffffc01
15; SI: s_lshr_b64
16; SI: s_not_b64
17; SI: s_and_b64
18; SI-DAG: s_and_b32 s{{[0-9]+}}, s{{[0-9]+}}, 0x80000000
19; SI-DAG: cmp_lt_i32
20; SI: cndmask_b32
21; SI: cndmask_b32
22; SI: cmp_gt_i32
23; SI: cndmask_b32
24; SI: cndmask_b32
Matt Arsenaultbecd6562014-12-03 05:22:35 +000025; SI: v_cmp_o_f64
26; SI: v_cmp_neq_f64
27; SI: s_and_b64
28; SI: v_cmp_gt_f64
29; SI: s_and_b64
30; SI: v_cndmask_b32
31; SI: v_cndmask_b32
Tom Stellard326d6ec2014-11-05 14:50:53 +000032; SI: v_add_f64
Matt Arsenaultbecd6562014-12-03 05:22:35 +000033; SI: s_endpgm
Jan Vesely85f0dbc2014-06-18 17:57:29 +000034define void @fceil_f64(double addrspace(1)* %out, double %x) {
35 %y = call double @llvm.ceil.f64(double %x) nounwind readnone
36 store double %y, double addrspace(1)* %out
37 ret void
38}
39
Tom Stellard79243d92014-10-01 17:15:17 +000040; FUNC-LABEL: {{^}}fceil_v2f64:
Tom Stellard326d6ec2014-11-05 14:50:53 +000041; CI: v_ceil_f64_e32
42; CI: v_ceil_f64_e32
Jan Vesely85f0dbc2014-06-18 17:57:29 +000043define void @fceil_v2f64(<2 x double> addrspace(1)* %out, <2 x double> %x) {
44 %y = call <2 x double> @llvm.ceil.v2f64(<2 x double> %x) nounwind readnone
45 store <2 x double> %y, <2 x double> addrspace(1)* %out
46 ret void
47}
48
Tom Stellard79243d92014-10-01 17:15:17 +000049; FIXME-FUNC-LABEL: {{^}}fceil_v3f64:
Tom Stellard326d6ec2014-11-05 14:50:53 +000050; FIXME-CI: v_ceil_f64_e32
51; FIXME-CI: v_ceil_f64_e32
52; FIXME-CI: v_ceil_f64_e32
Jan Vesely85f0dbc2014-06-18 17:57:29 +000053; define void @fceil_v3f64(<3 x double> addrspace(1)* %out, <3 x double> %x) {
54; %y = call <3 x double> @llvm.ceil.v3f64(<3 x double> %x) nounwind readnone
55; store <3 x double> %y, <3 x double> addrspace(1)* %out
56; ret void
57; }
58
Tom Stellard79243d92014-10-01 17:15:17 +000059; FUNC-LABEL: {{^}}fceil_v4f64:
Tom Stellard326d6ec2014-11-05 14:50:53 +000060; CI: v_ceil_f64_e32
61; CI: v_ceil_f64_e32
62; CI: v_ceil_f64_e32
63; CI: v_ceil_f64_e32
Jan Vesely85f0dbc2014-06-18 17:57:29 +000064define void @fceil_v4f64(<4 x double> addrspace(1)* %out, <4 x double> %x) {
65 %y = call <4 x double> @llvm.ceil.v4f64(<4 x double> %x) nounwind readnone
66 store <4 x double> %y, <4 x double> addrspace(1)* %out
67 ret void
68}
69
Tom Stellard79243d92014-10-01 17:15:17 +000070; FUNC-LABEL: {{^}}fceil_v8f64:
Tom Stellard326d6ec2014-11-05 14:50:53 +000071; CI: v_ceil_f64_e32
72; CI: v_ceil_f64_e32
73; CI: v_ceil_f64_e32
74; CI: v_ceil_f64_e32
75; CI: v_ceil_f64_e32
76; CI: v_ceil_f64_e32
77; CI: v_ceil_f64_e32
78; CI: v_ceil_f64_e32
Jan Vesely85f0dbc2014-06-18 17:57:29 +000079define void @fceil_v8f64(<8 x double> addrspace(1)* %out, <8 x double> %x) {
80 %y = call <8 x double> @llvm.ceil.v8f64(<8 x double> %x) nounwind readnone
81 store <8 x double> %y, <8 x double> addrspace(1)* %out
82 ret void
83}
84
Tom Stellard79243d92014-10-01 17:15:17 +000085; FUNC-LABEL: {{^}}fceil_v16f64:
Tom Stellard326d6ec2014-11-05 14:50:53 +000086; CI: v_ceil_f64_e32
87; CI: v_ceil_f64_e32
88; CI: v_ceil_f64_e32
89; CI: v_ceil_f64_e32
90; CI: v_ceil_f64_e32
91; CI: v_ceil_f64_e32
92; CI: v_ceil_f64_e32
93; CI: v_ceil_f64_e32
94; CI: v_ceil_f64_e32
95; CI: v_ceil_f64_e32
96; CI: v_ceil_f64_e32
97; CI: v_ceil_f64_e32
98; CI: v_ceil_f64_e32
99; CI: v_ceil_f64_e32
100; CI: v_ceil_f64_e32
101; CI: v_ceil_f64_e32
Jan Vesely85f0dbc2014-06-18 17:57:29 +0000102define void @fceil_v16f64(<16 x double> addrspace(1)* %out, <16 x double> %x) {
103 %y = call <16 x double> @llvm.ceil.v16f64(<16 x double> %x) nounwind readnone
104 store <16 x double> %y, <16 x double> addrspace(1)* %out
105 ret void
106}