source: icGREP/icgrep-devel/llvm-3.6.1.src/test/CodeGen/R600/frem.ll @ 4664

Last change on this file since 4664 was 4664, checked in by cameron, 4 years ago

Upgrade LLVM to 3.6.1

File size: 4.0 KB
Line 
1; RUN: llc -march=amdgcn -mcpu=SI -enable-misched < %s | FileCheck -check-prefix=SI -check-prefix=FUNC %s
2
3; FUNC-LABEL: {{^}}frem_f32:
4; SI-DAG: buffer_load_dword [[X:v[0-9]+]], {{.*$}}
5; SI-DAG: buffer_load_dword [[Y:v[0-9]+]], {{.*}} offset:16
6; SI-DAG: v_cmp
7; SI-DAG: v_mul_f32
8; SI: v_rcp_f32_e32
9; SI: v_mul_f32_e32
10; SI: v_mul_f32_e32
11; SI: v_trunc_f32_e32
12; SI: v_mad_f32
13; SI: s_endpgm
14define void @frem_f32(float addrspace(1)* %out, float addrspace(1)* %in1,
15                      float addrspace(1)* %in2) #0 {
16   %gep2 = getelementptr float addrspace(1)* %in2, i32 4
17   %r0 = load float addrspace(1)* %in1, align 4
18   %r1 = load float addrspace(1)* %gep2, align 4
19   %r2 = frem float %r0, %r1
20   store float %r2, float addrspace(1)* %out, align 4
21   ret void
22}
23
24; FUNC-LABEL: {{^}}unsafe_frem_f32:
25; SI: buffer_load_dword [[Y:v[0-9]+]], {{.*}} offset:16
26; SI: buffer_load_dword [[X:v[0-9]+]], {{.*}}
27; SI: v_rcp_f32_e32 [[INVY:v[0-9]+]], [[Y]]
28; SI: v_mul_f32_e32 [[DIV:v[0-9]+]], [[INVY]], [[X]]
29; SI: v_trunc_f32_e32 [[TRUNC:v[0-9]+]], [[DIV]]
30; SI: v_mad_f32 [[RESULT:v[0-9]+]], -[[TRUNC]], [[Y]], [[X]]
31; SI: buffer_store_dword [[RESULT]]
32; SI: s_endpgm
33define void @unsafe_frem_f32(float addrspace(1)* %out, float addrspace(1)* %in1,
34                             float addrspace(1)* %in2) #1 {
35   %gep2 = getelementptr float addrspace(1)* %in2, i32 4
36   %r0 = load float addrspace(1)* %in1, align 4
37   %r1 = load float addrspace(1)* %gep2, align 4
38   %r2 = frem float %r0, %r1
39   store float %r2, float addrspace(1)* %out, align 4
40   ret void
41}
42
43; FUNC-LABEL: {{^}}frem_f64:
44; SI: buffer_load_dwordx2 [[Y:v\[[0-9]+:[0-9]+\]]], {{.*}}, 0
45; SI: buffer_load_dwordx2 [[X:v\[[0-9]+:[0-9]+\]]], {{.*}}, 0
46; SI-DAG: v_div_fmas_f64
47; SI-DAG: v_div_scale_f64
48; SI-DAG: v_mul_f64
49; SI: v_add_f64
50; SI: buffer_store_dwordx2
51; SI: s_endpgm
52define void @frem_f64(double addrspace(1)* %out, double addrspace(1)* %in1,
53                      double addrspace(1)* %in2) #0 {
54   %r0 = load double addrspace(1)* %in1, align 8
55   %r1 = load double addrspace(1)* %in2, align 8
56   %r2 = frem double %r0, %r1
57   store double %r2, double addrspace(1)* %out, align 8
58   ret void
59}
60
61; FUNC-LABEL: {{^}}unsafe_frem_f64:
62; SI: v_rcp_f64_e32
63; SI: v_mul_f64
64; SI: v_bfe_u32
65; SI: v_fma_f64
66; SI: s_endpgm
67define void @unsafe_frem_f64(double addrspace(1)* %out, double addrspace(1)* %in1,
68                             double addrspace(1)* %in2) #1 {
69   %r0 = load double addrspace(1)* %in1, align 8
70   %r1 = load double addrspace(1)* %in2, align 8
71   %r2 = frem double %r0, %r1
72   store double %r2, double addrspace(1)* %out, align 8
73   ret void
74}
75
76define void @frem_v2f32(<2 x float> addrspace(1)* %out, <2 x float> addrspace(1)* %in1,
77                        <2 x float> addrspace(1)* %in2) #0 {
78   %gep2 = getelementptr <2 x float> addrspace(1)* %in2, i32 4
79   %r0 = load <2 x float> addrspace(1)* %in1, align 8
80   %r1 = load <2 x float> addrspace(1)* %gep2, align 8
81   %r2 = frem <2 x float> %r0, %r1
82   store <2 x float> %r2, <2 x float> addrspace(1)* %out, align 8
83   ret void
84}
85
86define void @frem_v4f32(<4 x float> addrspace(1)* %out, <4 x float> addrspace(1)* %in1,
87                        <4 x float> addrspace(1)* %in2) #0 {
88   %gep2 = getelementptr <4 x float> addrspace(1)* %in2, i32 4
89   %r0 = load <4 x float> addrspace(1)* %in1, align 16
90   %r1 = load <4 x float> addrspace(1)* %gep2, align 16
91   %r2 = frem <4 x float> %r0, %r1
92   store <4 x float> %r2, <4 x float> addrspace(1)* %out, align 16
93   ret void
94}
95
96define void @frem_v2f64(<2 x double> addrspace(1)* %out, <2 x double> addrspace(1)* %in1,
97                        <2 x double> addrspace(1)* %in2) #0 {
98   %gep2 = getelementptr <2 x double> addrspace(1)* %in2, i32 4
99   %r0 = load <2 x double> addrspace(1)* %in1, align 16
100   %r1 = load <2 x double> addrspace(1)* %gep2, align 16
101   %r2 = frem <2 x double> %r0, %r1
102   store <2 x double> %r2, <2 x double> addrspace(1)* %out, align 16
103   ret void
104}
105
106attributes #0 = { nounwind "unsafe-fp-math"="false" }
107attributes #1 = { nounwind "unsafe-fp-math"="true" }
Note: See TracBrowser for help on using the repository browser.