comparison test/CodeGen/R600/ffloor.ll @ 83:60c9769439b8

LLVM 3.7
author Tatsuki IHA <e125716@ie.u-ryukyu.ac.jp>
date Wed, 18 Feb 2015 14:55:36 +0900
parents 54457678186b
children
comparison
equal deleted inserted replaced
78:af83660cff7b 83:60c9769439b8
1 ; RUN: llc -march=r600 -mcpu=bonaire < %s | FileCheck -check-prefix=CI -check-prefix=FUNC %s 1 ; RUN: llc -march=amdgcn -mcpu=SI -verify-machineinstrs < %s | FileCheck -check-prefix=SI -check-prefix=FUNC %s
2 ; RUN: llc -march=r600 -mcpu=SI < %s | FileCheck -check-prefix=SI -check-prefix=FUNC %s 2 ; RUN: llc -march=amdgcn -mcpu=tonga -verify-machineinstrs < %s | FileCheck -check-prefix=SI -check-prefix=FUNC %s
3 ; RUN: llc -march=r600 -mcpu=redwood < %s | FileCheck -check-prefix=R600 -check-prefix=FUNC %s
3 4
4 declare double @llvm.floor.f64(double) nounwind readnone 5 ; FUNC-LABEL: {{^}}floor_f32:
5 declare <2 x double> @llvm.floor.v2f64(<2 x double>) nounwind readnone 6 ; SI: v_floor_f32_e32
6 declare <3 x double> @llvm.floor.v3f64(<3 x double>) nounwind readnone 7 ; R600: FLOOR
7 declare <4 x double> @llvm.floor.v4f64(<4 x double>) nounwind readnone 8 define void @floor_f32(float addrspace(1)* %out, float %in) {
8 declare <8 x double> @llvm.floor.v8f64(<8 x double>) nounwind readnone 9 %tmp = call float @llvm.floor.f32(float %in) #0
9 declare <16 x double> @llvm.floor.v16f64(<16 x double>) nounwind readnone 10 store float %tmp, float addrspace(1)* %out
10
11 ; FUNC-LABEL: @ffloor_f64:
12 ; CI: V_FLOOR_F64_e32
13
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
19 ; SI-DAG: S_AND_B32 s{{[0-9]+}}, s{{[0-9]+}}, 0x80000000
20 ; SI-DAG: CMP_LT_I32
21 ; 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
32 define 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 11 ret void
36 } 12 }
37 13
38 ; FUNC-LABEL: @ffloor_v2f64: 14 ; FUNC-LABEL: {{^}}floor_v2f32:
39 ; CI: V_FLOOR_F64_e32 15 ; SI: v_floor_f32_e32
40 ; CI: V_FLOOR_F64_e32 16 ; SI: v_floor_f32_e32
41 define void @ffloor_v2f64(<2 x double> addrspace(1)* %out, <2 x double> %x) { 17
42 %y = call <2 x double> @llvm.floor.v2f64(<2 x double> %x) nounwind readnone 18 define void @floor_v2f32(<2 x float> addrspace(1)* %out, <2 x float> %in) {
43 store <2 x double> %y, <2 x double> addrspace(1)* %out 19 %tmp = call <2 x float> @llvm.floor.v2f32(<2 x float> %in) #0
20 store <2 x float> %tmp, <2 x float> addrspace(1)* %out
44 ret void 21 ret void
45 } 22 }
46 23
47 ; FIXME-FUNC-LABEL: @ffloor_v3f64: 24 ; FUNC-LABEL: {{^}}floor_v4f32:
48 ; FIXME-CI: V_FLOOR_F64_e32 25 ; SI: v_floor_f32_e32
49 ; FIXME-CI: V_FLOOR_F64_e32 26 ; SI: v_floor_f32_e32
50 ; FIXME-CI: V_FLOOR_F64_e32 27 ; SI: v_floor_f32_e32
51 ; define void @ffloor_v3f64(<3 x double> addrspace(1)* %out, <3 x double> %x) { 28 ; SI: v_floor_f32_e32
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 29
57 ; FUNC-LABEL: @ffloor_v4f64: 30 ; R600: FLOOR
58 ; CI: V_FLOOR_F64_e32 31 ; R600: FLOOR
59 ; CI: V_FLOOR_F64_e32 32 ; R600: FLOOR
60 ; CI: V_FLOOR_F64_e32 33 ; R600: FLOOR
61 ; CI: V_FLOOR_F64_e32 34 define void @floor_v4f32(<4 x float> addrspace(1)* %out, <4 x float> %in) {
62 define void @ffloor_v4f64(<4 x double> addrspace(1)* %out, <4 x double> %x) { 35 %tmp = call <4 x float> @llvm.floor.v4f32(<4 x float> %in) #0
63 %y = call <4 x double> @llvm.floor.v4f64(<4 x double> %x) nounwind readnone 36 store <4 x float> %tmp, <4 x float> addrspace(1)* %out
64 store <4 x double> %y, <4 x double> addrspace(1)* %out
65 ret void 37 ret void
66 } 38 }
67 39
68 ; FUNC-LABEL: @ffloor_v8f64: 40 ; Function Attrs: nounwind readonly
69 ; CI: V_FLOOR_F64_e32 41 declare float @llvm.floor.f32(float) #0
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
77 define 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 42
83 ; FUNC-LABEL: @ffloor_v16f64: 43 ; Function Attrs: nounwind readonly
84 ; CI: V_FLOOR_F64_e32 44 declare <2 x float> @llvm.floor.v2f32(<2 x float>) #0
85 ; CI: V_FLOOR_F64_e32 45
86 ; CI: V_FLOOR_F64_e32 46 ; Function Attrs: nounwind readonly
87 ; CI: V_FLOOR_F64_e32 47 declare <4 x float> @llvm.floor.v4f32(<4 x float>) #0
88 ; CI: V_FLOOR_F64_e32 48
89 ; CI: V_FLOOR_F64_e32 49 attributes #0 = { nounwind readnone }
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
100 define 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 }