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"
32 #include "ac_shader_util.h"
39 AC_ADDR_SPACE_FLAT
= 0, /* Slower than global. */
40 AC_ADDR_SPACE_GLOBAL
= 1,
41 AC_ADDR_SPACE_GDS
= 2,
42 AC_ADDR_SPACE_LDS
= 3,
43 AC_ADDR_SPACE_CONST
= 4, /* Global allowing SMEM. */
44 AC_ADDR_SPACE_CONST_32BIT
= 6, /* same as CONST, but the pointer type has 32 bits */
47 #define AC_WAIT_LGKM (1 << 0) /* LDS, GDS, constant, message */
48 #define AC_WAIT_VLOAD (1 << 1) /* VMEM load/sample instructions */
49 #define AC_WAIT_VSTORE (1 << 2) /* VMEM store instructions */
52 struct ac_llvm_compiler
;
55 struct ac_llvm_flow_state
{
56 struct ac_llvm_flow
*stack
;
61 struct ac_llvm_context
{
62 LLVMContextRef context
;
64 LLVMBuilderRef builder
;
84 LLVMTypeRef iN_wavemask
;
85 LLVMTypeRef iN_ballotmask
;
102 LLVMValueRef i1false
;
104 /* Since ac_nir_translate makes a local copy of ac_llvm_context, there
105 * are two ac_llvm_contexts. Declare a pointer here, so that the control
106 * flow stack is shared by both ac_llvm_contexts.
108 struct ac_llvm_flow_state
*flow
;
110 unsigned range_md_kind
;
111 unsigned invariant_load_md_kind
;
112 unsigned uniform_md_kind
;
113 unsigned fpmath_md_kind
;
114 LLVMValueRef fpmath_md_2p5_ulp
;
115 LLVMValueRef empty_md
;
117 enum chip_class chip_class
;
118 enum radeon_family family
;
121 unsigned ballot_mask_bits
;
127 ac_llvm_context_init(struct ac_llvm_context
*ctx
,
128 struct ac_llvm_compiler
*compiler
,
129 enum chip_class chip_class
, enum radeon_family family
,
130 enum ac_float_mode float_mode
, unsigned wave_size
,
131 unsigned ballot_mask_bits
);
134 ac_llvm_context_dispose(struct ac_llvm_context
*ctx
);
137 ac_get_llvm_num_components(LLVMValueRef value
);
140 ac_get_elem_bits(struct ac_llvm_context
*ctx
, LLVMTypeRef type
);
143 ac_llvm_extract_elem(struct ac_llvm_context
*ac
,
147 unsigned ac_get_type_size(LLVMTypeRef type
);
149 LLVMTypeRef
ac_to_integer_type(struct ac_llvm_context
*ctx
, LLVMTypeRef t
);
150 LLVMValueRef
ac_to_integer(struct ac_llvm_context
*ctx
, LLVMValueRef v
);
151 LLVMValueRef
ac_to_integer_or_pointer(struct ac_llvm_context
*ctx
, LLVMValueRef v
);
152 LLVMTypeRef
ac_to_float_type(struct ac_llvm_context
*ctx
, LLVMTypeRef t
);
153 LLVMValueRef
ac_to_float(struct ac_llvm_context
*ctx
, LLVMValueRef v
);
156 ac_build_intrinsic(struct ac_llvm_context
*ctx
, const char *name
,
157 LLVMTypeRef return_type
, LLVMValueRef
*params
,
158 unsigned param_count
, unsigned attrib_mask
);
160 void ac_build_type_name_for_intr(LLVMTypeRef type
, char *buf
, unsigned bufsize
);
163 ac_build_phi(struct ac_llvm_context
*ctx
, LLVMTypeRef type
,
164 unsigned count_incoming
, LLVMValueRef
*values
,
165 LLVMBasicBlockRef
*blocks
);
167 void ac_build_s_barrier(struct ac_llvm_context
*ctx
);
168 void ac_build_optimization_barrier(struct ac_llvm_context
*ctx
,
169 LLVMValueRef
*pvgpr
);
171 LLVMValueRef
ac_build_shader_clock(struct ac_llvm_context
*ctx
);
173 LLVMValueRef
ac_build_ballot(struct ac_llvm_context
*ctx
, LLVMValueRef value
);
174 LLVMValueRef
ac_get_i1_sgpr_mask(struct ac_llvm_context
*ctx
,
177 LLVMValueRef
ac_build_vote_all(struct ac_llvm_context
*ctx
, LLVMValueRef value
);
179 LLVMValueRef
ac_build_vote_any(struct ac_llvm_context
*ctx
, LLVMValueRef value
);
181 LLVMValueRef
ac_build_vote_eq(struct ac_llvm_context
*ctx
, LLVMValueRef value
);
184 ac_build_varying_gather_values(struct ac_llvm_context
*ctx
, LLVMValueRef
*values
,
185 unsigned value_count
, unsigned component
);
188 ac_build_gather_values_extended(struct ac_llvm_context
*ctx
,
189 LLVMValueRef
*values
,
190 unsigned value_count
,
191 unsigned value_stride
,
195 ac_build_gather_values(struct ac_llvm_context
*ctx
,
196 LLVMValueRef
*values
,
197 unsigned value_count
);
200 ac_extract_components(struct ac_llvm_context
*ctx
,
205 LLVMValueRef
ac_build_expand_to_vec4(struct ac_llvm_context
*ctx
,
207 unsigned num_channels
);
208 LLVMValueRef
ac_build_round(struct ac_llvm_context
*ctx
, LLVMValueRef value
);
211 ac_build_fdiv(struct ac_llvm_context
*ctx
,
215 LLVMValueRef
ac_build_fast_udiv(struct ac_llvm_context
*ctx
,
217 LLVMValueRef multiplier
,
218 LLVMValueRef pre_shift
,
219 LLVMValueRef post_shift
,
220 LLVMValueRef increment
);
221 LLVMValueRef
ac_build_fast_udiv_nuw(struct ac_llvm_context
*ctx
,
223 LLVMValueRef multiplier
,
224 LLVMValueRef pre_shift
,
225 LLVMValueRef post_shift
,
226 LLVMValueRef increment
);
227 LLVMValueRef
ac_build_fast_udiv_u31_d_not_one(struct ac_llvm_context
*ctx
,
229 LLVMValueRef multiplier
,
230 LLVMValueRef post_shift
);
233 ac_prepare_cube_coords(struct ac_llvm_context
*ctx
,
234 bool is_deriv
, bool is_array
, bool is_lod
,
235 LLVMValueRef
*coords_arg
,
236 LLVMValueRef
*derivs_arg
);
240 ac_build_fs_interp(struct ac_llvm_context
*ctx
,
241 LLVMValueRef llvm_chan
,
242 LLVMValueRef attr_number
,
248 ac_build_fs_interp_f16(struct ac_llvm_context
*ctx
,
249 LLVMValueRef llvm_chan
,
250 LLVMValueRef attr_number
,
256 ac_build_fs_interp_mov(struct ac_llvm_context
*ctx
,
257 LLVMValueRef parameter
,
258 LLVMValueRef llvm_chan
,
259 LLVMValueRef attr_number
,
260 LLVMValueRef params
);
263 ac_build_gep_ptr(struct ac_llvm_context
*ctx
,
264 LLVMValueRef base_ptr
,
268 ac_build_gep0(struct ac_llvm_context
*ctx
,
269 LLVMValueRef base_ptr
,
271 LLVMValueRef
ac_build_pointer_add(struct ac_llvm_context
*ctx
, LLVMValueRef ptr
,
275 ac_build_indexed_store(struct ac_llvm_context
*ctx
,
276 LLVMValueRef base_ptr
, LLVMValueRef index
,
279 LLVMValueRef
ac_build_load(struct ac_llvm_context
*ctx
, LLVMValueRef base_ptr
,
281 LLVMValueRef
ac_build_load_invariant(struct ac_llvm_context
*ctx
,
282 LLVMValueRef base_ptr
, LLVMValueRef index
);
283 LLVMValueRef
ac_build_load_to_sgpr(struct ac_llvm_context
*ctx
,
284 LLVMValueRef base_ptr
, LLVMValueRef index
);
285 LLVMValueRef
ac_build_load_to_sgpr_uint_wraparound(struct ac_llvm_context
*ctx
,
286 LLVMValueRef base_ptr
, LLVMValueRef index
);
289 ac_build_buffer_store_dword(struct ac_llvm_context
*ctx
,
292 unsigned num_channels
,
293 LLVMValueRef voffset
,
294 LLVMValueRef soffset
,
295 unsigned inst_offset
,
296 unsigned cache_policy
,
297 bool swizzle_enable_hint
);
300 ac_build_buffer_store_format(struct ac_llvm_context
*ctx
,
304 LLVMValueRef voffset
,
305 unsigned num_channels
,
306 unsigned cache_policy
);
309 ac_build_buffer_load(struct ac_llvm_context
*ctx
,
313 LLVMValueRef voffset
,
314 LLVMValueRef soffset
,
315 unsigned inst_offset
,
316 unsigned cache_policy
,
320 LLVMValueRef
ac_build_buffer_load_format(struct ac_llvm_context
*ctx
,
323 LLVMValueRef voffset
,
324 unsigned num_channels
,
325 unsigned cache_policy
,
329 ac_build_tbuffer_load_short(struct ac_llvm_context
*ctx
,
331 LLVMValueRef voffset
,
332 LLVMValueRef soffset
,
333 LLVMValueRef immoffset
,
334 unsigned cache_policy
);
337 ac_build_tbuffer_load_byte(struct ac_llvm_context
*ctx
,
339 LLVMValueRef voffset
,
340 LLVMValueRef soffset
,
341 LLVMValueRef immoffset
,
342 unsigned cache_policy
);
345 ac_build_struct_tbuffer_load(struct ac_llvm_context
*ctx
,
348 LLVMValueRef voffset
,
349 LLVMValueRef soffset
,
350 LLVMValueRef immoffset
,
351 unsigned num_channels
,
354 unsigned cache_policy
,
358 ac_build_raw_tbuffer_load(struct ac_llvm_context
*ctx
,
360 LLVMValueRef voffset
,
361 LLVMValueRef soffset
,
362 LLVMValueRef immoffset
,
363 unsigned num_channels
,
366 unsigned cache_policy
,
369 /* For ac_build_fetch_format.
371 * Note: FLOAT must be 0 (used for convenience of encoding in radeonsi).
374 AC_FETCH_FORMAT_FLOAT
= 0,
375 AC_FETCH_FORMAT_FIXED
,
376 AC_FETCH_FORMAT_UNORM
,
377 AC_FETCH_FORMAT_SNORM
,
378 AC_FETCH_FORMAT_USCALED
,
379 AC_FETCH_FORMAT_SSCALED
,
380 AC_FETCH_FORMAT_UINT
,
381 AC_FETCH_FORMAT_SINT
,
385 ac_build_opencoded_load_format(struct ac_llvm_context
*ctx
,
387 unsigned num_channels
,
393 LLVMValueRef voffset
,
394 LLVMValueRef soffset
,
395 unsigned cache_policy
,
399 ac_build_tbuffer_store_short(struct ac_llvm_context
*ctx
,
402 LLVMValueRef voffset
,
403 LLVMValueRef soffset
,
404 unsigned cache_policy
);
407 ac_build_tbuffer_store_byte(struct ac_llvm_context
*ctx
,
410 LLVMValueRef voffset
,
411 LLVMValueRef soffset
,
412 unsigned cache_policy
);
415 ac_build_struct_tbuffer_store(struct ac_llvm_context
*ctx
,
419 LLVMValueRef voffset
,
420 LLVMValueRef soffset
,
421 LLVMValueRef immoffset
,
422 unsigned num_channels
,
425 unsigned cache_policy
);
428 ac_build_raw_tbuffer_store(struct ac_llvm_context
*ctx
,
431 LLVMValueRef voffset
,
432 LLVMValueRef soffset
,
433 LLVMValueRef immoffset
,
434 unsigned num_channels
,
437 unsigned cache_policy
);
440 ac_get_thread_id(struct ac_llvm_context
*ctx
);
442 #define AC_TID_MASK_TOP_LEFT 0xfffffffc
443 #define AC_TID_MASK_TOP 0xfffffffd
444 #define AC_TID_MASK_LEFT 0xfffffffe
447 ac_build_ddxy(struct ac_llvm_context
*ctx
,
452 #define AC_SENDMSG_GS 2
453 #define AC_SENDMSG_GS_DONE 3
454 #define AC_SENDMSG_GS_ALLOC_REQ 9
456 #define AC_SENDMSG_GS_OP_NOP (0 << 4)
457 #define AC_SENDMSG_GS_OP_CUT (1 << 4)
458 #define AC_SENDMSG_GS_OP_EMIT (2 << 4)
459 #define AC_SENDMSG_GS_OP_EMIT_CUT (3 << 4)
461 void ac_build_sendmsg(struct ac_llvm_context
*ctx
,
463 LLVMValueRef wave_id
);
465 LLVMValueRef
ac_build_imsb(struct ac_llvm_context
*ctx
,
467 LLVMTypeRef dst_type
);
469 LLVMValueRef
ac_build_umsb(struct ac_llvm_context
*ctx
,
471 LLVMTypeRef dst_type
);
472 LLVMValueRef
ac_build_fmin(struct ac_llvm_context
*ctx
, LLVMValueRef a
,
474 LLVMValueRef
ac_build_fmax(struct ac_llvm_context
*ctx
, LLVMValueRef a
,
476 LLVMValueRef
ac_build_imin(struct ac_llvm_context
*ctx
, LLVMValueRef a
,
478 LLVMValueRef
ac_build_imax(struct ac_llvm_context
*ctx
, LLVMValueRef a
,
480 LLVMValueRef
ac_build_umin(struct ac_llvm_context
*ctx
, LLVMValueRef a
, LLVMValueRef b
);
481 LLVMValueRef
ac_build_umax(struct ac_llvm_context
*ctx
, LLVMValueRef a
, LLVMValueRef b
);
482 LLVMValueRef
ac_build_clamp(struct ac_llvm_context
*ctx
, LLVMValueRef value
);
484 struct ac_export_args
{
487 unsigned enabled_channels
;
493 void ac_build_export(struct ac_llvm_context
*ctx
, struct ac_export_args
*a
);
495 void ac_build_export_null(struct ac_llvm_context
*ctx
);
497 enum ac_image_opcode
{
505 ac_image_get_resinfo
,
507 ac_image_atomic_cmpswap
,
525 /* These cache policy bits match the definitions used by the LLVM intrinsics. */
526 enum ac_image_cache_policy
{
527 ac_glc
= 1 << 0, /* per-CU cache control */
528 ac_slc
= 1 << 1, /* global L2 cache control */
529 ac_dlc
= 1 << 2, /* per-shader-array cache control */
532 struct ac_image_args
{
533 enum ac_image_opcode opcode
: 4;
534 enum ac_atomic_op atomic
: 4; /* for the ac_image_atomic opcode */
535 enum ac_image_dim dim
: 3;
537 unsigned cache_policy
: 3;
540 unsigned attributes
; /* additional call-site specific AC_FUNC_ATTRs */
542 LLVMValueRef resource
;
543 LLVMValueRef sampler
;
544 LLVMValueRef data
[2]; /* data[0] is source data (vector); data[1] is cmp for cmpswap */
547 LLVMValueRef compare
;
548 LLVMValueRef derivs
[6];
549 LLVMValueRef coords
[4];
550 LLVMValueRef lod
; // also used by ac_image_get_resinfo
553 LLVMValueRef
ac_build_image_opcode(struct ac_llvm_context
*ctx
,
554 struct ac_image_args
*a
);
555 LLVMValueRef
ac_build_image_get_sample_count(struct ac_llvm_context
*ctx
,
557 LLVMValueRef
ac_build_cvt_pkrtz_f16(struct ac_llvm_context
*ctx
,
558 LLVMValueRef args
[2]);
559 LLVMValueRef
ac_build_cvt_pknorm_i16(struct ac_llvm_context
*ctx
,
560 LLVMValueRef args
[2]);
561 LLVMValueRef
ac_build_cvt_pknorm_u16(struct ac_llvm_context
*ctx
,
562 LLVMValueRef args
[2]);
563 LLVMValueRef
ac_build_cvt_pk_i16(struct ac_llvm_context
*ctx
,
564 LLVMValueRef args
[2], unsigned bits
, bool hi
);
565 LLVMValueRef
ac_build_cvt_pk_u16(struct ac_llvm_context
*ctx
,
566 LLVMValueRef args
[2], unsigned bits
, bool hi
);
567 LLVMValueRef
ac_build_wqm_vote(struct ac_llvm_context
*ctx
, LLVMValueRef i1
);
568 void ac_build_kill_if_false(struct ac_llvm_context
*ctx
, LLVMValueRef i1
);
569 LLVMValueRef
ac_build_bfe(struct ac_llvm_context
*ctx
, LLVMValueRef input
,
570 LLVMValueRef offset
, LLVMValueRef width
,
572 LLVMValueRef
ac_build_imad(struct ac_llvm_context
*ctx
, LLVMValueRef s0
,
573 LLVMValueRef s1
, LLVMValueRef s2
);
574 LLVMValueRef
ac_build_fmad(struct ac_llvm_context
*ctx
, LLVMValueRef s0
,
575 LLVMValueRef s1
, LLVMValueRef s2
);
577 void ac_build_waitcnt(struct ac_llvm_context
*ctx
, unsigned wait_flags
);
579 LLVMValueRef
ac_build_fract(struct ac_llvm_context
*ctx
, LLVMValueRef src0
,
582 LLVMValueRef
ac_build_fmed3(struct ac_llvm_context
*ctx
, LLVMValueRef src0
,
583 LLVMValueRef src1
, LLVMValueRef src2
,
586 LLVMValueRef
ac_build_isign(struct ac_llvm_context
*ctx
, LLVMValueRef src0
,
589 LLVMValueRef
ac_build_fsign(struct ac_llvm_context
*ctx
, LLVMValueRef src0
,
592 LLVMValueRef
ac_build_bit_count(struct ac_llvm_context
*ctx
, LLVMValueRef src0
);
594 LLVMValueRef
ac_build_bitfield_reverse(struct ac_llvm_context
*ctx
,
597 void ac_optimize_vs_outputs(struct ac_llvm_context
*ac
,
598 LLVMValueRef main_fn
,
599 uint8_t *vs_output_param_offset
,
600 uint32_t num_outputs
,
601 uint8_t *num_param_exports
);
602 void ac_init_exec_full_mask(struct ac_llvm_context
*ctx
);
604 void ac_declare_lds_as_pointer(struct ac_llvm_context
*ac
);
605 LLVMValueRef
ac_lds_load(struct ac_llvm_context
*ctx
,
606 LLVMValueRef dw_addr
);
607 void ac_lds_store(struct ac_llvm_context
*ctx
,
608 LLVMValueRef dw_addr
, LLVMValueRef value
);
610 LLVMValueRef
ac_find_lsb(struct ac_llvm_context
*ctx
,
611 LLVMTypeRef dst_type
,
614 LLVMTypeRef
ac_array_in_const_addr_space(LLVMTypeRef elem_type
);
615 LLVMTypeRef
ac_array_in_const32_addr_space(LLVMTypeRef elem_type
);
617 void ac_build_bgnloop(struct ac_llvm_context
*ctx
, int lable_id
);
618 void ac_build_break(struct ac_llvm_context
*ctx
);
619 void ac_build_continue(struct ac_llvm_context
*ctx
);
620 void ac_build_else(struct ac_llvm_context
*ctx
, int lable_id
);
621 void ac_build_endif(struct ac_llvm_context
*ctx
, int lable_id
);
622 void ac_build_endloop(struct ac_llvm_context
*ctx
, int lable_id
);
623 void ac_build_ifcc(struct ac_llvm_context
*ctx
, LLVMValueRef cond
, int label_id
);
624 void ac_build_if(struct ac_llvm_context
*ctx
, LLVMValueRef value
,
626 void ac_build_uif(struct ac_llvm_context
*ctx
, LLVMValueRef value
,
629 LLVMValueRef
ac_build_alloca(struct ac_llvm_context
*ac
, LLVMTypeRef type
,
631 LLVMValueRef
ac_build_alloca_undef(struct ac_llvm_context
*ac
, LLVMTypeRef type
,
634 LLVMValueRef
ac_cast_ptr(struct ac_llvm_context
*ctx
, LLVMValueRef ptr
,
637 LLVMValueRef
ac_trim_vector(struct ac_llvm_context
*ctx
, LLVMValueRef value
,
640 LLVMValueRef
ac_unpack_param(struct ac_llvm_context
*ctx
, LLVMValueRef param
,
641 unsigned rshift
, unsigned bitwidth
);
643 void ac_apply_fmask_to_sample(struct ac_llvm_context
*ac
, LLVMValueRef fmask
,
644 LLVMValueRef
*addr
, bool is_array_tex
);
647 ac_build_ds_swizzle(struct ac_llvm_context
*ctx
, LLVMValueRef src
, unsigned mask
);
650 ac_build_readlane(struct ac_llvm_context
*ctx
, LLVMValueRef src
, LLVMValueRef lane
);
653 ac_build_writelane(struct ac_llvm_context
*ctx
, LLVMValueRef src
, LLVMValueRef value
, LLVMValueRef lane
);
656 ac_build_mbcnt(struct ac_llvm_context
*ctx
, LLVMValueRef mask
);
659 ac_build_inclusive_scan(struct ac_llvm_context
*ctx
, LLVMValueRef src
, nir_op op
);
662 ac_build_exclusive_scan(struct ac_llvm_context
*ctx
, LLVMValueRef src
, nir_op op
);
665 ac_build_reduce(struct ac_llvm_context
*ctx
, LLVMValueRef src
, nir_op op
, unsigned cluster_size
);
668 * Common arguments for a scan/reduce operation that accumulates per-wave
669 * values across an entire workgroup, while respecting the order of waves.
673 bool enable_exclusive
;
674 bool enable_inclusive
;
676 LLVMValueRef src
; /* clobbered! */
677 LLVMValueRef result_reduce
;
678 LLVMValueRef result_exclusive
;
679 LLVMValueRef result_inclusive
;
681 LLVMValueRef waveidx
;
682 LLVMValueRef numwaves
; /* only needed for "reduce" operations */
684 /* T addrspace(LDS) pointer to the same type as value, at least maxwaves entries */
685 LLVMValueRef scratch
;
690 ac_build_wg_wavescan_top(struct ac_llvm_context
*ctx
, struct ac_wg_scan
*ws
);
692 ac_build_wg_wavescan_bottom(struct ac_llvm_context
*ctx
, struct ac_wg_scan
*ws
);
694 ac_build_wg_wavescan(struct ac_llvm_context
*ctx
, struct ac_wg_scan
*ws
);
697 ac_build_wg_scan_top(struct ac_llvm_context
*ctx
, struct ac_wg_scan
*ws
);
699 ac_build_wg_scan_bottom(struct ac_llvm_context
*ctx
, struct ac_wg_scan
*ws
);
701 ac_build_wg_scan(struct ac_llvm_context
*ctx
, struct ac_wg_scan
*ws
);
704 ac_build_quad_swizzle(struct ac_llvm_context
*ctx
, LLVMValueRef src
,
705 unsigned lane0
, unsigned lane1
, unsigned lane2
, unsigned lane3
);
708 ac_build_shuffle(struct ac_llvm_context
*ctx
, LLVMValueRef src
, LLVMValueRef index
);
711 ac_build_frexp_exp(struct ac_llvm_context
*ctx
, LLVMValueRef src0
,
715 ac_build_frexp_mant(struct ac_llvm_context
*ctx
, LLVMValueRef src0
,
719 ac_build_ddxy_interp(struct ac_llvm_context
*ctx
, LLVMValueRef interp_ij
);
722 ac_build_load_helper_invocation(struct ac_llvm_context
*ctx
);
724 LLVMValueRef
ac_build_call(struct ac_llvm_context
*ctx
, LLVMValueRef func
,
725 LLVMValueRef
*args
, unsigned num_args
);
727 LLVMValueRef
ac_build_atomic_rmw(struct ac_llvm_context
*ctx
, LLVMAtomicRMWBinOp op
,
728 LLVMValueRef ptr
, LLVMValueRef val
,
729 const char *sync_scope
);
731 LLVMValueRef
ac_build_atomic_cmp_xchg(struct ac_llvm_context
*ctx
, LLVMValueRef ptr
,
732 LLVMValueRef cmp
, LLVMValueRef val
,
733 const char *sync_scope
);
736 ac_export_mrt_z(struct ac_llvm_context
*ctx
, LLVMValueRef depth
,
737 LLVMValueRef stencil
, LLVMValueRef samplemask
,
738 struct ac_export_args
*args
);