annotate llvm/test/CodeGen/AMDGPU/sitofp.f16.ll @ 206:f17a3b42b08b

Added tag before-12 for changeset b7591485f4cd
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Mon, 07 Jun 2021 21:25:57 +0900
parents 0572611fdcc8
children 1f2b6ac9f198
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
150
anatofuz
parents:
diff changeset
1 ; RUN: llc -amdgpu-scalarize-global-loads=false -march=amdgcn -mcpu=tahiti -verify-machineinstrs -enable-unsafe-fp-math < %s | FileCheck -check-prefix=GCN -check-prefix=SI %s
anatofuz
parents:
diff changeset
2 ; RUN: llc -amdgpu-scalarize-global-loads=false -march=amdgcn -mcpu=fiji -mattr=-flat-for-global -verify-machineinstrs -enable-unsafe-fp-math < %s | FileCheck -check-prefix=GCN -check-prefix=VI %s
anatofuz
parents:
diff changeset
3
anatofuz
parents:
diff changeset
4 ; GCN-LABEL: {{^}}sitofp_i16_to_f16
anatofuz
parents:
diff changeset
5 ; GCN: buffer_load_{{sshort|ushort}} v[[A_I16:[0-9]+]]
anatofuz
parents:
diff changeset
6
anatofuz
parents:
diff changeset
7 ; SI: v_cvt_f32_i32_e32 v[[A_F32:[0-9]+]], v[[A_I16]]
anatofuz
parents:
diff changeset
8 ; SI: v_cvt_f16_f32_e32 v[[R_F16:[0-9]+]], v[[A_F32]]
anatofuz
parents:
diff changeset
9
anatofuz
parents:
diff changeset
10 ; VI: v_cvt_f16_i16_e32 v[[R_F16:[0-9]+]], v[[A_I16]]
anatofuz
parents:
diff changeset
11
anatofuz
parents:
diff changeset
12 ; GCN: buffer_store_short v[[R_F16]]
anatofuz
parents:
diff changeset
13 ; GCN: s_endpgm
anatofuz
parents:
diff changeset
14 define amdgpu_kernel void @sitofp_i16_to_f16(
anatofuz
parents:
diff changeset
15 half addrspace(1)* %r,
anatofuz
parents:
diff changeset
16 i16 addrspace(1)* %a) {
anatofuz
parents:
diff changeset
17 entry:
anatofuz
parents:
diff changeset
18 %a.val = load i16, i16 addrspace(1)* %a
anatofuz
parents:
diff changeset
19 %r.val = sitofp i16 %a.val to half
anatofuz
parents:
diff changeset
20 store half %r.val, half addrspace(1)* %r
anatofuz
parents:
diff changeset
21 ret void
anatofuz
parents:
diff changeset
22 }
anatofuz
parents:
diff changeset
23
anatofuz
parents:
diff changeset
24 ; GCN-LABEL: {{^}}sitofp_i32_to_f16
anatofuz
parents:
diff changeset
25 ; GCN: buffer_load_dword v[[A_I32:[0-9]+]]
anatofuz
parents:
diff changeset
26 ; GCN: v_cvt_f32_i32_e32 v[[A_I16:[0-9]+]], v[[A_I32]]
anatofuz
parents:
diff changeset
27 ; GCN: v_cvt_f16_f32_e32 v[[R_F16:[0-9]+]], v[[A_I16]]
anatofuz
parents:
diff changeset
28 ; GCN: buffer_store_short v[[R_F16]]
anatofuz
parents:
diff changeset
29 ; GCN: s_endpgm
anatofuz
parents:
diff changeset
30 define amdgpu_kernel void @sitofp_i32_to_f16(
anatofuz
parents:
diff changeset
31 half addrspace(1)* %r,
anatofuz
parents:
diff changeset
32 i32 addrspace(1)* %a) {
anatofuz
parents:
diff changeset
33 entry:
anatofuz
parents:
diff changeset
34 %a.val = load i32, i32 addrspace(1)* %a
anatofuz
parents:
diff changeset
35 %r.val = sitofp i32 %a.val to half
anatofuz
parents:
diff changeset
36 store half %r.val, half addrspace(1)* %r
anatofuz
parents:
diff changeset
37 ret void
anatofuz
parents:
diff changeset
38 }
anatofuz
parents:
diff changeset
39
anatofuz
parents:
diff changeset
40 ; f16 = sitofp i64 is in sint_to_fp.i64.ll
anatofuz
parents:
diff changeset
41
anatofuz
parents:
diff changeset
42 ; GCN-LABEL: {{^}}sitofp_v2i16_to_v2f16
anatofuz
parents:
diff changeset
43 ; GCN: buffer_load_dword
anatofuz
parents:
diff changeset
44
anatofuz
parents:
diff changeset
45 ; SI: v_cvt_f32_i32_e32
anatofuz
parents:
diff changeset
46 ; SI: v_cvt_f32_i32_e32
anatofuz
parents:
diff changeset
47 ; SI: v_cvt_f16_f32_e32
anatofuz
parents:
diff changeset
48 ; SI: v_cvt_f16_f32_e32
anatofuz
parents:
diff changeset
49 ; SI-DAG: v_lshlrev_b32_e32
anatofuz
parents:
diff changeset
50 ; SI: v_or_b32_e32
anatofuz
parents:
diff changeset
51
anatofuz
parents:
diff changeset
52 ; VI-DAG: v_cvt_f16_i16_sdwa v{{[0-9]+}}, v{{[0-9]+}} dst_sel:WORD_1 dst_unused:UNUSED_PAD src0_sel:WORD_1
anatofuz
parents:
diff changeset
53 ; VI-DAG: v_cvt_f16_i16_e32
anatofuz
parents:
diff changeset
54 ; VI: v_or_b32_e32
anatofuz
parents:
diff changeset
55
anatofuz
parents:
diff changeset
56 ; GCN: buffer_store_dword
anatofuz
parents:
diff changeset
57 ; GCN: s_endpgm
anatofuz
parents:
diff changeset
58
anatofuz
parents:
diff changeset
59 define amdgpu_kernel void @sitofp_v2i16_to_v2f16(
anatofuz
parents:
diff changeset
60 <2 x half> addrspace(1)* %r,
anatofuz
parents:
diff changeset
61 <2 x i16> addrspace(1)* %a) {
anatofuz
parents:
diff changeset
62 entry:
anatofuz
parents:
diff changeset
63 %a.val = load <2 x i16>, <2 x i16> addrspace(1)* %a
anatofuz
parents:
diff changeset
64 %r.val = sitofp <2 x i16> %a.val to <2 x half>
anatofuz
parents:
diff changeset
65 store <2 x half> %r.val, <2 x half> addrspace(1)* %r
anatofuz
parents:
diff changeset
66 ret void
anatofuz
parents:
diff changeset
67 }
anatofuz
parents:
diff changeset
68
anatofuz
parents:
diff changeset
69 ; GCN-LABEL: {{^}}sitofp_v2i32_to_v2f16
anatofuz
parents:
diff changeset
70 ; GCN: buffer_load_dwordx2
anatofuz
parents:
diff changeset
71
anatofuz
parents:
diff changeset
72 ; SI: v_cvt_f32_i32_e32
anatofuz
parents:
diff changeset
73 ; SI: v_cvt_f32_i32_e32
anatofuz
parents:
diff changeset
74 ; SI: v_cvt_f16_f32_e32
anatofuz
parents:
diff changeset
75 ; SI: v_cvt_f16_f32_e32
anatofuz
parents:
diff changeset
76 ; SI-DAG: v_lshlrev_b32_e32
anatofuz
parents:
diff changeset
77 ; SI: v_or_b32_e32
anatofuz
parents:
diff changeset
78
anatofuz
parents:
diff changeset
79 ; VI-DAG: v_cvt_f32_i32_e32
anatofuz
parents:
diff changeset
80 ; VI-DAG: v_cvt_f32_i32_e32
anatofuz
parents:
diff changeset
81 ; VI-DAG: v_cvt_f16_f32_e32
anatofuz
parents:
diff changeset
82 ; VI-DAG: v_cvt_f16_f32_sdwa
anatofuz
parents:
diff changeset
83 ; VI: v_or_b32_e32
anatofuz
parents:
diff changeset
84
anatofuz
parents:
diff changeset
85 ; GCN: buffer_store_dword
anatofuz
parents:
diff changeset
86 ; GCN: s_endpgm
anatofuz
parents:
diff changeset
87 define amdgpu_kernel void @sitofp_v2i32_to_v2f16(
anatofuz
parents:
diff changeset
88 <2 x half> addrspace(1)* %r,
anatofuz
parents:
diff changeset
89 <2 x i32> addrspace(1)* %a) {
anatofuz
parents:
diff changeset
90 entry:
anatofuz
parents:
diff changeset
91 %a.val = load <2 x i32>, <2 x i32> addrspace(1)* %a
anatofuz
parents:
diff changeset
92 %r.val = sitofp <2 x i32> %a.val to <2 x half>
anatofuz
parents:
diff changeset
93 store <2 x half> %r.val, <2 x half> addrspace(1)* %r
anatofuz
parents:
diff changeset
94 ret void
anatofuz
parents:
diff changeset
95 }
anatofuz
parents:
diff changeset
96
173
0572611fdcc8 reorgnization done
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
97 ; GCN-LABEL: {{^}}s_sint_to_fp_i1_to_f16:
150
anatofuz
parents:
diff changeset
98 ; GCN-DAG: v_cmp_le_f32_e32 [[CMP0:vcc]], 1.0, {{v[0-9]+}}
anatofuz
parents:
diff changeset
99 ; GCN-DAG: v_cmp_le_f32_e64 [[CMP1:s\[[0-9]+:[0-9]+\]]], 0, {{v[0-9]+}}
anatofuz
parents:
diff changeset
100 ; GCN: s_xor_b64 [[R_CMP:s\[[0-9]+:[0-9]+\]]], [[CMP1]], [[CMP0]]
anatofuz
parents:
diff changeset
101 ; GCN: v_cndmask_b32_e64 [[RESULT:v[0-9]+]], 0, -1.0, [[R_CMP]]
anatofuz
parents:
diff changeset
102 ; GCN-NEXT: v_cvt_f16_f32_e32 [[R_F16:v[0-9]+]], [[RESULT]]
anatofuz
parents:
diff changeset
103 ; GCN: buffer_store_short
anatofuz
parents:
diff changeset
104 ; GCN: s_endpgm
anatofuz
parents:
diff changeset
105 define amdgpu_kernel void @s_sint_to_fp_i1_to_f16(half addrspace(1)* %out, float addrspace(1)* %in0, float addrspace(1)* %in1) {
anatofuz
parents:
diff changeset
106 %a = load float, float addrspace(1) * %in0
anatofuz
parents:
diff changeset
107 %b = load float, float addrspace(1) * %in1
anatofuz
parents:
diff changeset
108 %acmp = fcmp oge float %a, 0.000000e+00
anatofuz
parents:
diff changeset
109 %bcmp = fcmp oge float %b, 1.000000e+00
anatofuz
parents:
diff changeset
110 %result = xor i1 %acmp, %bcmp
anatofuz
parents:
diff changeset
111 %fp = sitofp i1 %result to half
anatofuz
parents:
diff changeset
112 store half %fp, half addrspace(1)* %out
anatofuz
parents:
diff changeset
113 ret void
anatofuz
parents:
diff changeset
114 }
anatofuz
parents:
diff changeset
115
anatofuz
parents:
diff changeset
116 ; v2f16 = sitofp v2i64 is in sint_to_fp.i64.ll