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
);
195 ac_extract_components(struct ac_llvm_context
*ctx
,
200 LLVMValueRef
ac_build_expand_to_vec4(struct ac_llvm_context
*ctx
,
202 unsigned num_channels
);
203 LLVMValueRef
ac_build_round(struct ac_llvm_context
*ctx
, LLVMValueRef value
);
206 ac_build_fdiv(struct ac_llvm_context
*ctx
,
210 LLVMValueRef
ac_build_fast_udiv(struct ac_llvm_context
*ctx
,
212 LLVMValueRef multiplier
,
213 LLVMValueRef pre_shift
,
214 LLVMValueRef post_shift
,
215 LLVMValueRef increment
);
216 LLVMValueRef
ac_build_fast_udiv_nuw(struct ac_llvm_context
*ctx
,
218 LLVMValueRef multiplier
,
219 LLVMValueRef pre_shift
,
220 LLVMValueRef post_shift
,
221 LLVMValueRef increment
);
222 LLVMValueRef
ac_build_fast_udiv_u31_d_not_one(struct ac_llvm_context
*ctx
,
224 LLVMValueRef multiplier
,
225 LLVMValueRef post_shift
);
228 ac_prepare_cube_coords(struct ac_llvm_context
*ctx
,
229 bool is_deriv
, bool is_array
, bool is_lod
,
230 LLVMValueRef
*coords_arg
,
231 LLVMValueRef
*derivs_arg
);
235 ac_build_fs_interp(struct ac_llvm_context
*ctx
,
236 LLVMValueRef llvm_chan
,
237 LLVMValueRef attr_number
,
243 ac_build_fs_interp_f16(struct ac_llvm_context
*ctx
,
244 LLVMValueRef llvm_chan
,
245 LLVMValueRef attr_number
,
251 ac_build_fs_interp_mov(struct ac_llvm_context
*ctx
,
252 LLVMValueRef parameter
,
253 LLVMValueRef llvm_chan
,
254 LLVMValueRef attr_number
,
255 LLVMValueRef params
);
258 ac_build_gep_ptr(struct ac_llvm_context
*ctx
,
259 LLVMValueRef base_ptr
,
263 ac_build_gep0(struct ac_llvm_context
*ctx
,
264 LLVMValueRef base_ptr
,
266 LLVMValueRef
ac_build_pointer_add(struct ac_llvm_context
*ctx
, LLVMValueRef ptr
,
270 ac_build_indexed_store(struct ac_llvm_context
*ctx
,
271 LLVMValueRef base_ptr
, LLVMValueRef index
,
274 LLVMValueRef
ac_build_load(struct ac_llvm_context
*ctx
, LLVMValueRef base_ptr
,
276 LLVMValueRef
ac_build_load_invariant(struct ac_llvm_context
*ctx
,
277 LLVMValueRef base_ptr
, LLVMValueRef index
);
278 LLVMValueRef
ac_build_load_to_sgpr(struct ac_llvm_context
*ctx
,
279 LLVMValueRef base_ptr
, LLVMValueRef index
);
280 LLVMValueRef
ac_build_load_to_sgpr_uint_wraparound(struct ac_llvm_context
*ctx
,
281 LLVMValueRef base_ptr
, LLVMValueRef index
);
284 ac_build_buffer_store_dword(struct ac_llvm_context
*ctx
,
287 unsigned num_channels
,
288 LLVMValueRef voffset
,
289 LLVMValueRef soffset
,
290 unsigned inst_offset
,
291 unsigned cache_policy
,
292 bool swizzle_enable_hint
);
295 ac_build_buffer_store_format(struct ac_llvm_context
*ctx
,
299 LLVMValueRef voffset
,
300 unsigned num_channels
,
301 unsigned cache_policy
);
304 ac_build_buffer_load(struct ac_llvm_context
*ctx
,
308 LLVMValueRef voffset
,
309 LLVMValueRef soffset
,
310 unsigned inst_offset
,
311 unsigned cache_policy
,
315 LLVMValueRef
ac_build_buffer_load_format(struct ac_llvm_context
*ctx
,
318 LLVMValueRef voffset
,
319 unsigned num_channels
,
320 unsigned cache_policy
,
323 /* load_format that handles the stride & element count better if idxen is
324 * disabled by LLVM. */
325 LLVMValueRef
ac_build_buffer_load_format_gfx9_safe(struct ac_llvm_context
*ctx
,
328 LLVMValueRef voffset
,
329 unsigned num_channels
,
330 unsigned cache_policy
,
334 ac_build_tbuffer_load_short(struct ac_llvm_context
*ctx
,
336 LLVMValueRef voffset
,
337 LLVMValueRef soffset
,
338 LLVMValueRef immoffset
,
339 unsigned cache_policy
);
342 ac_build_tbuffer_load_byte(struct ac_llvm_context
*ctx
,
344 LLVMValueRef voffset
,
345 LLVMValueRef soffset
,
346 LLVMValueRef immoffset
,
347 unsigned cache_policy
);
350 ac_build_struct_tbuffer_load(struct ac_llvm_context
*ctx
,
353 LLVMValueRef voffset
,
354 LLVMValueRef soffset
,
355 LLVMValueRef immoffset
,
356 unsigned num_channels
,
359 unsigned cache_policy
,
363 ac_build_raw_tbuffer_load(struct ac_llvm_context
*ctx
,
365 LLVMValueRef voffset
,
366 LLVMValueRef soffset
,
367 LLVMValueRef immoffset
,
368 unsigned num_channels
,
371 unsigned cache_policy
,
374 /* For ac_build_fetch_format.
376 * Note: FLOAT must be 0 (used for convenience of encoding in radeonsi).
379 AC_FETCH_FORMAT_FLOAT
= 0,
380 AC_FETCH_FORMAT_FIXED
,
381 AC_FETCH_FORMAT_UNORM
,
382 AC_FETCH_FORMAT_SNORM
,
383 AC_FETCH_FORMAT_USCALED
,
384 AC_FETCH_FORMAT_SSCALED
,
385 AC_FETCH_FORMAT_UINT
,
386 AC_FETCH_FORMAT_SINT
,
390 ac_build_opencoded_load_format(struct ac_llvm_context
*ctx
,
392 unsigned num_channels
,
398 LLVMValueRef voffset
,
399 LLVMValueRef soffset
,
400 unsigned cache_policy
,
404 ac_build_tbuffer_store_short(struct ac_llvm_context
*ctx
,
407 LLVMValueRef voffset
,
408 LLVMValueRef soffset
,
409 unsigned cache_policy
);
412 ac_build_tbuffer_store_byte(struct ac_llvm_context
*ctx
,
415 LLVMValueRef voffset
,
416 LLVMValueRef soffset
,
417 unsigned cache_policy
);
420 ac_build_struct_tbuffer_store(struct ac_llvm_context
*ctx
,
424 LLVMValueRef voffset
,
425 LLVMValueRef soffset
,
426 LLVMValueRef immoffset
,
427 unsigned num_channels
,
430 unsigned cache_policy
);
433 ac_build_raw_tbuffer_store(struct ac_llvm_context
*ctx
,
436 LLVMValueRef voffset
,
437 LLVMValueRef soffset
,
438 LLVMValueRef immoffset
,
439 unsigned num_channels
,
442 unsigned cache_policy
);
445 ac_get_thread_id(struct ac_llvm_context
*ctx
);
447 #define AC_TID_MASK_TOP_LEFT 0xfffffffc
448 #define AC_TID_MASK_TOP 0xfffffffd
449 #define AC_TID_MASK_LEFT 0xfffffffe
452 ac_build_ddxy(struct ac_llvm_context
*ctx
,
457 #define AC_SENDMSG_GS 2
458 #define AC_SENDMSG_GS_DONE 3
459 #define AC_SENDMSG_GS_ALLOC_REQ 9
461 #define AC_SENDMSG_GS_OP_NOP (0 << 4)
462 #define AC_SENDMSG_GS_OP_CUT (1 << 4)
463 #define AC_SENDMSG_GS_OP_EMIT (2 << 4)
464 #define AC_SENDMSG_GS_OP_EMIT_CUT (3 << 4)
466 void ac_build_sendmsg(struct ac_llvm_context
*ctx
,
468 LLVMValueRef wave_id
);
470 LLVMValueRef
ac_build_imsb(struct ac_llvm_context
*ctx
,
472 LLVMTypeRef dst_type
);
474 LLVMValueRef
ac_build_umsb(struct ac_llvm_context
*ctx
,
476 LLVMTypeRef dst_type
);
477 LLVMValueRef
ac_build_fmin(struct ac_llvm_context
*ctx
, LLVMValueRef a
,
479 LLVMValueRef
ac_build_fmax(struct ac_llvm_context
*ctx
, LLVMValueRef a
,
481 LLVMValueRef
ac_build_imin(struct ac_llvm_context
*ctx
, LLVMValueRef a
,
483 LLVMValueRef
ac_build_imax(struct ac_llvm_context
*ctx
, LLVMValueRef a
,
485 LLVMValueRef
ac_build_umin(struct ac_llvm_context
*ctx
, LLVMValueRef a
, LLVMValueRef b
);
486 LLVMValueRef
ac_build_umax(struct ac_llvm_context
*ctx
, LLVMValueRef a
, LLVMValueRef b
);
487 LLVMValueRef
ac_build_clamp(struct ac_llvm_context
*ctx
, LLVMValueRef value
);
489 struct ac_export_args
{
492 unsigned enabled_channels
;
498 void ac_build_export(struct ac_llvm_context
*ctx
, struct ac_export_args
*a
);
500 void ac_build_export_null(struct ac_llvm_context
*ctx
);
502 enum ac_image_opcode
{
510 ac_image_get_resinfo
,
512 ac_image_atomic_cmpswap
,
534 ac_image_cube
, // includes cube arrays
538 ac_image_2darraymsaa
,
541 /* These cache policy bits match the definitions used by the LLVM intrinsics. */
542 enum ac_image_cache_policy
{
543 ac_glc
= 1 << 0, /* per-CU cache control */
544 ac_slc
= 1 << 1, /* global L2 cache control */
545 ac_dlc
= 1 << 2, /* per-shader-array cache control */
548 struct ac_image_args
{
549 enum ac_image_opcode opcode
: 4;
550 enum ac_atomic_op atomic
: 4; /* for the ac_image_atomic opcode */
551 enum ac_image_dim dim
: 3;
553 unsigned cache_policy
: 3;
556 unsigned attributes
; /* additional call-site specific AC_FUNC_ATTRs */
558 LLVMValueRef resource
;
559 LLVMValueRef sampler
;
560 LLVMValueRef data
[2]; /* data[0] is source data (vector); data[1] is cmp for cmpswap */
563 LLVMValueRef compare
;
564 LLVMValueRef derivs
[6];
565 LLVMValueRef coords
[4];
566 LLVMValueRef lod
; // also used by ac_image_get_resinfo
569 LLVMValueRef
ac_build_image_opcode(struct ac_llvm_context
*ctx
,
570 struct ac_image_args
*a
);
571 LLVMValueRef
ac_build_cvt_pkrtz_f16(struct ac_llvm_context
*ctx
,
572 LLVMValueRef args
[2]);
573 LLVMValueRef
ac_build_cvt_pknorm_i16(struct ac_llvm_context
*ctx
,
574 LLVMValueRef args
[2]);
575 LLVMValueRef
ac_build_cvt_pknorm_u16(struct ac_llvm_context
*ctx
,
576 LLVMValueRef args
[2]);
577 LLVMValueRef
ac_build_cvt_pk_i16(struct ac_llvm_context
*ctx
,
578 LLVMValueRef args
[2], unsigned bits
, bool hi
);
579 LLVMValueRef
ac_build_cvt_pk_u16(struct ac_llvm_context
*ctx
,
580 LLVMValueRef args
[2], unsigned bits
, bool hi
);
581 LLVMValueRef
ac_build_wqm_vote(struct ac_llvm_context
*ctx
, LLVMValueRef i1
);
582 void ac_build_kill_if_false(struct ac_llvm_context
*ctx
, LLVMValueRef i1
);
583 LLVMValueRef
ac_build_bfe(struct ac_llvm_context
*ctx
, LLVMValueRef input
,
584 LLVMValueRef offset
, LLVMValueRef width
,
586 LLVMValueRef
ac_build_imad(struct ac_llvm_context
*ctx
, LLVMValueRef s0
,
587 LLVMValueRef s1
, LLVMValueRef s2
);
588 LLVMValueRef
ac_build_fmad(struct ac_llvm_context
*ctx
, LLVMValueRef s0
,
589 LLVMValueRef s1
, LLVMValueRef s2
);
591 void ac_build_waitcnt(struct ac_llvm_context
*ctx
, unsigned wait_flags
);
593 LLVMValueRef
ac_build_fract(struct ac_llvm_context
*ctx
, LLVMValueRef src0
,
596 LLVMValueRef
ac_build_fmed3(struct ac_llvm_context
*ctx
, LLVMValueRef src0
,
597 LLVMValueRef src1
, LLVMValueRef src2
,
600 LLVMValueRef
ac_build_isign(struct ac_llvm_context
*ctx
, LLVMValueRef src0
,
603 LLVMValueRef
ac_build_fsign(struct ac_llvm_context
*ctx
, LLVMValueRef src0
,
606 LLVMValueRef
ac_build_bit_count(struct ac_llvm_context
*ctx
, LLVMValueRef src0
);
608 LLVMValueRef
ac_build_bitfield_reverse(struct ac_llvm_context
*ctx
,
611 void ac_optimize_vs_outputs(struct ac_llvm_context
*ac
,
612 LLVMValueRef main_fn
,
613 uint8_t *vs_output_param_offset
,
614 uint32_t num_outputs
,
615 uint8_t *num_param_exports
);
616 void ac_init_exec_full_mask(struct ac_llvm_context
*ctx
);
618 void ac_declare_lds_as_pointer(struct ac_llvm_context
*ac
);
619 LLVMValueRef
ac_lds_load(struct ac_llvm_context
*ctx
,
620 LLVMValueRef dw_addr
);
621 void ac_lds_store(struct ac_llvm_context
*ctx
,
622 LLVMValueRef dw_addr
, LLVMValueRef value
);
624 LLVMValueRef
ac_find_lsb(struct ac_llvm_context
*ctx
,
625 LLVMTypeRef dst_type
,
628 LLVMTypeRef
ac_array_in_const_addr_space(LLVMTypeRef elem_type
);
629 LLVMTypeRef
ac_array_in_const32_addr_space(LLVMTypeRef elem_type
);
631 void ac_build_bgnloop(struct ac_llvm_context
*ctx
, int lable_id
);
632 void ac_build_break(struct ac_llvm_context
*ctx
);
633 void ac_build_continue(struct ac_llvm_context
*ctx
);
634 void ac_build_else(struct ac_llvm_context
*ctx
, int lable_id
);
635 void ac_build_endif(struct ac_llvm_context
*ctx
, int lable_id
);
636 void ac_build_endloop(struct ac_llvm_context
*ctx
, int lable_id
);
637 void ac_build_ifcc(struct ac_llvm_context
*ctx
, LLVMValueRef cond
, int label_id
);
638 void ac_build_if(struct ac_llvm_context
*ctx
, LLVMValueRef value
,
640 void ac_build_uif(struct ac_llvm_context
*ctx
, LLVMValueRef value
,
643 LLVMValueRef
ac_build_alloca(struct ac_llvm_context
*ac
, LLVMTypeRef type
,
645 LLVMValueRef
ac_build_alloca_undef(struct ac_llvm_context
*ac
, LLVMTypeRef type
,
648 LLVMValueRef
ac_cast_ptr(struct ac_llvm_context
*ctx
, LLVMValueRef ptr
,
651 LLVMValueRef
ac_trim_vector(struct ac_llvm_context
*ctx
, LLVMValueRef value
,
654 LLVMValueRef
ac_unpack_param(struct ac_llvm_context
*ctx
, LLVMValueRef param
,
655 unsigned rshift
, unsigned bitwidth
);
657 void ac_apply_fmask_to_sample(struct ac_llvm_context
*ac
, LLVMValueRef fmask
,
658 LLVMValueRef
*addr
, bool is_array_tex
);
661 ac_build_ds_swizzle(struct ac_llvm_context
*ctx
, LLVMValueRef src
, unsigned mask
);
664 ac_build_readlane(struct ac_llvm_context
*ctx
, LLVMValueRef src
, LLVMValueRef lane
);
667 ac_build_writelane(struct ac_llvm_context
*ctx
, LLVMValueRef src
, LLVMValueRef value
, LLVMValueRef lane
);
670 ac_build_mbcnt(struct ac_llvm_context
*ctx
, LLVMValueRef mask
);
673 ac_build_inclusive_scan(struct ac_llvm_context
*ctx
, LLVMValueRef src
, nir_op op
);
676 ac_build_exclusive_scan(struct ac_llvm_context
*ctx
, LLVMValueRef src
, nir_op op
);
679 ac_build_reduce(struct ac_llvm_context
*ctx
, LLVMValueRef src
, nir_op op
, unsigned cluster_size
);
682 * Common arguments for a scan/reduce operation that accumulates per-wave
683 * values across an entire workgroup, while respecting the order of waves.
687 bool enable_exclusive
;
688 bool enable_inclusive
;
690 LLVMValueRef src
; /* clobbered! */
691 LLVMValueRef result_reduce
;
692 LLVMValueRef result_exclusive
;
693 LLVMValueRef result_inclusive
;
695 LLVMValueRef waveidx
;
696 LLVMValueRef numwaves
; /* only needed for "reduce" operations */
698 /* T addrspace(LDS) pointer to the same type as value, at least maxwaves entries */
699 LLVMValueRef scratch
;
704 ac_build_wg_wavescan_top(struct ac_llvm_context
*ctx
, struct ac_wg_scan
*ws
);
706 ac_build_wg_wavescan_bottom(struct ac_llvm_context
*ctx
, struct ac_wg_scan
*ws
);
708 ac_build_wg_wavescan(struct ac_llvm_context
*ctx
, struct ac_wg_scan
*ws
);
711 ac_build_wg_scan_top(struct ac_llvm_context
*ctx
, struct ac_wg_scan
*ws
);
713 ac_build_wg_scan_bottom(struct ac_llvm_context
*ctx
, struct ac_wg_scan
*ws
);
715 ac_build_wg_scan(struct ac_llvm_context
*ctx
, struct ac_wg_scan
*ws
);
718 ac_build_quad_swizzle(struct ac_llvm_context
*ctx
, LLVMValueRef src
,
719 unsigned lane0
, unsigned lane1
, unsigned lane2
, unsigned lane3
);
722 ac_build_shuffle(struct ac_llvm_context
*ctx
, LLVMValueRef src
, LLVMValueRef index
);
725 ac_build_frexp_exp(struct ac_llvm_context
*ctx
, LLVMValueRef src0
,
729 ac_build_frexp_mant(struct ac_llvm_context
*ctx
, LLVMValueRef src0
,
733 ac_build_ddxy_interp(struct ac_llvm_context
*ctx
, LLVMValueRef interp_ij
);
736 ac_build_load_helper_invocation(struct ac_llvm_context
*ctx
);
738 LLVMValueRef
ac_build_call(struct ac_llvm_context
*ctx
, LLVMValueRef func
,
739 LLVMValueRef
*args
, unsigned num_args
);
741 LLVMValueRef
ac_build_atomic_rmw(struct ac_llvm_context
*ctx
, LLVMAtomicRMWBinOp op
,
742 LLVMValueRef ptr
, LLVMValueRef val
,
743 const char *sync_scope
);
745 LLVMValueRef
ac_build_atomic_cmp_xchg(struct ac_llvm_context
*ctx
, LLVMValueRef ptr
,
746 LLVMValueRef cmp
, LLVMValueRef val
,
747 const char *sync_scope
);