blob: 7a4aeaa16e8f15b462514b1ec5cf685956488c42 [file] [log] [blame]
Matt Arsenault46010932014-06-18 17:05:30 +00001; RUN: llc -march=r600 -mcpu=bonaire < %s | FileCheck -check-prefix=CI -check-prefix=FUNC %s
2; RUN: llc -march=r600 -mcpu=SI < %s | FileCheck -check-prefix=SI -check-prefix=FUNC %s
Matt Arsenault41e2f2b2014-02-24 21:01:28 +00003
4declare double @llvm.floor.f64(double) nounwind readnone
5declare <2 x double> @llvm.floor.v2f64(<2 x double>) nounwind readnone
6declare <3 x double> @llvm.floor.v3f64(<3 x double>) nounwind readnone
7declare <4 x double> @llvm.floor.v4f64(<4 x double>) nounwind readnone
8declare <8 x double> @llvm.floor.v8f64(<8 x double>) nounwind readnone
9declare <16 x double> @llvm.floor.v16f64(<16 x double>) nounwind readnone
10
Tom Stellard79243d92014-10-01 17:15:17 +000011; FUNC-LABEL: {{^}}ffloor_f64:
Matt Arsenault41e2f2b2014-02-24 21:01:28 +000012; CI: V_FLOOR_F64_e32
Matt Arsenault46010932014-06-18 17:05:30 +000013
14; SI: S_BFE_I32 [[SEXP:s[0-9]+]], {{s[0-9]+}}, 0xb0014
15; SI: S_ADD_I32 s{{[0-9]+}}, [[SEXP]], 0xfffffc01
16; SI: S_LSHR_B64
17; SI: S_NOT_B64
18; SI: S_AND_B64
Matt Arsenault7b46a592014-09-06 20:44:41 +000019; SI-DAG: S_AND_B32 s{{[0-9]+}}, s{{[0-9]+}}, 0x80000000
20; SI-DAG: CMP_LT_I32
Matt Arsenault46010932014-06-18 17:05:30 +000021; SI: CNDMASK_B32
22; SI: CNDMASK_B32
23; SI: CMP_GT_I32
24; SI: CNDMASK_B32
25; SI: CNDMASK_B32
26; SI: CMP_LT_F64
27; SI: CNDMASK_B32
28; SI: CMP_NE_I32
29; SI: CNDMASK_B32
30; SI: CNDMASK_B32
31; SI: V_ADD_F64
Matt Arsenault41e2f2b2014-02-24 21:01:28 +000032define void @ffloor_f64(double addrspace(1)* %out, double %x) {
33 %y = call double @llvm.floor.f64(double %x) nounwind readnone
34 store double %y, double addrspace(1)* %out
35 ret void
36}
37
Tom Stellard79243d92014-10-01 17:15:17 +000038; FUNC-LABEL: {{^}}ffloor_v2f64:
Matt Arsenault41e2f2b2014-02-24 21:01:28 +000039; CI: V_FLOOR_F64_e32
40; CI: V_FLOOR_F64_e32
41define void @ffloor_v2f64(<2 x double> addrspace(1)* %out, <2 x double> %x) {
42 %y = call <2 x double> @llvm.floor.v2f64(<2 x double> %x) nounwind readnone
43 store <2 x double> %y, <2 x double> addrspace(1)* %out
44 ret void
45}
46
Tom Stellard79243d92014-10-01 17:15:17 +000047; FIXME-FUNC-LABEL: {{^}}ffloor_v3f64:
Matt Arsenault41e2f2b2014-02-24 21:01:28 +000048; FIXME-CI: V_FLOOR_F64_e32
49; FIXME-CI: V_FLOOR_F64_e32
50; FIXME-CI: V_FLOOR_F64_e32
51; define void @ffloor_v3f64(<3 x double> addrspace(1)* %out, <3 x double> %x) {
52; %y = call <3 x double> @llvm.floor.v3f64(<3 x double> %x) nounwind readnone
53; store <3 x double> %y, <3 x double> addrspace(1)* %out
54; ret void
55; }
56
Tom Stellard79243d92014-10-01 17:15:17 +000057; FUNC-LABEL: {{^}}ffloor_v4f64:
Matt Arsenault41e2f2b2014-02-24 21:01:28 +000058; CI: V_FLOOR_F64_e32
59; CI: V_FLOOR_F64_e32
60; CI: V_FLOOR_F64_e32
61; CI: V_FLOOR_F64_e32
62define void @ffloor_v4f64(<4 x double> addrspace(1)* %out, <4 x double> %x) {
63 %y = call <4 x double> @llvm.floor.v4f64(<4 x double> %x) nounwind readnone
64 store <4 x double> %y, <4 x double> addrspace(1)* %out
65 ret void
66}
67
Tom Stellard79243d92014-10-01 17:15:17 +000068; FUNC-LABEL: {{^}}ffloor_v8f64:
Matt Arsenault41e2f2b2014-02-24 21:01:28 +000069; CI: V_FLOOR_F64_e32
70; CI: V_FLOOR_F64_e32
71; CI: V_FLOOR_F64_e32
72; CI: V_FLOOR_F64_e32
73; CI: V_FLOOR_F64_e32
74; CI: V_FLOOR_F64_e32
75; CI: V_FLOOR_F64_e32
76; CI: V_FLOOR_F64_e32
77define void @ffloor_v8f64(<8 x double> addrspace(1)* %out, <8 x double> %x) {
78 %y = call <8 x double> @llvm.floor.v8f64(<8 x double> %x) nounwind readnone
79 store <8 x double> %y, <8 x double> addrspace(1)* %out
80 ret void
81}
82
Tom Stellard79243d92014-10-01 17:15:17 +000083; FUNC-LABEL: {{^}}ffloor_v16f64:
Matt Arsenault41e2f2b2014-02-24 21:01:28 +000084; CI: V_FLOOR_F64_e32
85; CI: V_FLOOR_F64_e32
86; CI: V_FLOOR_F64_e32
87; CI: V_FLOOR_F64_e32
88; CI: V_FLOOR_F64_e32
89; CI: V_FLOOR_F64_e32
90; CI: V_FLOOR_F64_e32
91; CI: V_FLOOR_F64_e32
92; CI: V_FLOOR_F64_e32
93; CI: V_FLOOR_F64_e32
94; CI: V_FLOOR_F64_e32
95; CI: V_FLOOR_F64_e32
96; CI: V_FLOOR_F64_e32
97; CI: V_FLOOR_F64_e32
98; CI: V_FLOOR_F64_e32
99; CI: V_FLOOR_F64_e32
100define void @ffloor_v16f64(<16 x double> addrspace(1)* %out, <16 x double> %x) {
101 %y = call <16 x double> @llvm.floor.v16f64(<16 x double> %x) nounwind readnone
102 store <16 x double> %y, <16 x double> addrspace(1)* %out
103 ret void
104}