2 * Copyright 2016 Bas Nieuwenhuizen
4 * Permission is hereby granted, free of charge, to any person obtaining a
5 * copy of this software and associated documentation files (the
6 * "Software"), to deal in the Software without restriction, including
7 * without limitation the rights to use, copy, modify, merge, publish,
8 * distribute, sub license, and/or sell copies of the Software, and to
9 * permit persons to whom the Software is furnished to do so, subject to
10 * the following conditions:
12 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
13 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
14 * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
15 * THE COPYRIGHT HOLDERS, AUTHORS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM,
16 * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
17 * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
18 * USE OR OTHER DEALINGS IN THE SOFTWARE.
20 * The above copyright notice and this permission notice (including the
21 * next paragraph) shall be included in all copies or substantial portions
25 #ifndef AC_LLVM_BUILD_H
26 #define AC_LLVM_BUILD_H
29 #include <llvm-c/Core.h>
30 #include "compiler/nir/nir.h"
31 #include "amd_family.h"
38 AC_ADDR_SPACE_FLAT
= 0, /* Slower than global. */
39 AC_ADDR_SPACE_GLOBAL
= 1,
40 AC_ADDR_SPACE_GDS
= 2,
41 AC_ADDR_SPACE_LDS
= 3,
42 AC_ADDR_SPACE_CONST
= 4, /* Global allowing SMEM. */
43 AC_ADDR_SPACE_CONST_32BIT
= 6, /* same as CONST, but the pointer type has 32 bits */
46 #define AC_WAIT_LGKM (1 << 0) /* LDS, GDS, constant, message */
47 #define AC_WAIT_VLOAD (1 << 1) /* VMEM load/sample instructions */
48 #define AC_WAIT_VSTORE (1 << 2) /* VMEM store instructions */
51 struct ac_llvm_compiler
;
54 struct ac_llvm_flow_state
{
55 struct ac_llvm_flow
*stack
;
60 struct ac_llvm_context
{
61 LLVMContextRef context
;
63 LLVMBuilderRef builder
;
83 LLVMTypeRef iN_wavemask
;
100 LLVMValueRef i1false
;
102 /* Since ac_nir_translate makes a local copy of ac_llvm_context, there
103 * are two ac_llvm_contexts. Declare a pointer here, so that the control
104 * flow stack is shared by both ac_llvm_contexts.
106 struct ac_llvm_flow_state
*flow
;
108 unsigned range_md_kind
;
109 unsigned invariant_load_md_kind
;
110 unsigned uniform_md_kind
;
111 unsigned fpmath_md_kind
;
112 LLVMValueRef fpmath_md_2p5_ulp
;
113 LLVMValueRef empty_md
;
115 enum chip_class chip_class
;
116 enum radeon_family family
;
123 ac_llvm_context_init(struct ac_llvm_context
*ctx
,
124 struct ac_llvm_compiler
*compiler
,
125 enum chip_class chip_class
, enum radeon_family family
,
126 enum ac_float_mode float_mode
, unsigned wave_size
);
129 ac_llvm_context_dispose(struct ac_llvm_context
*ctx
);
132 ac_get_llvm_num_components(LLVMValueRef value
);
135 ac_get_elem_bits(struct ac_llvm_context
*ctx
, LLVMTypeRef type
);
138 ac_llvm_extract_elem(struct ac_llvm_context
*ac
,
142 unsigned ac_get_type_size(LLVMTypeRef type
);
144 LLVMTypeRef
ac_to_integer_type(struct ac_llvm_context
*ctx
, LLVMTypeRef t
);
145 LLVMValueRef
ac_to_integer(struct ac_llvm_context
*ctx
, LLVMValueRef v
);
146 LLVMValueRef
ac_to_integer_or_pointer(struct ac_llvm_context
*ctx
, LLVMValueRef v
);
147 LLVMTypeRef
ac_to_float_type(struct ac_llvm_context
*ctx
, LLVMTypeRef t
);
148 LLVMValueRef
ac_to_float(struct ac_llvm_context
*ctx
, LLVMValueRef v
);
151 ac_build_intrinsic(struct ac_llvm_context
*ctx
, const char *name
,
152 LLVMTypeRef return_type
, LLVMValueRef
*params
,
153 unsigned param_count
, unsigned attrib_mask
);
155 void ac_build_type_name_for_intr(LLVMTypeRef type
, char *buf
, unsigned bufsize
);
158 ac_build_phi(struct ac_llvm_context
*ctx
, LLVMTypeRef type
,
159 unsigned count_incoming
, LLVMValueRef
*values
,
160 LLVMBasicBlockRef
*blocks
);
162 void ac_build_s_barrier(struct ac_llvm_context
*ctx
);
163 void ac_build_optimization_barrier(struct ac_llvm_context
*ctx
,
164 LLVMValueRef
*pvgpr
);
166 LLVMValueRef
ac_build_shader_clock(struct ac_llvm_context
*ctx
);
168 LLVMValueRef
ac_build_ballot(struct ac_llvm_context
*ctx
, LLVMValueRef value
);
169 LLVMValueRef
ac_get_i1_sgpr_mask(struct ac_llvm_context
*ctx
,
172 LLVMValueRef
ac_build_vote_all(struct ac_llvm_context
*ctx
, LLVMValueRef value
);
174 LLVMValueRef
ac_build_vote_any(struct ac_llvm_context
*ctx
, LLVMValueRef value
);
176 LLVMValueRef
ac_build_vote_eq(struct ac_llvm_context
*ctx
, LLVMValueRef value
);
179 ac_build_varying_gather_values(struct ac_llvm_context
*ctx
, LLVMValueRef
*values
,
180 unsigned value_count
, unsigned component
);
183 ac_build_gather_values_extended(struct ac_llvm_context
*ctx
,
184 LLVMValueRef
*values
,
185 unsigned value_count
,
186 unsigned value_stride
,
190 ac_build_gather_values(struct ac_llvm_context
*ctx
,
191 LLVMValueRef
*values
,
192 unsigned value_count
);
193 LLVMValueRef
ac_build_expand_to_vec4(struct ac_llvm_context
*ctx
,
195 unsigned num_channels
);
196 LLVMValueRef
ac_build_round(struct ac_llvm_context
*ctx
, LLVMValueRef value
);
199 ac_build_fdiv(struct ac_llvm_context
*ctx
,
203 LLVMValueRef
ac_build_fast_udiv(struct ac_llvm_context
*ctx
,
205 LLVMValueRef multiplier
,
206 LLVMValueRef pre_shift
,
207 LLVMValueRef post_shift
,
208 LLVMValueRef increment
);
209 LLVMValueRef
ac_build_fast_udiv_nuw(struct ac_llvm_context
*ctx
,
211 LLVMValueRef multiplier
,
212 LLVMValueRef pre_shift
,
213 LLVMValueRef post_shift
,
214 LLVMValueRef increment
);
215 LLVMValueRef
ac_build_fast_udiv_u31_d_not_one(struct ac_llvm_context
*ctx
,
217 LLVMValueRef multiplier
,
218 LLVMValueRef post_shift
);
221 ac_prepare_cube_coords(struct ac_llvm_context
*ctx
,
222 bool is_deriv
, bool is_array
, bool is_lod
,
223 LLVMValueRef
*coords_arg
,
224 LLVMValueRef
*derivs_arg
);
228 ac_build_fs_interp(struct ac_llvm_context
*ctx
,
229 LLVMValueRef llvm_chan
,
230 LLVMValueRef attr_number
,
236 ac_build_fs_interp_f16(struct ac_llvm_context
*ctx
,
237 LLVMValueRef llvm_chan
,
238 LLVMValueRef attr_number
,
244 ac_build_fs_interp_mov(struct ac_llvm_context
*ctx
,
245 LLVMValueRef parameter
,
246 LLVMValueRef llvm_chan
,
247 LLVMValueRef attr_number
,
248 LLVMValueRef params
);
251 ac_build_gep_ptr(struct ac_llvm_context
*ctx
,
252 LLVMValueRef base_ptr
,
256 ac_build_gep0(struct ac_llvm_context
*ctx
,
257 LLVMValueRef base_ptr
,
259 LLVMValueRef
ac_build_pointer_add(struct ac_llvm_context
*ctx
, LLVMValueRef ptr
,
263 ac_build_indexed_store(struct ac_llvm_context
*ctx
,
264 LLVMValueRef base_ptr
, LLVMValueRef index
,
267 LLVMValueRef
ac_build_load(struct ac_llvm_context
*ctx
, LLVMValueRef base_ptr
,
269 LLVMValueRef
ac_build_load_invariant(struct ac_llvm_context
*ctx
,
270 LLVMValueRef base_ptr
, LLVMValueRef index
);
271 LLVMValueRef
ac_build_load_to_sgpr(struct ac_llvm_context
*ctx
,
272 LLVMValueRef base_ptr
, LLVMValueRef index
);
273 LLVMValueRef
ac_build_load_to_sgpr_uint_wraparound(struct ac_llvm_context
*ctx
,
274 LLVMValueRef base_ptr
, LLVMValueRef index
);
277 ac_build_buffer_store_dword(struct ac_llvm_context
*ctx
,
280 unsigned num_channels
,
281 LLVMValueRef voffset
,
282 LLVMValueRef soffset
,
283 unsigned inst_offset
,
284 unsigned cache_policy
,
285 bool swizzle_enable_hint
);
288 ac_build_buffer_store_format(struct ac_llvm_context
*ctx
,
292 LLVMValueRef voffset
,
293 unsigned num_channels
,
294 unsigned cache_policy
);
297 ac_build_buffer_load(struct ac_llvm_context
*ctx
,
301 LLVMValueRef voffset
,
302 LLVMValueRef soffset
,
303 unsigned inst_offset
,
304 unsigned cache_policy
,
308 LLVMValueRef
ac_build_buffer_load_format(struct ac_llvm_context
*ctx
,
311 LLVMValueRef voffset
,
312 unsigned num_channels
,
313 unsigned cache_policy
,
316 /* load_format that handles the stride & element count better if idxen is
317 * disabled by LLVM. */
318 LLVMValueRef
ac_build_buffer_load_format_gfx9_safe(struct ac_llvm_context
*ctx
,
321 LLVMValueRef voffset
,
322 unsigned num_channels
,
323 unsigned cache_policy
,
327 ac_build_tbuffer_load_short(struct ac_llvm_context
*ctx
,
329 LLVMValueRef voffset
,
330 LLVMValueRef soffset
,
331 LLVMValueRef immoffset
,
332 unsigned cache_policy
);
335 ac_build_tbuffer_load_byte(struct ac_llvm_context
*ctx
,
337 LLVMValueRef voffset
,
338 LLVMValueRef soffset
,
339 LLVMValueRef immoffset
,
340 unsigned cache_policy
);
343 ac_build_struct_tbuffer_load(struct ac_llvm_context
*ctx
,
346 LLVMValueRef voffset
,
347 LLVMValueRef soffset
,
348 LLVMValueRef immoffset
,
349 unsigned num_channels
,
352 unsigned cache_policy
,
356 ac_build_raw_tbuffer_load(struct ac_llvm_context
*ctx
,
358 LLVMValueRef voffset
,
359 LLVMValueRef soffset
,
360 LLVMValueRef immoffset
,
361 unsigned num_channels
,
364 unsigned cache_policy
,
367 /* For ac_build_fetch_format.
369 * Note: FLOAT must be 0 (used for convenience of encoding in radeonsi).
372 AC_FETCH_FORMAT_FLOAT
= 0,
373 AC_FETCH_FORMAT_FIXED
,
374 AC_FETCH_FORMAT_UNORM
,
375 AC_FETCH_FORMAT_SNORM
,
376 AC_FETCH_FORMAT_USCALED
,
377 AC_FETCH_FORMAT_SSCALED
,
378 AC_FETCH_FORMAT_UINT
,
379 AC_FETCH_FORMAT_SINT
,
383 ac_build_opencoded_load_format(struct ac_llvm_context
*ctx
,
385 unsigned num_channels
,
391 LLVMValueRef voffset
,
392 LLVMValueRef soffset
,
393 unsigned cache_policy
,
397 ac_build_tbuffer_store_short(struct ac_llvm_context
*ctx
,
400 LLVMValueRef voffset
,
401 LLVMValueRef soffset
,
402 unsigned cache_policy
);
405 ac_build_tbuffer_store_byte(struct ac_llvm_context
*ctx
,
408 LLVMValueRef voffset
,
409 LLVMValueRef soffset
,
410 unsigned cache_policy
);
413 ac_build_struct_tbuffer_store(struct ac_llvm_context
*ctx
,
417 LLVMValueRef voffset
,
418 LLVMValueRef soffset
,
419 LLVMValueRef immoffset
,
420 unsigned num_channels
,
423 unsigned cache_policy
);
426 ac_build_raw_tbuffer_store(struct ac_llvm_context
*ctx
,
429 LLVMValueRef voffset
,
430 LLVMValueRef soffset
,
431 LLVMValueRef immoffset
,
432 unsigned num_channels
,
435 unsigned cache_policy
);
438 ac_get_thread_id(struct ac_llvm_context
*ctx
);
440 #define AC_TID_MASK_TOP_LEFT 0xfffffffc
441 #define AC_TID_MASK_TOP 0xfffffffd
442 #define AC_TID_MASK_LEFT 0xfffffffe
445 ac_build_ddxy(struct ac_llvm_context
*ctx
,
450 #define AC_SENDMSG_GS 2
451 #define AC_SENDMSG_GS_DONE 3
452 #define AC_SENDMSG_GS_ALLOC_REQ 9
454 #define AC_SENDMSG_GS_OP_NOP (0 << 4)
455 #define AC_SENDMSG_GS_OP_CUT (1 << 4)
456 #define AC_SENDMSG_GS_OP_EMIT (2 << 4)
457 #define AC_SENDMSG_GS_OP_EMIT_CUT (3 << 4)
459 void ac_build_sendmsg(struct ac_llvm_context
*ctx
,
461 LLVMValueRef wave_id
);
463 LLVMValueRef
ac_build_imsb(struct ac_llvm_context
*ctx
,
465 LLVMTypeRef dst_type
);
467 LLVMValueRef
ac_build_umsb(struct ac_llvm_context
*ctx
,
469 LLVMTypeRef dst_type
);
470 LLVMValueRef
ac_build_fmin(struct ac_llvm_context
*ctx
, LLVMValueRef a
,
472 LLVMValueRef
ac_build_fmax(struct ac_llvm_context
*ctx
, LLVMValueRef a
,
474 LLVMValueRef
ac_build_imin(struct ac_llvm_context
*ctx
, LLVMValueRef a
,
476 LLVMValueRef
ac_build_imax(struct ac_llvm_context
*ctx
, LLVMValueRef a
,
478 LLVMValueRef
ac_build_umin(struct ac_llvm_context
*ctx
, LLVMValueRef a
, LLVMValueRef b
);
479 LLVMValueRef
ac_build_umax(struct ac_llvm_context
*ctx
, LLVMValueRef a
, LLVMValueRef b
);
480 LLVMValueRef
ac_build_clamp(struct ac_llvm_context
*ctx
, LLVMValueRef value
);
482 struct ac_export_args
{
485 unsigned enabled_channels
;
491 void ac_build_export(struct ac_llvm_context
*ctx
, struct ac_export_args
*a
);
493 void ac_build_export_null(struct ac_llvm_context
*ctx
);
495 enum ac_image_opcode
{
503 ac_image_get_resinfo
,
505 ac_image_atomic_cmpswap
,
525 ac_image_cube
, // includes cube arrays
529 ac_image_2darraymsaa
,
532 /* These cache policy bits match the definitions used by the LLVM intrinsics. */
533 enum ac_image_cache_policy
{
534 ac_glc
= 1 << 0, /* per-CU cache control */
535 ac_slc
= 1 << 1, /* global L2 cache control */
536 ac_dlc
= 1 << 2, /* per-shader-array cache control */
539 struct ac_image_args
{
540 enum ac_image_opcode opcode
: 4;
541 enum ac_atomic_op atomic
: 4; /* for the ac_image_atomic opcode */
542 enum ac_image_dim dim
: 3;
544 unsigned cache_policy
: 3;
547 unsigned attributes
; /* additional call-site specific AC_FUNC_ATTRs */
549 LLVMValueRef resource
;
550 LLVMValueRef sampler
;
551 LLVMValueRef data
[2]; /* data[0] is source data (vector); data[1] is cmp for cmpswap */
554 LLVMValueRef compare
;
555 LLVMValueRef derivs
[6];
556 LLVMValueRef coords
[4];
557 LLVMValueRef lod
; // also used by ac_image_get_resinfo
560 LLVMValueRef
ac_build_image_opcode(struct ac_llvm_context
*ctx
,
561 struct ac_image_args
*a
);
562 LLVMValueRef
ac_build_cvt_pkrtz_f16(struct ac_llvm_context
*ctx
,
563 LLVMValueRef args
[2]);
564 LLVMValueRef
ac_build_cvt_pknorm_i16(struct ac_llvm_context
*ctx
,
565 LLVMValueRef args
[2]);
566 LLVMValueRef
ac_build_cvt_pknorm_u16(struct ac_llvm_context
*ctx
,
567 LLVMValueRef args
[2]);
568 LLVMValueRef
ac_build_cvt_pk_i16(struct ac_llvm_context
*ctx
,
569 LLVMValueRef args
[2], unsigned bits
, bool hi
);
570 LLVMValueRef
ac_build_cvt_pk_u16(struct ac_llvm_context
*ctx
,
571 LLVMValueRef args
[2], unsigned bits
, bool hi
);
572 LLVMValueRef
ac_build_wqm_vote(struct ac_llvm_context
*ctx
, LLVMValueRef i1
);
573 void ac_build_kill_if_false(struct ac_llvm_context
*ctx
, LLVMValueRef i1
);
574 LLVMValueRef
ac_build_bfe(struct ac_llvm_context
*ctx
, LLVMValueRef input
,
575 LLVMValueRef offset
, LLVMValueRef width
,
577 LLVMValueRef
ac_build_imad(struct ac_llvm_context
*ctx
, LLVMValueRef s0
,
578 LLVMValueRef s1
, LLVMValueRef s2
);
579 LLVMValueRef
ac_build_fmad(struct ac_llvm_context
*ctx
, LLVMValueRef s0
,
580 LLVMValueRef s1
, LLVMValueRef s2
);
582 void ac_build_waitcnt(struct ac_llvm_context
*ctx
, unsigned wait_flags
);
584 LLVMValueRef
ac_build_fract(struct ac_llvm_context
*ctx
, LLVMValueRef src0
,
587 LLVMValueRef
ac_build_fmed3(struct ac_llvm_context
*ctx
, LLVMValueRef src0
,
588 LLVMValueRef src1
, LLVMValueRef src2
,
591 LLVMValueRef
ac_build_isign(struct ac_llvm_context
*ctx
, LLVMValueRef src0
,
594 LLVMValueRef
ac_build_fsign(struct ac_llvm_context
*ctx
, LLVMValueRef src0
,
597 LLVMValueRef
ac_build_bit_count(struct ac_llvm_context
*ctx
, LLVMValueRef src0
);
599 LLVMValueRef
ac_build_bitfield_reverse(struct ac_llvm_context
*ctx
,
602 void ac_optimize_vs_outputs(struct ac_llvm_context
*ac
,
603 LLVMValueRef main_fn
,
604 uint8_t *vs_output_param_offset
,
605 uint32_t num_outputs
,
606 uint8_t *num_param_exports
);
607 void ac_init_exec_full_mask(struct ac_llvm_context
*ctx
);
609 void ac_declare_lds_as_pointer(struct ac_llvm_context
*ac
);
610 LLVMValueRef
ac_lds_load(struct ac_llvm_context
*ctx
,
611 LLVMValueRef dw_addr
);
612 void ac_lds_store(struct ac_llvm_context
*ctx
,
613 LLVMValueRef dw_addr
, LLVMValueRef value
);
615 LLVMValueRef
ac_find_lsb(struct ac_llvm_context
*ctx
,
616 LLVMTypeRef dst_type
,
619 LLVMTypeRef
ac_array_in_const_addr_space(LLVMTypeRef elem_type
);
620 LLVMTypeRef
ac_array_in_const32_addr_space(LLVMTypeRef elem_type
);
622 void ac_build_bgnloop(struct ac_llvm_context
*ctx
, int lable_id
);
623 void ac_build_break(struct ac_llvm_context
*ctx
);
624 void ac_build_continue(struct ac_llvm_context
*ctx
);
625 void ac_build_else(struct ac_llvm_context
*ctx
, int lable_id
);
626 void ac_build_endif(struct ac_llvm_context
*ctx
, int lable_id
);
627 void ac_build_endloop(struct ac_llvm_context
*ctx
, int lable_id
);
628 void ac_build_ifcc(struct ac_llvm_context
*ctx
, LLVMValueRef cond
, int label_id
);
629 void ac_build_if(struct ac_llvm_context
*ctx
, LLVMValueRef value
,
631 void ac_build_uif(struct ac_llvm_context
*ctx
, LLVMValueRef value
,
634 LLVMValueRef
ac_build_alloca(struct ac_llvm_context
*ac
, LLVMTypeRef type
,
636 LLVMValueRef
ac_build_alloca_undef(struct ac_llvm_context
*ac
, LLVMTypeRef type
,
639 LLVMValueRef
ac_cast_ptr(struct ac_llvm_context
*ctx
, LLVMValueRef ptr
,
642 LLVMValueRef
ac_trim_vector(struct ac_llvm_context
*ctx
, LLVMValueRef value
,
645 LLVMValueRef
ac_unpack_param(struct ac_llvm_context
*ctx
, LLVMValueRef param
,
646 unsigned rshift
, unsigned bitwidth
);
648 void ac_apply_fmask_to_sample(struct ac_llvm_context
*ac
, LLVMValueRef fmask
,
649 LLVMValueRef
*addr
, bool is_array_tex
);
652 ac_build_ds_swizzle(struct ac_llvm_context
*ctx
, LLVMValueRef src
, unsigned mask
);
655 ac_build_readlane(struct ac_llvm_context
*ctx
, LLVMValueRef src
, LLVMValueRef lane
);
658 ac_build_writelane(struct ac_llvm_context
*ctx
, LLVMValueRef src
, LLVMValueRef value
, LLVMValueRef lane
);
661 ac_build_mbcnt(struct ac_llvm_context
*ctx
, LLVMValueRef mask
);
664 ac_build_inclusive_scan(struct ac_llvm_context
*ctx
, LLVMValueRef src
, nir_op op
);
667 ac_build_exclusive_scan(struct ac_llvm_context
*ctx
, LLVMValueRef src
, nir_op op
);
670 ac_build_reduce(struct ac_llvm_context
*ctx
, LLVMValueRef src
, nir_op op
, unsigned cluster_size
);
673 * Common arguments for a scan/reduce operation that accumulates per-wave
674 * values across an entire workgroup, while respecting the order of waves.
678 bool enable_exclusive
;
679 bool enable_inclusive
;
681 LLVMValueRef src
; /* clobbered! */
682 LLVMValueRef result_reduce
;
683 LLVMValueRef result_exclusive
;
684 LLVMValueRef result_inclusive
;
686 LLVMValueRef waveidx
;
687 LLVMValueRef numwaves
; /* only needed for "reduce" operations */
689 /* T addrspace(LDS) pointer to the same type as value, at least maxwaves entries */
690 LLVMValueRef scratch
;
695 ac_build_wg_wavescan_top(struct ac_llvm_context
*ctx
, struct ac_wg_scan
*ws
);
697 ac_build_wg_wavescan_bottom(struct ac_llvm_context
*ctx
, struct ac_wg_scan
*ws
);
699 ac_build_wg_wavescan(struct ac_llvm_context
*ctx
, struct ac_wg_scan
*ws
);
702 ac_build_wg_scan_top(struct ac_llvm_context
*ctx
, struct ac_wg_scan
*ws
);
704 ac_build_wg_scan_bottom(struct ac_llvm_context
*ctx
, struct ac_wg_scan
*ws
);
706 ac_build_wg_scan(struct ac_llvm_context
*ctx
, struct ac_wg_scan
*ws
);
709 ac_build_quad_swizzle(struct ac_llvm_context
*ctx
, LLVMValueRef src
,
710 unsigned lane0
, unsigned lane1
, unsigned lane2
, unsigned lane3
);
713 ac_build_shuffle(struct ac_llvm_context
*ctx
, LLVMValueRef src
, LLVMValueRef index
);
716 ac_build_frexp_exp(struct ac_llvm_context
*ctx
, LLVMValueRef src0
,
720 ac_build_frexp_mant(struct ac_llvm_context
*ctx
, LLVMValueRef src0
,
724 ac_build_ddxy_interp(struct ac_llvm_context
*ctx
, LLVMValueRef interp_ij
);
727 ac_build_load_helper_invocation(struct ac_llvm_context
*ctx
);
729 LLVMValueRef
ac_build_call(struct ac_llvm_context
*ctx
, LLVMValueRef func
,
730 LLVMValueRef
*args
, unsigned num_args
);
732 LLVMValueRef
ac_build_atomic_rmw(struct ac_llvm_context
*ctx
, LLVMAtomicRMWBinOp op
,
733 LLVMValueRef ptr
, LLVMValueRef val
,
734 const char *sync_scope
);
736 LLVMValueRef
ac_build_atomic_cmp_xchg(struct ac_llvm_context
*ctx
, LLVMValueRef ptr
,
737 LLVMValueRef cmp
, LLVMValueRef val
,
738 const char *sync_scope
);