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
;
129 ac_llvm_context_init(struct ac_llvm_context
*ctx
,
130 struct ac_llvm_compiler
*compiler
,
131 enum chip_class chip_class
, enum radeon_family family
,
132 enum ac_float_mode float_mode
, unsigned wave_size
,
133 unsigned ballot_mask_bits
);
136 ac_llvm_context_dispose(struct ac_llvm_context
*ctx
);
139 ac_get_llvm_num_components(LLVMValueRef value
);
142 ac_get_elem_bits(struct ac_llvm_context
*ctx
, LLVMTypeRef type
);
145 ac_llvm_extract_elem(struct ac_llvm_context
*ac
,
149 unsigned ac_get_type_size(LLVMTypeRef type
);
151 LLVMTypeRef
ac_to_integer_type(struct ac_llvm_context
*ctx
, LLVMTypeRef t
);
152 LLVMValueRef
ac_to_integer(struct ac_llvm_context
*ctx
, LLVMValueRef v
);
153 LLVMValueRef
ac_to_integer_or_pointer(struct ac_llvm_context
*ctx
, LLVMValueRef v
);
154 LLVMTypeRef
ac_to_float_type(struct ac_llvm_context
*ctx
, LLVMTypeRef t
);
155 LLVMValueRef
ac_to_float(struct ac_llvm_context
*ctx
, LLVMValueRef v
);
158 ac_build_intrinsic(struct ac_llvm_context
*ctx
, const char *name
,
159 LLVMTypeRef return_type
, LLVMValueRef
*params
,
160 unsigned param_count
, unsigned attrib_mask
);
162 void ac_build_type_name_for_intr(LLVMTypeRef type
, char *buf
, unsigned bufsize
);
165 ac_build_phi(struct ac_llvm_context
*ctx
, LLVMTypeRef type
,
166 unsigned count_incoming
, LLVMValueRef
*values
,
167 LLVMBasicBlockRef
*blocks
);
169 void ac_build_s_barrier(struct ac_llvm_context
*ctx
);
170 void ac_build_optimization_barrier(struct ac_llvm_context
*ctx
,
171 LLVMValueRef
*pvgpr
);
173 LLVMValueRef
ac_build_shader_clock(struct ac_llvm_context
*ctx
);
175 LLVMValueRef
ac_build_ballot(struct ac_llvm_context
*ctx
, LLVMValueRef value
);
176 LLVMValueRef
ac_get_i1_sgpr_mask(struct ac_llvm_context
*ctx
,
179 LLVMValueRef
ac_build_vote_all(struct ac_llvm_context
*ctx
, LLVMValueRef value
);
181 LLVMValueRef
ac_build_vote_any(struct ac_llvm_context
*ctx
, LLVMValueRef value
);
183 LLVMValueRef
ac_build_vote_eq(struct ac_llvm_context
*ctx
, LLVMValueRef value
);
186 ac_build_varying_gather_values(struct ac_llvm_context
*ctx
, LLVMValueRef
*values
,
187 unsigned value_count
, unsigned component
);
190 ac_build_gather_values_extended(struct ac_llvm_context
*ctx
,
191 LLVMValueRef
*values
,
192 unsigned value_count
,
193 unsigned value_stride
,
197 ac_build_gather_values(struct ac_llvm_context
*ctx
,
198 LLVMValueRef
*values
,
199 unsigned value_count
);
202 ac_extract_components(struct ac_llvm_context
*ctx
,
207 LLVMValueRef
ac_build_expand_to_vec4(struct ac_llvm_context
*ctx
,
209 unsigned num_channels
);
210 LLVMValueRef
ac_build_round(struct ac_llvm_context
*ctx
, LLVMValueRef value
);
213 ac_build_fdiv(struct ac_llvm_context
*ctx
,
217 LLVMValueRef
ac_build_fast_udiv(struct ac_llvm_context
*ctx
,
219 LLVMValueRef multiplier
,
220 LLVMValueRef pre_shift
,
221 LLVMValueRef post_shift
,
222 LLVMValueRef increment
);
223 LLVMValueRef
ac_build_fast_udiv_nuw(struct ac_llvm_context
*ctx
,
225 LLVMValueRef multiplier
,
226 LLVMValueRef pre_shift
,
227 LLVMValueRef post_shift
,
228 LLVMValueRef increment
);
229 LLVMValueRef
ac_build_fast_udiv_u31_d_not_one(struct ac_llvm_context
*ctx
,
231 LLVMValueRef multiplier
,
232 LLVMValueRef post_shift
);
235 ac_prepare_cube_coords(struct ac_llvm_context
*ctx
,
236 bool is_deriv
, bool is_array
, bool is_lod
,
237 LLVMValueRef
*coords_arg
,
238 LLVMValueRef
*derivs_arg
);
242 ac_build_fs_interp(struct ac_llvm_context
*ctx
,
243 LLVMValueRef llvm_chan
,
244 LLVMValueRef attr_number
,
250 ac_build_fs_interp_f16(struct ac_llvm_context
*ctx
,
251 LLVMValueRef llvm_chan
,
252 LLVMValueRef attr_number
,
258 ac_build_fs_interp_mov(struct ac_llvm_context
*ctx
,
259 LLVMValueRef parameter
,
260 LLVMValueRef llvm_chan
,
261 LLVMValueRef attr_number
,
262 LLVMValueRef params
);
265 ac_build_gep_ptr(struct ac_llvm_context
*ctx
,
266 LLVMValueRef base_ptr
,
270 ac_build_gep0(struct ac_llvm_context
*ctx
,
271 LLVMValueRef base_ptr
,
273 LLVMValueRef
ac_build_pointer_add(struct ac_llvm_context
*ctx
, LLVMValueRef ptr
,
277 ac_build_indexed_store(struct ac_llvm_context
*ctx
,
278 LLVMValueRef base_ptr
, LLVMValueRef index
,
281 LLVMValueRef
ac_build_load(struct ac_llvm_context
*ctx
, LLVMValueRef base_ptr
,
283 LLVMValueRef
ac_build_load_invariant(struct ac_llvm_context
*ctx
,
284 LLVMValueRef base_ptr
, LLVMValueRef index
);
285 LLVMValueRef
ac_build_load_to_sgpr(struct ac_llvm_context
*ctx
,
286 LLVMValueRef base_ptr
, LLVMValueRef index
);
287 LLVMValueRef
ac_build_load_to_sgpr_uint_wraparound(struct ac_llvm_context
*ctx
,
288 LLVMValueRef base_ptr
, LLVMValueRef index
);
291 ac_build_buffer_store_dword(struct ac_llvm_context
*ctx
,
294 unsigned num_channels
,
295 LLVMValueRef voffset
,
296 LLVMValueRef soffset
,
297 unsigned inst_offset
,
298 unsigned cache_policy
,
299 bool swizzle_enable_hint
);
302 ac_build_buffer_store_format(struct ac_llvm_context
*ctx
,
306 LLVMValueRef voffset
,
307 unsigned num_channels
,
308 unsigned cache_policy
);
311 ac_build_buffer_load(struct ac_llvm_context
*ctx
,
315 LLVMValueRef voffset
,
316 LLVMValueRef soffset
,
317 unsigned inst_offset
,
318 unsigned cache_policy
,
322 LLVMValueRef
ac_build_buffer_load_format(struct ac_llvm_context
*ctx
,
325 LLVMValueRef voffset
,
326 unsigned num_channels
,
327 unsigned cache_policy
,
331 ac_build_tbuffer_load_short(struct ac_llvm_context
*ctx
,
333 LLVMValueRef voffset
,
334 LLVMValueRef soffset
,
335 LLVMValueRef immoffset
,
336 unsigned cache_policy
);
339 ac_build_tbuffer_load_byte(struct ac_llvm_context
*ctx
,
341 LLVMValueRef voffset
,
342 LLVMValueRef soffset
,
343 LLVMValueRef immoffset
,
344 unsigned cache_policy
);
347 ac_build_struct_tbuffer_load(struct ac_llvm_context
*ctx
,
350 LLVMValueRef voffset
,
351 LLVMValueRef soffset
,
352 LLVMValueRef immoffset
,
353 unsigned num_channels
,
356 unsigned cache_policy
,
360 ac_build_raw_tbuffer_load(struct ac_llvm_context
*ctx
,
362 LLVMValueRef voffset
,
363 LLVMValueRef soffset
,
364 LLVMValueRef immoffset
,
365 unsigned num_channels
,
368 unsigned cache_policy
,
371 /* For ac_build_fetch_format.
373 * Note: FLOAT must be 0 (used for convenience of encoding in radeonsi).
376 AC_FETCH_FORMAT_FLOAT
= 0,
377 AC_FETCH_FORMAT_FIXED
,
378 AC_FETCH_FORMAT_UNORM
,
379 AC_FETCH_FORMAT_SNORM
,
380 AC_FETCH_FORMAT_USCALED
,
381 AC_FETCH_FORMAT_SSCALED
,
382 AC_FETCH_FORMAT_UINT
,
383 AC_FETCH_FORMAT_SINT
,
387 ac_build_opencoded_load_format(struct ac_llvm_context
*ctx
,
389 unsigned num_channels
,
395 LLVMValueRef voffset
,
396 LLVMValueRef soffset
,
397 unsigned cache_policy
,
401 ac_build_tbuffer_store_short(struct ac_llvm_context
*ctx
,
404 LLVMValueRef voffset
,
405 LLVMValueRef soffset
,
406 unsigned cache_policy
);
409 ac_build_tbuffer_store_byte(struct ac_llvm_context
*ctx
,
412 LLVMValueRef voffset
,
413 LLVMValueRef soffset
,
414 unsigned cache_policy
);
417 ac_build_struct_tbuffer_store(struct ac_llvm_context
*ctx
,
421 LLVMValueRef voffset
,
422 LLVMValueRef soffset
,
423 LLVMValueRef immoffset
,
424 unsigned num_channels
,
427 unsigned cache_policy
);
430 ac_build_raw_tbuffer_store(struct ac_llvm_context
*ctx
,
433 LLVMValueRef voffset
,
434 LLVMValueRef soffset
,
435 LLVMValueRef immoffset
,
436 unsigned num_channels
,
439 unsigned cache_policy
);
442 ac_get_thread_id(struct ac_llvm_context
*ctx
);
444 #define AC_TID_MASK_TOP_LEFT 0xfffffffc
445 #define AC_TID_MASK_TOP 0xfffffffd
446 #define AC_TID_MASK_LEFT 0xfffffffe
449 ac_build_ddxy(struct ac_llvm_context
*ctx
,
454 #define AC_SENDMSG_GS 2
455 #define AC_SENDMSG_GS_DONE 3
456 #define AC_SENDMSG_GS_ALLOC_REQ 9
458 #define AC_SENDMSG_GS_OP_NOP (0 << 4)
459 #define AC_SENDMSG_GS_OP_CUT (1 << 4)
460 #define AC_SENDMSG_GS_OP_EMIT (2 << 4)
461 #define AC_SENDMSG_GS_OP_EMIT_CUT (3 << 4)
463 void ac_build_sendmsg(struct ac_llvm_context
*ctx
,
465 LLVMValueRef wave_id
);
467 LLVMValueRef
ac_build_imsb(struct ac_llvm_context
*ctx
,
469 LLVMTypeRef dst_type
);
471 LLVMValueRef
ac_build_umsb(struct ac_llvm_context
*ctx
,
473 LLVMTypeRef dst_type
);
474 LLVMValueRef
ac_build_fmin(struct ac_llvm_context
*ctx
, LLVMValueRef a
,
476 LLVMValueRef
ac_build_fmax(struct ac_llvm_context
*ctx
, LLVMValueRef a
,
478 LLVMValueRef
ac_build_imin(struct ac_llvm_context
*ctx
, LLVMValueRef a
,
480 LLVMValueRef
ac_build_imax(struct ac_llvm_context
*ctx
, LLVMValueRef a
,
482 LLVMValueRef
ac_build_umin(struct ac_llvm_context
*ctx
, LLVMValueRef a
, LLVMValueRef b
);
483 LLVMValueRef
ac_build_umax(struct ac_llvm_context
*ctx
, LLVMValueRef a
, LLVMValueRef b
);
484 LLVMValueRef
ac_build_clamp(struct ac_llvm_context
*ctx
, LLVMValueRef value
);
486 struct ac_export_args
{
489 unsigned enabled_channels
;
495 void ac_build_export(struct ac_llvm_context
*ctx
, struct ac_export_args
*a
);
497 void ac_build_export_null(struct ac_llvm_context
*ctx
);
499 enum ac_image_opcode
{
507 ac_image_get_resinfo
,
509 ac_image_atomic_cmpswap
,
527 /* These cache policy bits match the definitions used by the LLVM intrinsics. */
528 enum ac_image_cache_policy
{
529 ac_glc
= 1 << 0, /* per-CU cache control */
530 ac_slc
= 1 << 1, /* global L2 cache control */
531 ac_dlc
= 1 << 2, /* per-shader-array cache control */
534 struct ac_image_args
{
535 enum ac_image_opcode opcode
: 4;
536 enum ac_atomic_op atomic
: 4; /* for the ac_image_atomic opcode */
537 enum ac_image_dim dim
: 3;
539 unsigned cache_policy
: 3;
542 unsigned attributes
; /* additional call-site specific AC_FUNC_ATTRs */
544 LLVMValueRef resource
;
545 LLVMValueRef sampler
;
546 LLVMValueRef data
[2]; /* data[0] is source data (vector); data[1] is cmp for cmpswap */
549 LLVMValueRef compare
;
550 LLVMValueRef derivs
[6];
551 LLVMValueRef coords
[4];
552 LLVMValueRef lod
; // also used by ac_image_get_resinfo
555 LLVMValueRef
ac_build_image_opcode(struct ac_llvm_context
*ctx
,
556 struct ac_image_args
*a
);
557 LLVMValueRef
ac_build_image_get_sample_count(struct ac_llvm_context
*ctx
,
559 LLVMValueRef
ac_build_cvt_pkrtz_f16(struct ac_llvm_context
*ctx
,
560 LLVMValueRef args
[2]);
561 LLVMValueRef
ac_build_cvt_pknorm_i16(struct ac_llvm_context
*ctx
,
562 LLVMValueRef args
[2]);
563 LLVMValueRef
ac_build_cvt_pknorm_u16(struct ac_llvm_context
*ctx
,
564 LLVMValueRef args
[2]);
565 LLVMValueRef
ac_build_cvt_pk_i16(struct ac_llvm_context
*ctx
,
566 LLVMValueRef args
[2], unsigned bits
, bool hi
);
567 LLVMValueRef
ac_build_cvt_pk_u16(struct ac_llvm_context
*ctx
,
568 LLVMValueRef args
[2], unsigned bits
, bool hi
);
569 LLVMValueRef
ac_build_wqm_vote(struct ac_llvm_context
*ctx
, LLVMValueRef i1
);
570 void ac_build_kill_if_false(struct ac_llvm_context
*ctx
, LLVMValueRef i1
);
571 LLVMValueRef
ac_build_bfe(struct ac_llvm_context
*ctx
, LLVMValueRef input
,
572 LLVMValueRef offset
, LLVMValueRef width
,
574 LLVMValueRef
ac_build_imad(struct ac_llvm_context
*ctx
, LLVMValueRef s0
,
575 LLVMValueRef s1
, LLVMValueRef s2
);
576 LLVMValueRef
ac_build_fmad(struct ac_llvm_context
*ctx
, LLVMValueRef s0
,
577 LLVMValueRef s1
, LLVMValueRef s2
);
579 void ac_build_waitcnt(struct ac_llvm_context
*ctx
, unsigned wait_flags
);
581 LLVMValueRef
ac_build_fract(struct ac_llvm_context
*ctx
, LLVMValueRef src0
,
584 LLVMValueRef
ac_build_fmed3(struct ac_llvm_context
*ctx
, LLVMValueRef src0
,
585 LLVMValueRef src1
, LLVMValueRef src2
,
588 LLVMValueRef
ac_build_isign(struct ac_llvm_context
*ctx
, LLVMValueRef src0
,
591 LLVMValueRef
ac_build_fsign(struct ac_llvm_context
*ctx
, LLVMValueRef src0
,
594 LLVMValueRef
ac_build_bit_count(struct ac_llvm_context
*ctx
, LLVMValueRef src0
);
596 LLVMValueRef
ac_build_bitfield_reverse(struct ac_llvm_context
*ctx
,
599 void ac_optimize_vs_outputs(struct ac_llvm_context
*ac
,
600 LLVMValueRef main_fn
,
601 uint8_t *vs_output_param_offset
,
602 uint32_t num_outputs
,
603 uint8_t *num_param_exports
);
604 void ac_init_exec_full_mask(struct ac_llvm_context
*ctx
);
606 void ac_declare_lds_as_pointer(struct ac_llvm_context
*ac
);
607 LLVMValueRef
ac_lds_load(struct ac_llvm_context
*ctx
,
608 LLVMValueRef dw_addr
);
609 void ac_lds_store(struct ac_llvm_context
*ctx
,
610 LLVMValueRef dw_addr
, LLVMValueRef value
);
612 LLVMValueRef
ac_find_lsb(struct ac_llvm_context
*ctx
,
613 LLVMTypeRef dst_type
,
616 LLVMTypeRef
ac_array_in_const_addr_space(LLVMTypeRef elem_type
);
617 LLVMTypeRef
ac_array_in_const32_addr_space(LLVMTypeRef elem_type
);
619 void ac_build_bgnloop(struct ac_llvm_context
*ctx
, int lable_id
);
620 void ac_build_break(struct ac_llvm_context
*ctx
);
621 void ac_build_continue(struct ac_llvm_context
*ctx
);
622 void ac_build_else(struct ac_llvm_context
*ctx
, int lable_id
);
623 void ac_build_endif(struct ac_llvm_context
*ctx
, int lable_id
);
624 void ac_build_endloop(struct ac_llvm_context
*ctx
, int lable_id
);
625 void ac_build_ifcc(struct ac_llvm_context
*ctx
, LLVMValueRef cond
, int label_id
);
626 void ac_build_if(struct ac_llvm_context
*ctx
, LLVMValueRef value
,
628 void ac_build_uif(struct ac_llvm_context
*ctx
, LLVMValueRef value
,
631 LLVMValueRef
ac_build_alloca(struct ac_llvm_context
*ac
, LLVMTypeRef type
,
633 LLVMValueRef
ac_build_alloca_undef(struct ac_llvm_context
*ac
, LLVMTypeRef type
,
636 LLVMValueRef
ac_cast_ptr(struct ac_llvm_context
*ctx
, LLVMValueRef ptr
,
639 LLVMValueRef
ac_trim_vector(struct ac_llvm_context
*ctx
, LLVMValueRef value
,
642 LLVMValueRef
ac_unpack_param(struct ac_llvm_context
*ctx
, LLVMValueRef param
,
643 unsigned rshift
, unsigned bitwidth
);
645 void ac_apply_fmask_to_sample(struct ac_llvm_context
*ac
, LLVMValueRef fmask
,
646 LLVMValueRef
*addr
, bool is_array_tex
);
649 ac_build_ds_swizzle(struct ac_llvm_context
*ctx
, LLVMValueRef src
, unsigned mask
);
652 ac_build_readlane(struct ac_llvm_context
*ctx
, LLVMValueRef src
, LLVMValueRef lane
);
655 ac_build_writelane(struct ac_llvm_context
*ctx
, LLVMValueRef src
, LLVMValueRef value
, LLVMValueRef lane
);
658 ac_build_mbcnt(struct ac_llvm_context
*ctx
, LLVMValueRef mask
);
661 ac_build_inclusive_scan(struct ac_llvm_context
*ctx
, LLVMValueRef src
, nir_op op
);
664 ac_build_exclusive_scan(struct ac_llvm_context
*ctx
, LLVMValueRef src
, nir_op op
);
667 ac_build_reduce(struct ac_llvm_context
*ctx
, LLVMValueRef src
, nir_op op
, unsigned cluster_size
);
670 * Common arguments for a scan/reduce operation that accumulates per-wave
671 * values across an entire workgroup, while respecting the order of waves.
675 bool enable_exclusive
;
676 bool enable_inclusive
;
678 LLVMValueRef src
; /* clobbered! */
679 LLVMValueRef result_reduce
;
680 LLVMValueRef result_exclusive
;
681 LLVMValueRef result_inclusive
;
683 LLVMValueRef waveidx
;
684 LLVMValueRef numwaves
; /* only needed for "reduce" operations */
686 /* T addrspace(LDS) pointer to the same type as value, at least maxwaves entries */
687 LLVMValueRef scratch
;
692 ac_build_wg_wavescan_top(struct ac_llvm_context
*ctx
, struct ac_wg_scan
*ws
);
694 ac_build_wg_wavescan_bottom(struct ac_llvm_context
*ctx
, struct ac_wg_scan
*ws
);
696 ac_build_wg_wavescan(struct ac_llvm_context
*ctx
, struct ac_wg_scan
*ws
);
699 ac_build_wg_scan_top(struct ac_llvm_context
*ctx
, struct ac_wg_scan
*ws
);
701 ac_build_wg_scan_bottom(struct ac_llvm_context
*ctx
, struct ac_wg_scan
*ws
);
703 ac_build_wg_scan(struct ac_llvm_context
*ctx
, struct ac_wg_scan
*ws
);
706 ac_build_quad_swizzle(struct ac_llvm_context
*ctx
, LLVMValueRef src
,
707 unsigned lane0
, unsigned lane1
, unsigned lane2
, unsigned lane3
);
710 ac_build_shuffle(struct ac_llvm_context
*ctx
, LLVMValueRef src
, LLVMValueRef index
);
713 ac_build_frexp_exp(struct ac_llvm_context
*ctx
, LLVMValueRef src0
,
717 ac_build_frexp_mant(struct ac_llvm_context
*ctx
, LLVMValueRef src0
,
721 ac_build_canonicalize(struct ac_llvm_context
*ctx
, LLVMValueRef src0
,
725 ac_build_ddxy_interp(struct ac_llvm_context
*ctx
, LLVMValueRef interp_ij
);
728 ac_build_load_helper_invocation(struct ac_llvm_context
*ctx
);
730 LLVMValueRef
ac_build_call(struct ac_llvm_context
*ctx
, LLVMValueRef func
,
731 LLVMValueRef
*args
, unsigned num_args
);
733 LLVMValueRef
ac_build_atomic_rmw(struct ac_llvm_context
*ctx
, LLVMAtomicRMWBinOp op
,
734 LLVMValueRef ptr
, LLVMValueRef val
,
735 const char *sync_scope
);
737 LLVMValueRef
ac_build_atomic_cmp_xchg(struct ac_llvm_context
*ctx
, LLVMValueRef ptr
,
738 LLVMValueRef cmp
, LLVMValueRef val
,
739 const char *sync_scope
);
742 ac_export_mrt_z(struct ac_llvm_context
*ctx
, LLVMValueRef depth
,
743 LLVMValueRef stencil
, LLVMValueRef samplemask
,
744 struct ac_export_args
*args
);