• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1; RUN: llc < %s -march=r600 -mcpu=redwood | FileCheck %s --check-prefix=R600 --check-prefix=FUNC
2
3; FUNC-LABEL: @f32
4; R600: FRACT
5; R600-DAG: ADD
6; R600-DAG: CEIL
7; R600-DAG: FLOOR
8; R600: CNDGE
9define void @f32(float addrspace(1)* %out, float %in) {
10entry:
11  %0 = call float @llvm.round.f32(float %in)
12  store float %0, float addrspace(1)* %out
13  ret void
14}
15
16; The vector tests are really difficult to verify, since it can be hard to
17; predict how the scheduler will order the instructions.  We already have
18; a test for the scalar case, so the vector tests just check that the
19; compiler doesn't crash.
20
21; FUNC-LABEL: v2f32
22; R600: CF_END
23define void @v2f32(<2 x float> addrspace(1)* %out, <2 x float> %in) {
24entry:
25  %0 = call <2 x float> @llvm.round.v2f32(<2 x float> %in)
26  store <2 x float> %0, <2 x float> addrspace(1)* %out
27  ret void
28}
29
30; FUNC-LABEL: v4f32
31; R600: CF_END
32define void @v4f32(<4 x float> addrspace(1)* %out, <4 x float> %in) {
33entry:
34  %0 = call <4 x float> @llvm.round.v4f32(<4 x float> %in)
35  store <4 x float> %0, <4 x float> addrspace(1)* %out
36  ret void
37}
38
39declare float @llvm.round.f32(float)
40declare <2 x float> @llvm.round.v2f32(<2 x float>)
41declare <4 x float> @llvm.round.v4f32(<4 x float>)
42