1 //===-- SIIntrinsics.td - SI Intrinsic defs ----------------*- tablegen -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 // Backend internal SI Intrinsic Definitions. User code should not
11 // directly use these.
13 //===----------------------------------------------------------------------===//
16 let TargetPrefix = "SI", isTarget = 1 in {
17 def int_SI_packf16 : Intrinsic <[llvm_i32_ty], [llvm_float_ty, llvm_float_ty], [IntrNoMem]>;
18 def int_SI_export : Intrinsic <[], [llvm_i32_ty, llvm_i32_ty, llvm_i32_ty, llvm_i32_ty, llvm_i32_ty, llvm_float_ty, llvm_float_ty, llvm_float_ty, llvm_float_ty], []>;
19 def int_SI_load_const : Intrinsic <[llvm_float_ty], [llvm_anyint_ty, llvm_i32_ty], [IntrNoMem]>;
20 def int_SI_vs_load_input : Intrinsic <[llvm_v4f32_ty], [llvm_anyint_ty, llvm_i16_ty, llvm_i32_ty], [IntrNoMem]> ;
22 // Fully-flexible TBUFFER_STORE_FORMAT_* except for the ADDR64 bit, which is not exposed
23 def int_SI_tbuffer_store : Intrinsic <
25 [llvm_anyint_ty, // rsrc(SGPR)
26 llvm_anyint_ty, // vdata(VGPR), overloaded for types i32, v2i32, v4i32
27 llvm_i32_ty, // num_channels(imm), selects opcode suffix: 1=X, 2=XY, 3=XYZ, 4=XYZW
28 llvm_i32_ty, // vaddr(VGPR)
29 llvm_i32_ty, // soffset(SGPR)
30 llvm_i32_ty, // inst_offset(imm)
31 llvm_i32_ty, // dfmt(imm)
32 llvm_i32_ty, // nfmt(imm)
33 llvm_i32_ty, // offen(imm)
34 llvm_i32_ty, // idxen(imm)
35 llvm_i32_ty, // glc(imm)
36 llvm_i32_ty, // slc(imm)
37 llvm_i32_ty], // tfe(imm)
40 // Fully-flexible BUFFER_LOAD_DWORD_* except for the ADDR64 bit, which is not exposed
41 def int_SI_buffer_load_dword : Intrinsic <
42 [llvm_anyint_ty], // vdata(VGPR), overloaded for types i32, v2i32, v4i32
43 [llvm_anyint_ty, // rsrc(SGPR)
44 llvm_anyint_ty, // vaddr(VGPR)
45 llvm_i32_ty, // soffset(SGPR)
46 llvm_i32_ty, // inst_offset(imm)
47 llvm_i32_ty, // offen(imm)
48 llvm_i32_ty, // idxen(imm)
49 llvm_i32_ty, // glc(imm)
50 llvm_i32_ty, // slc(imm)
51 llvm_i32_ty], // tfe(imm)
52 [IntrReadMem, IntrArgMemOnly]>;
54 def int_SI_sendmsg : Intrinsic <[], [llvm_i32_ty, llvm_i32_ty], []>;
56 // Fully-flexible SAMPLE instruction.
57 class SampleRaw : Intrinsic <
58 [llvm_v4f32_ty], // vdata(VGPR)
59 [llvm_anyint_ty, // vaddr(VGPR)
60 llvm_v8i32_ty, // rsrc(SGPR)
61 llvm_v4i32_ty, // sampler(SGPR)
62 llvm_i32_ty, // dmask(imm)
63 llvm_i32_ty, // unorm(imm)
64 llvm_i32_ty, // r128(imm)
65 llvm_i32_ty, // da(imm)
66 llvm_i32_ty, // glc(imm)
67 llvm_i32_ty, // slc(imm)
68 llvm_i32_ty, // tfe(imm)
69 llvm_i32_ty], // lwe(imm)
72 // Image instruction without a sampler.
73 class Image : Intrinsic <
74 [llvm_v4f32_ty], // vdata(VGPR)
75 [llvm_anyint_ty, // vaddr(VGPR)
76 llvm_v8i32_ty, // rsrc(SGPR)
77 llvm_i32_ty, // dmask(imm)
78 llvm_i32_ty, // unorm(imm)
79 llvm_i32_ty, // r128(imm)
80 llvm_i32_ty, // da(imm)
81 llvm_i32_ty, // glc(imm)
82 llvm_i32_ty, // slc(imm)
83 llvm_i32_ty, // tfe(imm)
84 llvm_i32_ty], // lwe(imm)
88 def int_SI_image_sample : SampleRaw;
89 def int_SI_image_sample_cl : SampleRaw;
90 def int_SI_image_sample_d : SampleRaw;
91 def int_SI_image_sample_d_cl : SampleRaw;
92 def int_SI_image_sample_l : SampleRaw;
93 def int_SI_image_sample_b : SampleRaw;
94 def int_SI_image_sample_b_cl : SampleRaw;
95 def int_SI_image_sample_lz : SampleRaw;
96 def int_SI_image_sample_cd : SampleRaw;
97 def int_SI_image_sample_cd_cl : SampleRaw;
99 // Sample with comparison
100 def int_SI_image_sample_c : SampleRaw;
101 def int_SI_image_sample_c_cl : SampleRaw;
102 def int_SI_image_sample_c_d : SampleRaw;
103 def int_SI_image_sample_c_d_cl : SampleRaw;
104 def int_SI_image_sample_c_l : SampleRaw;
105 def int_SI_image_sample_c_b : SampleRaw;
106 def int_SI_image_sample_c_b_cl : SampleRaw;
107 def int_SI_image_sample_c_lz : SampleRaw;
108 def int_SI_image_sample_c_cd : SampleRaw;
109 def int_SI_image_sample_c_cd_cl : SampleRaw;
111 // Sample with offsets
112 def int_SI_image_sample_o : SampleRaw;
113 def int_SI_image_sample_cl_o : SampleRaw;
114 def int_SI_image_sample_d_o : SampleRaw;
115 def int_SI_image_sample_d_cl_o : SampleRaw;
116 def int_SI_image_sample_l_o : SampleRaw;
117 def int_SI_image_sample_b_o : SampleRaw;
118 def int_SI_image_sample_b_cl_o : SampleRaw;
119 def int_SI_image_sample_lz_o : SampleRaw;
120 def int_SI_image_sample_cd_o : SampleRaw;
121 def int_SI_image_sample_cd_cl_o : SampleRaw;
123 // Sample with comparison and offsets
124 def int_SI_image_sample_c_o : SampleRaw;
125 def int_SI_image_sample_c_cl_o : SampleRaw;
126 def int_SI_image_sample_c_d_o : SampleRaw;
127 def int_SI_image_sample_c_d_cl_o : SampleRaw;
128 def int_SI_image_sample_c_l_o : SampleRaw;
129 def int_SI_image_sample_c_b_o : SampleRaw;
130 def int_SI_image_sample_c_b_cl_o : SampleRaw;
131 def int_SI_image_sample_c_lz_o : SampleRaw;
132 def int_SI_image_sample_c_cd_o : SampleRaw;
133 def int_SI_image_sample_c_cd_cl_o : SampleRaw;
136 def int_SI_gather4 : SampleRaw;
137 def int_SI_gather4_cl : SampleRaw;
138 def int_SI_gather4_l : SampleRaw;
139 def int_SI_gather4_b : SampleRaw;
140 def int_SI_gather4_b_cl : SampleRaw;
141 def int_SI_gather4_lz : SampleRaw;
143 // Gather4 with comparison
144 def int_SI_gather4_c : SampleRaw;
145 def int_SI_gather4_c_cl : SampleRaw;
146 def int_SI_gather4_c_l : SampleRaw;
147 def int_SI_gather4_c_b : SampleRaw;
148 def int_SI_gather4_c_b_cl : SampleRaw;
149 def int_SI_gather4_c_lz : SampleRaw;
151 // Gather4 with offsets
152 def int_SI_gather4_o : SampleRaw;
153 def int_SI_gather4_cl_o : SampleRaw;
154 def int_SI_gather4_l_o : SampleRaw;
155 def int_SI_gather4_b_o : SampleRaw;
156 def int_SI_gather4_b_cl_o : SampleRaw;
157 def int_SI_gather4_lz_o : SampleRaw;
159 // Gather4 with comparison and offsets
160 def int_SI_gather4_c_o : SampleRaw;
161 def int_SI_gather4_c_cl_o : SampleRaw;
162 def int_SI_gather4_c_l_o : SampleRaw;
163 def int_SI_gather4_c_b_o : SampleRaw;
164 def int_SI_gather4_c_b_cl_o : SampleRaw;
165 def int_SI_gather4_c_lz_o : SampleRaw;
167 def int_SI_getlod : SampleRaw;
169 // Image instrinsics.
170 def int_SI_image_load : Image;
171 def int_SI_image_load_mip : Image;
172 def int_SI_getresinfo : Image;
174 /* Interpolation Intrinsics */
176 def int_SI_fs_constant : Intrinsic <[llvm_float_ty], [llvm_i32_ty, llvm_i32_ty, llvm_i32_ty], [IntrNoMem]>;
177 def int_SI_fs_interp : Intrinsic <[llvm_float_ty], [llvm_i32_ty, llvm_i32_ty, llvm_i32_ty, llvm_v2i32_ty], [IntrNoMem]>;
178 } // End TargetPrefix = "SI", isTarget = 1
180 let TargetPrefix = "amdgcn", isTarget = 1 in {
181 // Emit 2.5 ulp, no denormal division. Should only be inserted by
182 // pass based on !fpmath metadata.
183 def int_amdgcn_fdiv_fast : Intrinsic<
184 [llvm_float_ty], [llvm_float_ty], [IntrNoMem]
187 /* Control flow Intrinsics */
189 def int_amdgcn_if : Intrinsic<[llvm_i64_ty], [llvm_i1_ty, llvm_empty_ty], []>;
190 def int_amdgcn_else : Intrinsic<[llvm_i64_ty], [llvm_i64_ty, llvm_empty_ty], []>;
191 def int_amdgcn_break : Intrinsic<[llvm_i64_ty], [llvm_i64_ty], []>;
192 def int_amdgcn_if_break : Intrinsic<[llvm_i64_ty], [llvm_i1_ty, llvm_i64_ty], []>;
193 def int_amdgcn_else_break : Intrinsic<[llvm_i64_ty], [llvm_i64_ty, llvm_i64_ty], []>;
194 def int_amdgcn_loop : Intrinsic<[], [llvm_i64_ty, llvm_empty_ty], []>;
195 def int_amdgcn_end_cf : Intrinsic<[], [llvm_i64_ty], []>;