xref: /aosp_15_r20/external/llvm/test/CodeGen/AMDGPU/llvm.rint.ll (revision 9880d6810fe72a1726cb53787c6711e909410d58)
1*9880d681SAndroid Build Coastguard Worker; RUN: llc -march=amdgcn -verify-machineinstrs < %s | FileCheck -check-prefix=SI -check-prefix=FUNC %s
2*9880d681SAndroid Build Coastguard Worker; RUN: llc -march=amdgcn -mcpu=tonga -verify-machineinstrs < %s | FileCheck -check-prefix=SI -check-prefix=FUNC %s
3*9880d681SAndroid Build Coastguard Worker; RUN: llc -march=r600 -mcpu=redwood < %s | FileCheck %s -check-prefix=R600 -check-prefix=FUNC
4*9880d681SAndroid Build Coastguard Worker
5*9880d681SAndroid Build Coastguard Worker; FUNC-LABEL: {{^}}rint_f32:
6*9880d681SAndroid Build Coastguard Worker; R600: RNDNE
7*9880d681SAndroid Build Coastguard Worker
8*9880d681SAndroid Build Coastguard Worker; SI: v_rndne_f32_e32
9*9880d681SAndroid Build Coastguard Workerdefine void @rint_f32(float addrspace(1)* %out, float %in) {
10*9880d681SAndroid Build Coastguard Workerentry:
11*9880d681SAndroid Build Coastguard Worker  %0 = call float @llvm.rint.f32(float %in) #0
12*9880d681SAndroid Build Coastguard Worker  store float %0, float addrspace(1)* %out
13*9880d681SAndroid Build Coastguard Worker  ret void
14*9880d681SAndroid Build Coastguard Worker}
15*9880d681SAndroid Build Coastguard Worker
16*9880d681SAndroid Build Coastguard Worker; FUNC-LABEL: {{^}}rint_v2f32:
17*9880d681SAndroid Build Coastguard Worker; R600: RNDNE
18*9880d681SAndroid Build Coastguard Worker; R600: RNDNE
19*9880d681SAndroid Build Coastguard Worker
20*9880d681SAndroid Build Coastguard Worker; SI: v_rndne_f32_e32
21*9880d681SAndroid Build Coastguard Worker; SI: v_rndne_f32_e32
22*9880d681SAndroid Build Coastguard Workerdefine void @rint_v2f32(<2 x float> addrspace(1)* %out, <2 x float> %in) {
23*9880d681SAndroid Build Coastguard Workerentry:
24*9880d681SAndroid Build Coastguard Worker  %0 = call <2 x float> @llvm.rint.v2f32(<2 x float> %in) #0
25*9880d681SAndroid Build Coastguard Worker  store <2 x float> %0, <2 x float> addrspace(1)* %out
26*9880d681SAndroid Build Coastguard Worker  ret void
27*9880d681SAndroid Build Coastguard Worker}
28*9880d681SAndroid Build Coastguard Worker
29*9880d681SAndroid Build Coastguard Worker; FUNC-LABEL: {{^}}rint_v4f32:
30*9880d681SAndroid Build Coastguard Worker; R600: RNDNE
31*9880d681SAndroid Build Coastguard Worker; R600: RNDNE
32*9880d681SAndroid Build Coastguard Worker; R600: RNDNE
33*9880d681SAndroid Build Coastguard Worker; R600: RNDNE
34*9880d681SAndroid Build Coastguard Worker
35*9880d681SAndroid Build Coastguard Worker; SI: v_rndne_f32_e32
36*9880d681SAndroid Build Coastguard Worker; SI: v_rndne_f32_e32
37*9880d681SAndroid Build Coastguard Worker; SI: v_rndne_f32_e32
38*9880d681SAndroid Build Coastguard Worker; SI: v_rndne_f32_e32
39*9880d681SAndroid Build Coastguard Workerdefine void @rint_v4f32(<4 x float> addrspace(1)* %out, <4 x float> %in) {
40*9880d681SAndroid Build Coastguard Workerentry:
41*9880d681SAndroid Build Coastguard Worker  %0 = call <4 x float> @llvm.rint.v4f32(<4 x float> %in) #0
42*9880d681SAndroid Build Coastguard Worker  store <4 x float> %0, <4 x float> addrspace(1)* %out
43*9880d681SAndroid Build Coastguard Worker  ret void
44*9880d681SAndroid Build Coastguard Worker}
45*9880d681SAndroid Build Coastguard Worker
46*9880d681SAndroid Build Coastguard Workerdeclare float @llvm.rint.f32(float) #0
47*9880d681SAndroid Build Coastguard Workerdeclare <2 x float> @llvm.rint.v2f32(<2 x float>) #0
48*9880d681SAndroid Build Coastguard Workerdeclare <4 x float> @llvm.rint.v4f32(<4 x float>) #0
49*9880d681SAndroid Build Coastguard Worker
50*9880d681SAndroid Build Coastguard Workerattributes #0 = { nounwind readnone }
51