• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1; RUN: llc < %s -march=r600 -mcpu=redwood | FileCheck %s
2
3; CHECK: @fp_to_sint
4; CHECK: FLT_TO_INT T{{[0-9]+\.[XYZW], T[0-9]+\.[XYZW]}}
5; CHECK: FLT_TO_INT T{{[0-9]+\.[XYZW], T[0-9]+\.[XYZW]}}
6; CHECK: FLT_TO_INT T{{[0-9]+\.[XYZW], T[0-9]+\.[XYZW]}}
7; CHECK: FLT_TO_INT T{{[0-9]+\.[XYZW], T[0-9]+\.[XYZW]}}
8
9define void @fp_to_sint(<4 x i32> addrspace(1)* %out, <4 x float> addrspace(1)* %in) {
10  %value = load <4 x float> addrspace(1) * %in
11  %result = fptosi <4 x float> %value to <4 x i32>
12  store <4 x i32> %result, <4 x i32> addrspace(1)* %out
13  ret void
14}
15
16; CHECK: @fp_to_uint
17; CHECK: FLT_TO_UINT T{{[0-9]+\.[XYZW], T[0-9]+\.[XYZW]}}
18; CHECK: FLT_TO_UINT T{{[0-9]+\.[XYZW], T[0-9]+\.[XYZW]}}
19; CHECK: FLT_TO_UINT T{{[0-9]+\.[XYZW], T[0-9]+\.[XYZW]}}
20; CHECK: FLT_TO_UINT T{{[0-9]+\.[XYZW], T[0-9]+\.[XYZW]}}
21
22define void @fp_to_uint(<4 x i32> addrspace(1)* %out, <4 x float> addrspace(1)* %in) {
23  %value = load <4 x float> addrspace(1) * %in
24  %result = fptoui <4 x float> %value to <4 x i32>
25  store <4 x i32> %result, <4 x i32> addrspace(1)* %out
26  ret void
27}
28
29; CHECK: @sint_to_fp
30; CHECK: INT_TO_FLT T{{[0-9]+\.[XYZW], T[0-9]+\.[XYZW]}}
31; CHECK: INT_TO_FLT T{{[0-9]+\.[XYZW], T[0-9]+\.[XYZW]}}
32; CHECK: INT_TO_FLT T{{[0-9]+\.[XYZW], T[0-9]+\.[XYZW]}}
33; CHECK: INT_TO_FLT T{{[0-9]+\.[XYZW], T[0-9]+\.[XYZW]}}
34
35define void @sint_to_fp(<4 x float> addrspace(1)* %out, <4 x i32> addrspace(1)* %in) {
36  %value = load <4 x i32> addrspace(1) * %in
37  %result = sitofp <4 x i32> %value to <4 x float>
38  store <4 x float> %result, <4 x float> addrspace(1)* %out
39  ret void
40}
41
42; CHECK: @uint_to_fp
43; CHECK: UINT_TO_FLT T{{[0-9]+\.[XYZW], T[0-9]+\.[XYZW]}}
44; CHECK: UINT_TO_FLT T{{[0-9]+\.[XYZW], T[0-9]+\.[XYZW]}}
45; CHECK: UINT_TO_FLT T{{[0-9]+\.[XYZW], T[0-9]+\.[XYZW]}}
46; CHECK: UINT_TO_FLT T{{[0-9]+\.[XYZW], T[0-9]+\.[XYZW]}}
47
48define void @uint_to_fp(<4 x float> addrspace(1)* %out, <4 x i32> addrspace(1)* %in) {
49  %value = load <4 x i32> addrspace(1) * %in
50  %result = uitofp <4 x i32> %value to <4 x float>
51  store <4 x float> %result, <4 x float> addrspace(1)* %out
52  ret void
53}
54