xref: /aosp_15_r20/external/llvm/test/CodeGen/AMDGPU/llvm.log2.ll (revision 9880d6810fe72a1726cb53787c6711e909410d58)
1*9880d681SAndroid Build Coastguard Worker;RUN: llc < %s -march=r600 -mcpu=redwood | FileCheck %s --check-prefix=EG --check-prefix=FUNC
2*9880d681SAndroid Build Coastguard Worker;RUN: llc < %s -march=r600 -mcpu=cayman | FileCheck %s --check-prefix=CM --check-prefix=FUNC
3*9880d681SAndroid Build Coastguard Worker;RUN: llc < %s -march=amdgcn -mcpu=SI | FileCheck %s --check-prefix=SI --check-prefix=FUNC
4*9880d681SAndroid Build Coastguard Worker;RUN: llc < %s -march=amdgcn -mcpu=tonga | FileCheck %s --check-prefix=SI --check-prefix=FUNC
5*9880d681SAndroid Build Coastguard Worker
6*9880d681SAndroid Build Coastguard Worker;FUNC-LABEL: {{^}}test:
7*9880d681SAndroid Build Coastguard Worker;EG: LOG_IEEE
8*9880d681SAndroid Build Coastguard Worker;CM-DAG: LOG_IEEE T{{[0-9]+\.[XYZW]}} (MASKED)
9*9880d681SAndroid Build Coastguard Worker;CM-DAG: LOG_IEEE T{{[0-9]+\.[XYZW]}} (MASKED)
10*9880d681SAndroid Build Coastguard Worker;CM-DAG: LOG_IEEE T{{[0-9]+\.[XYZW]}} (MASKED)
11*9880d681SAndroid Build Coastguard Worker;CM-DAG: LOG_IEEE T{{[0-9]+\.[XYZW]}}
12*9880d681SAndroid Build Coastguard Worker;SI: v_log_f32
13*9880d681SAndroid Build Coastguard Worker
14*9880d681SAndroid Build Coastguard Workerdefine void @test(float addrspace(1)* %out, float %in) {
15*9880d681SAndroid Build Coastguard Workerentry:
16*9880d681SAndroid Build Coastguard Worker   %0 = call float @llvm.log2.f32(float %in)
17*9880d681SAndroid Build Coastguard Worker   store float %0, float addrspace(1)* %out
18*9880d681SAndroid Build Coastguard Worker   ret void
19*9880d681SAndroid Build Coastguard Worker}
20*9880d681SAndroid Build Coastguard Worker
21*9880d681SAndroid Build Coastguard Worker;FUNC-LABEL: {{^}}testv2:
22*9880d681SAndroid Build Coastguard Worker;EG: LOG_IEEE
23*9880d681SAndroid Build Coastguard Worker;EG: LOG_IEEE
24*9880d681SAndroid Build Coastguard Worker; FIXME: We should be able to merge these packets together on Cayman so we
25*9880d681SAndroid Build Coastguard Worker; have a maximum of 4 instructions.
26*9880d681SAndroid Build Coastguard Worker;CM-DAG: LOG_IEEE T{{[0-9]+\.[XYZW]}} (MASKED)
27*9880d681SAndroid Build Coastguard Worker;CM-DAG: LOG_IEEE T{{[0-9]+\.[XYZW]}} (MASKED)
28*9880d681SAndroid Build Coastguard Worker;CM-DAG: LOG_IEEE T{{[0-9]+\.[XYZW]}} (MASKED)
29*9880d681SAndroid Build Coastguard Worker;CM-DAG: LOG_IEEE T{{[0-9]+\.[XYZW]}} (MASKED)
30*9880d681SAndroid Build Coastguard Worker;CM-DAG: LOG_IEEE T{{[0-9]+\.[XYZW]}} (MASKED)
31*9880d681SAndroid Build Coastguard Worker;CM-DAG: LOG_IEEE T{{[0-9]+\.[XYZW]}} (MASKED)
32*9880d681SAndroid Build Coastguard Worker;CM-DAG: LOG_IEEE T{{[0-9]+\.[XYZW]}}
33*9880d681SAndroid Build Coastguard Worker;CM-DAG: LOG_IEEE T{{[0-9]+\.[XYZW]}}
34*9880d681SAndroid Build Coastguard Worker;SI: v_log_f32
35*9880d681SAndroid Build Coastguard Worker;SI: v_log_f32
36*9880d681SAndroid Build Coastguard Worker
37*9880d681SAndroid Build Coastguard Workerdefine void @testv2(<2 x float> addrspace(1)* %out, <2 x float> %in) {
38*9880d681SAndroid Build Coastguard Workerentry:
39*9880d681SAndroid Build Coastguard Worker  %0 = call <2 x float> @llvm.log2.v2f32(<2 x float> %in)
40*9880d681SAndroid Build Coastguard Worker  store <2 x float> %0, <2 x float> addrspace(1)* %out
41*9880d681SAndroid Build Coastguard Worker  ret void
42*9880d681SAndroid Build Coastguard Worker}
43*9880d681SAndroid Build Coastguard Worker
44*9880d681SAndroid Build Coastguard Worker;FUNC-LABEL: {{^}}testv4:
45*9880d681SAndroid Build Coastguard Worker;EG: LOG_IEEE
46*9880d681SAndroid Build Coastguard Worker;EG: LOG_IEEE
47*9880d681SAndroid Build Coastguard Worker;EG: LOG_IEEE
48*9880d681SAndroid Build Coastguard Worker;EG: LOG_IEEE
49*9880d681SAndroid Build Coastguard Worker; FIXME: We should be able to merge these packets together on Cayman so we
50*9880d681SAndroid Build Coastguard Worker; have a maximum of 4 instructions.
51*9880d681SAndroid Build Coastguard Worker;CM-DAG: LOG_IEEE T{{[0-9]+\.[XYZW]}} (MASKED)
52*9880d681SAndroid Build Coastguard Worker;CM-DAG: LOG_IEEE T{{[0-9]+\.[XYZW]}} (MASKED)
53*9880d681SAndroid Build Coastguard Worker;CM-DAG: LOG_IEEE T{{[0-9]+\.[XYZW]}} (MASKED)
54*9880d681SAndroid Build Coastguard Worker;CM-DAG: LOG_IEEE T{{[0-9]+\.[XYZW]}} (MASKED)
55*9880d681SAndroid Build Coastguard Worker;CM-DAG: LOG_IEEE T{{[0-9]+\.[XYZW]}} (MASKED)
56*9880d681SAndroid Build Coastguard Worker;CM-DAG: LOG_IEEE T{{[0-9]+\.[XYZW]}} (MASKED)
57*9880d681SAndroid Build Coastguard Worker;CM-DAG: LOG_IEEE T{{[0-9]+\.[XYZW]}} (MASKED)
58*9880d681SAndroid Build Coastguard Worker;CM-DAG: LOG_IEEE T{{[0-9]+\.[XYZW]}} (MASKED)
59*9880d681SAndroid Build Coastguard Worker;CM-DAG: LOG_IEEE T{{[0-9]+\.[XYZW]}} (MASKED)
60*9880d681SAndroid Build Coastguard Worker;CM-DAG: LOG_IEEE T{{[0-9]+\.[XYZW]}} (MASKED)
61*9880d681SAndroid Build Coastguard Worker;CM-DAG: LOG_IEEE T{{[0-9]+\.[XYZW]}} (MASKED)
62*9880d681SAndroid Build Coastguard Worker;CM-DAG: LOG_IEEE T{{[0-9]+\.[XYZW]}} (MASKED)
63*9880d681SAndroid Build Coastguard Worker;CM-DAG: LOG_IEEE T{{[0-9]+\.[XYZW]}}
64*9880d681SAndroid Build Coastguard Worker;CM-DAG: LOG_IEEE T{{[0-9]+\.[XYZW]}}
65*9880d681SAndroid Build Coastguard Worker;CM-DAG: LOG_IEEE T{{[0-9]+\.[XYZW]}}
66*9880d681SAndroid Build Coastguard Worker;CM-DAG: LOG_IEEE T{{[0-9]+\.[XYZW]}}
67*9880d681SAndroid Build Coastguard Worker;SI: v_log_f32
68*9880d681SAndroid Build Coastguard Worker;SI: v_log_f32
69*9880d681SAndroid Build Coastguard Worker;SI: v_log_f32
70*9880d681SAndroid Build Coastguard Worker;SI: v_log_f32
71*9880d681SAndroid Build Coastguard Workerdefine void @testv4(<4 x float> addrspace(1)* %out, <4 x float> %in) {
72*9880d681SAndroid Build Coastguard Workerentry:
73*9880d681SAndroid Build Coastguard Worker  %0 = call <4 x float> @llvm.log2.v4f32(<4 x float> %in)
74*9880d681SAndroid Build Coastguard Worker  store <4 x float> %0, <4 x float> addrspace(1)* %out
75*9880d681SAndroid Build Coastguard Worker  ret void
76*9880d681SAndroid Build Coastguard Worker}
77*9880d681SAndroid Build Coastguard Worker
78*9880d681SAndroid Build Coastguard Workerdeclare float @llvm.log2.f32(float) readnone
79*9880d681SAndroid Build Coastguard Workerdeclare <2 x float> @llvm.log2.v2f32(<2 x float>) readnone
80*9880d681SAndroid Build Coastguard Workerdeclare <4 x float> @llvm.log2.v4f32(<4 x float>) readnone
81