xref: /aosp_15_r20/external/llvm/test/CodeGen/AMDGPU/llvm.cos.ll (revision 9880d6810fe72a1726cb53787c6711e909410d58)
1*9880d681SAndroid Build Coastguard Worker; RUN: llc < %s -march=amdgcn | FileCheck %s -check-prefix=SI -check-prefix=FUNC
2*9880d681SAndroid Build Coastguard Worker; RUN: llc < %s -march=amdgcn -mcpu=tonga | FileCheck %s -check-prefix=SI -check-prefix=FUNC
3*9880d681SAndroid Build Coastguard Worker; RUN: llc < %s -march=r600 -mcpu=redwood | FileCheck %s -check-prefix=EG -check-prefix=FUNC
4*9880d681SAndroid Build Coastguard Worker
5*9880d681SAndroid Build Coastguard Worker;FUNC-LABEL: test
6*9880d681SAndroid Build Coastguard Worker;EG: MULADD_IEEE *
7*9880d681SAndroid Build Coastguard Worker;EG: FRACT *
8*9880d681SAndroid Build Coastguard Worker;EG: ADD *
9*9880d681SAndroid Build Coastguard Worker;EG: COS * T{{[0-9]+\.[XYZW], PV\.[XYZW]}}
10*9880d681SAndroid Build Coastguard Worker;EG-NOT: COS
11*9880d681SAndroid Build Coastguard Worker;SI: v_cos_f32
12*9880d681SAndroid Build Coastguard Worker;SI-NOT: v_cos_f32
13*9880d681SAndroid Build Coastguard Worker
14*9880d681SAndroid Build Coastguard Workerdefine void @test(float addrspace(1)* %out, float %x) #1 {
15*9880d681SAndroid Build Coastguard Worker   %cos = call float @llvm.cos.f32(float %x)
16*9880d681SAndroid Build Coastguard Worker   store float %cos, float addrspace(1)* %out
17*9880d681SAndroid Build Coastguard Worker   ret void
18*9880d681SAndroid Build Coastguard Worker}
19*9880d681SAndroid Build Coastguard Worker
20*9880d681SAndroid Build Coastguard Worker;FUNC-LABEL: testv
21*9880d681SAndroid Build Coastguard Worker;EG: COS * T{{[0-9]+\.[XYZW], PV\.[XYZW]}}
22*9880d681SAndroid Build Coastguard Worker;EG: COS * T{{[0-9]+\.[XYZW], PV\.[XYZW]}}
23*9880d681SAndroid Build Coastguard Worker;EG: COS * T{{[0-9]+\.[XYZW], PV\.[XYZW]}}
24*9880d681SAndroid Build Coastguard Worker;EG: COS * T{{[0-9]+\.[XYZW], PV\.[XYZW]}}
25*9880d681SAndroid Build Coastguard Worker;EG-NOT: COS
26*9880d681SAndroid Build Coastguard Worker;SI: v_cos_f32
27*9880d681SAndroid Build Coastguard Worker;SI: v_cos_f32
28*9880d681SAndroid Build Coastguard Worker;SI: v_cos_f32
29*9880d681SAndroid Build Coastguard Worker;SI: v_cos_f32
30*9880d681SAndroid Build Coastguard Worker;SI-NOT: v_cos_f32
31*9880d681SAndroid Build Coastguard Worker
32*9880d681SAndroid Build Coastguard Workerdefine void @testv(<4 x float> addrspace(1)* %out, <4 x float> inreg %vx) #1 {
33*9880d681SAndroid Build Coastguard Worker   %cos = call <4 x float> @llvm.cos.v4f32(<4 x float> %vx)
34*9880d681SAndroid Build Coastguard Worker   store <4 x float> %cos, <4 x float> addrspace(1)* %out
35*9880d681SAndroid Build Coastguard Worker   ret void
36*9880d681SAndroid Build Coastguard Worker}
37*9880d681SAndroid Build Coastguard Worker
38*9880d681SAndroid Build Coastguard Workerdeclare float @llvm.cos.f32(float) readnone
39*9880d681SAndroid Build Coastguard Workerdeclare <4 x float> @llvm.cos.v4f32(<4 x float>) readnone
40