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
;
84 LLVMTypeRef iN_ballotmask
;
101 LLVMValueRef i1false
;
103 /* Since ac_nir_translate makes a local copy of ac_llvm_context, there
104 * are two ac_llvm_contexts. Declare a pointer here, so that the control
105 * flow stack is shared by both ac_llvm_contexts.
107 struct ac_llvm_flow_state
*flow
;
109 unsigned range_md_kind
;
110 unsigned invariant_load_md_kind
;
111 unsigned uniform_md_kind
;
112 unsigned fpmath_md_kind
;
113 LLVMValueRef fpmath_md_2p5_ulp
;
114 LLVMValueRef empty_md
;
116 enum chip_class chip_class
;
117 enum radeon_family family
;
120 unsigned ballot_mask_bits
;
126 ac_llvm_context_init(struct ac_llvm_context
*ctx
,
127 struct ac_llvm_compiler
*compiler
,
128 enum chip_class chip_class
, enum radeon_family family
,
129 enum ac_float_mode float_mode
, unsigned wave_size
,
130 unsigned ballot_mask_bits
);
133 ac_llvm_context_dispose(struct ac_llvm_context
*ctx
);
136 ac_get_llvm_num_components(LLVMValueRef value
);
139 ac_get_elem_bits(struct ac_llvm_context
*ctx
, LLVMTypeRef type
);
142 ac_llvm_extract_elem(struct ac_llvm_context
*ac
,
146 unsigned ac_get_type_size(LLVMTypeRef type
);
148 LLVMTypeRef
ac_to_integer_type(struct ac_llvm_context
*ctx
, LLVMTypeRef t
);
149 LLVMValueRef
ac_to_integer(struct ac_llvm_context
*ctx
, LLVMValueRef v
);
150 LLVMValueRef
ac_to_integer_or_pointer(struct ac_llvm_context
*ctx
, LLVMValueRef v
);
151 LLVMTypeRef
ac_to_float_type(struct ac_llvm_context
*ctx
, LLVMTypeRef t
);
152 LLVMValueRef
ac_to_float(struct ac_llvm_context
*ctx
, LLVMValueRef v
);
155 ac_build_intrinsic(struct ac_llvm_context
*ctx
, const char *name
,
156 LLVMTypeRef return_type
, LLVMValueRef
*params
,
157 unsigned param_count
, unsigned attrib_mask
);
159 void ac_build_type_name_for_intr(LLVMTypeRef type
, char *buf
, unsigned bufsize
);
162 ac_build_phi(struct ac_llvm_context
*ctx
, LLVMTypeRef type
,
163 unsigned count_incoming
, LLVMValueRef
*values
,
164 LLVMBasicBlockRef
*blocks
);
166 void ac_build_s_barrier(struct ac_llvm_context
*ctx
);
167 void ac_build_optimization_barrier(struct ac_llvm_context
*ctx
,
168 LLVMValueRef
*pvgpr
);
170 LLVMValueRef
ac_build_shader_clock(struct ac_llvm_context
*ctx
);
172 LLVMValueRef
ac_build_ballot(struct ac_llvm_context
*ctx
, LLVMValueRef value
);
173 LLVMValueRef
ac_get_i1_sgpr_mask(struct ac_llvm_context
*ctx
,
176 LLVMValueRef
ac_build_vote_all(struct ac_llvm_context
*ctx
, LLVMValueRef value
);
178 LLVMValueRef
ac_build_vote_any(struct ac_llvm_context
*ctx
, LLVMValueRef value
);
180 LLVMValueRef
ac_build_vote_eq(struct ac_llvm_context
*ctx
, LLVMValueRef value
);
183 ac_build_varying_gather_values(struct ac_llvm_context
*ctx
, LLVMValueRef
*values
,
184 unsigned value_count
, unsigned component
);
187 ac_build_gather_values_extended(struct ac_llvm_context
*ctx
,
188 LLVMValueRef
*values
,
189 unsigned value_count
,
190 unsigned value_stride
,
194 ac_build_gather_values(struct ac_llvm_context
*ctx
,
195 LLVMValueRef
*values
,
196 unsigned value_count
);
199 ac_extract_components(struct ac_llvm_context
*ctx
,
204 LLVMValueRef
ac_build_expand_to_vec4(struct ac_llvm_context
*ctx
,
206 unsigned num_channels
);
207 LLVMValueRef
ac_build_round(struct ac_llvm_context
*ctx
, LLVMValueRef value
);
210 ac_build_fdiv(struct ac_llvm_context
*ctx
,
214 LLVMValueRef
ac_build_fast_udiv(struct ac_llvm_context
*ctx
,
216 LLVMValueRef multiplier
,
217 LLVMValueRef pre_shift
,
218 LLVMValueRef post_shift
,
219 LLVMValueRef increment
);
220 LLVMValueRef
ac_build_fast_udiv_nuw(struct ac_llvm_context
*ctx
,
222 LLVMValueRef multiplier
,
223 LLVMValueRef pre_shift
,
224 LLVMValueRef post_shift
,
225 LLVMValueRef increment
);
226 LLVMValueRef
ac_build_fast_udiv_u31_d_not_one(struct ac_llvm_context
*ctx
,
228 LLVMValueRef multiplier
,
229 LLVMValueRef post_shift
);
232 ac_prepare_cube_coords(struct ac_llvm_context
*ctx
,
233 bool is_deriv
, bool is_array
, bool is_lod
,
234 LLVMValueRef
*coords_arg
,
235 LLVMValueRef
*derivs_arg
);
239 ac_build_fs_interp(struct ac_llvm_context
*ctx
,
240 LLVMValueRef llvm_chan
,
241 LLVMValueRef attr_number
,
247 ac_build_fs_interp_f16(struct ac_llvm_context
*ctx
,
248 LLVMValueRef llvm_chan
,
249 LLVMValueRef attr_number
,
255 ac_build_fs_interp_mov(struct ac_llvm_context
*ctx
,
256 LLVMValueRef parameter
,
257 LLVMValueRef llvm_chan
,
258 LLVMValueRef attr_number
,
259 LLVMValueRef params
);
262 ac_build_gep_ptr(struct ac_llvm_context
*ctx
,
263 LLVMValueRef base_ptr
,
267 ac_build_gep0(struct ac_llvm_context
*ctx
,
268 LLVMValueRef base_ptr
,
270 LLVMValueRef
ac_build_pointer_add(struct ac_llvm_context
*ctx
, LLVMValueRef ptr
,
274 ac_build_indexed_store(struct ac_llvm_context
*ctx
,
275 LLVMValueRef base_ptr
, LLVMValueRef index
,
278 LLVMValueRef
ac_build_load(struct ac_llvm_context
*ctx
, LLVMValueRef base_ptr
,
280 LLVMValueRef
ac_build_load_invariant(struct ac_llvm_context
*ctx
,
281 LLVMValueRef base_ptr
, LLVMValueRef index
);
282 LLVMValueRef
ac_build_load_to_sgpr(struct ac_llvm_context
*ctx
,
283 LLVMValueRef base_ptr
, LLVMValueRef index
);
284 LLVMValueRef
ac_build_load_to_sgpr_uint_wraparound(struct ac_llvm_context
*ctx
,
285 LLVMValueRef base_ptr
, LLVMValueRef index
);
288 ac_build_buffer_store_dword(struct ac_llvm_context
*ctx
,
291 unsigned num_channels
,
292 LLVMValueRef voffset
,
293 LLVMValueRef soffset
,
294 unsigned inst_offset
,
295 unsigned cache_policy
,
296 bool swizzle_enable_hint
);
299 ac_build_buffer_store_format(struct ac_llvm_context
*ctx
,
303 LLVMValueRef voffset
,
304 unsigned num_channels
,
305 unsigned cache_policy
);
308 ac_build_buffer_load(struct ac_llvm_context
*ctx
,
312 LLVMValueRef voffset
,
313 LLVMValueRef soffset
,
314 unsigned inst_offset
,
315 unsigned cache_policy
,
319 LLVMValueRef
ac_build_buffer_load_format(struct ac_llvm_context
*ctx
,
322 LLVMValueRef voffset
,
323 unsigned num_channels
,
324 unsigned cache_policy
,
328 ac_build_tbuffer_load_short(struct ac_llvm_context
*ctx
,
330 LLVMValueRef voffset
,
331 LLVMValueRef soffset
,
332 LLVMValueRef immoffset
,
333 unsigned cache_policy
);
336 ac_build_tbuffer_load_byte(struct ac_llvm_context
*ctx
,
338 LLVMValueRef voffset
,
339 LLVMValueRef soffset
,
340 LLVMValueRef immoffset
,
341 unsigned cache_policy
);
344 ac_build_struct_tbuffer_load(struct ac_llvm_context
*ctx
,
347 LLVMValueRef voffset
,
348 LLVMValueRef soffset
,
349 LLVMValueRef immoffset
,
350 unsigned num_channels
,
353 unsigned cache_policy
,
357 ac_build_raw_tbuffer_load(struct ac_llvm_context
*ctx
,
359 LLVMValueRef voffset
,
360 LLVMValueRef soffset
,
361 LLVMValueRef immoffset
,
362 unsigned num_channels
,
365 unsigned cache_policy
,
368 /* For ac_build_fetch_format.
370 * Note: FLOAT must be 0 (used for convenience of encoding in radeonsi).
373 AC_FETCH_FORMAT_FLOAT
= 0,
374 AC_FETCH_FORMAT_FIXED
,
375 AC_FETCH_FORMAT_UNORM
,
376 AC_FETCH_FORMAT_SNORM
,
377 AC_FETCH_FORMAT_USCALED
,
378 AC_FETCH_FORMAT_SSCALED
,
379 AC_FETCH_FORMAT_UINT
,
380 AC_FETCH_FORMAT_SINT
,
384 ac_build_opencoded_load_format(struct ac_llvm_context
*ctx
,
386 unsigned num_channels
,
392 LLVMValueRef voffset
,
393 LLVMValueRef soffset
,
394 unsigned cache_policy
,
398 ac_build_tbuffer_store_short(struct ac_llvm_context
*ctx
,
401 LLVMValueRef voffset
,
402 LLVMValueRef soffset
,
403 unsigned cache_policy
);
406 ac_build_tbuffer_store_byte(struct ac_llvm_context
*ctx
,
409 LLVMValueRef voffset
,
410 LLVMValueRef soffset
,
411 unsigned cache_policy
);
414 ac_build_struct_tbuffer_store(struct ac_llvm_context
*ctx
,
418 LLVMValueRef voffset
,
419 LLVMValueRef soffset
,
420 LLVMValueRef immoffset
,
421 unsigned num_channels
,
424 unsigned cache_policy
);
427 ac_build_raw_tbuffer_store(struct ac_llvm_context
*ctx
,
430 LLVMValueRef voffset
,
431 LLVMValueRef soffset
,
432 LLVMValueRef immoffset
,
433 unsigned num_channels
,
436 unsigned cache_policy
);
439 ac_get_thread_id(struct ac_llvm_context
*ctx
);
441 #define AC_TID_MASK_TOP_LEFT 0xfffffffc
442 #define AC_TID_MASK_TOP 0xfffffffd
443 #define AC_TID_MASK_LEFT 0xfffffffe
446 ac_build_ddxy(struct ac_llvm_context
*ctx
,
451 #define AC_SENDMSG_GS 2
452 #define AC_SENDMSG_GS_DONE 3
453 #define AC_SENDMSG_GS_ALLOC_REQ 9
455 #define AC_SENDMSG_GS_OP_NOP (0 << 4)
456 #define AC_SENDMSG_GS_OP_CUT (1 << 4)
457 #define AC_SENDMSG_GS_OP_EMIT (2 << 4)
458 #define AC_SENDMSG_GS_OP_EMIT_CUT (3 << 4)
460 void ac_build_sendmsg(struct ac_llvm_context
*ctx
,
462 LLVMValueRef wave_id
);
464 LLVMValueRef
ac_build_imsb(struct ac_llvm_context
*ctx
,
466 LLVMTypeRef dst_type
);
468 LLVMValueRef
ac_build_umsb(struct ac_llvm_context
*ctx
,
470 LLVMTypeRef dst_type
);
471 LLVMValueRef
ac_build_fmin(struct ac_llvm_context
*ctx
, LLVMValueRef a
,
473 LLVMValueRef
ac_build_fmax(struct ac_llvm_context
*ctx
, LLVMValueRef a
,
475 LLVMValueRef
ac_build_imin(struct ac_llvm_context
*ctx
, LLVMValueRef a
,
477 LLVMValueRef
ac_build_imax(struct ac_llvm_context
*ctx
, LLVMValueRef a
,
479 LLVMValueRef
ac_build_umin(struct ac_llvm_context
*ctx
, LLVMValueRef a
, LLVMValueRef b
);
480 LLVMValueRef
ac_build_umax(struct ac_llvm_context
*ctx
, LLVMValueRef a
, LLVMValueRef b
);
481 LLVMValueRef
ac_build_clamp(struct ac_llvm_context
*ctx
, LLVMValueRef value
);
483 struct ac_export_args
{
486 unsigned enabled_channels
;
492 void ac_build_export(struct ac_llvm_context
*ctx
, struct ac_export_args
*a
);
494 void ac_build_export_null(struct ac_llvm_context
*ctx
);
496 enum ac_image_opcode
{
504 ac_image_get_resinfo
,
506 ac_image_atomic_cmpswap
,
528 ac_image_cube
, // includes cube arrays
532 ac_image_2darraymsaa
,
535 /* These cache policy bits match the definitions used by the LLVM intrinsics. */
536 enum ac_image_cache_policy
{
537 ac_glc
= 1 << 0, /* per-CU cache control */
538 ac_slc
= 1 << 1, /* global L2 cache control */
539 ac_dlc
= 1 << 2, /* per-shader-array cache control */
542 struct ac_image_args
{
543 enum ac_image_opcode opcode
: 4;
544 enum ac_atomic_op atomic
: 4; /* for the ac_image_atomic opcode */
545 enum ac_image_dim dim
: 3;
547 unsigned cache_policy
: 3;
550 unsigned attributes
; /* additional call-site specific AC_FUNC_ATTRs */
552 LLVMValueRef resource
;
553 LLVMValueRef sampler
;
554 LLVMValueRef data
[2]; /* data[0] is source data (vector); data[1] is cmp for cmpswap */
557 LLVMValueRef compare
;
558 LLVMValueRef derivs
[6];
559 LLVMValueRef coords
[4];
560 LLVMValueRef lod
; // also used by ac_image_get_resinfo
563 LLVMValueRef
ac_build_image_opcode(struct ac_llvm_context
*ctx
,
564 struct ac_image_args
*a
);
565 LLVMValueRef
ac_build_cvt_pkrtz_f16(struct ac_llvm_context
*ctx
,
566 LLVMValueRef args
[2]);
567 LLVMValueRef
ac_build_cvt_pknorm_i16(struct ac_llvm_context
*ctx
,
568 LLVMValueRef args
[2]);
569 LLVMValueRef
ac_build_cvt_pknorm_u16(struct ac_llvm_context
*ctx
,
570 LLVMValueRef args
[2]);
571 LLVMValueRef
ac_build_cvt_pk_i16(struct ac_llvm_context
*ctx
,
572 LLVMValueRef args
[2], unsigned bits
, bool hi
);
573 LLVMValueRef
ac_build_cvt_pk_u16(struct ac_llvm_context
*ctx
,
574 LLVMValueRef args
[2], unsigned bits
, bool hi
);
575 LLVMValueRef
ac_build_wqm_vote(struct ac_llvm_context
*ctx
, LLVMValueRef i1
);
576 void ac_build_kill_if_false(struct ac_llvm_context
*ctx
, LLVMValueRef i1
);
577 LLVMValueRef
ac_build_bfe(struct ac_llvm_context
*ctx
, LLVMValueRef input
,
578 LLVMValueRef offset
, LLVMValueRef width
,
580 LLVMValueRef
ac_build_imad(struct ac_llvm_context
*ctx
, LLVMValueRef s0
,
581 LLVMValueRef s1
, LLVMValueRef s2
);
582 LLVMValueRef
ac_build_fmad(struct ac_llvm_context
*ctx
, LLVMValueRef s0
,
583 LLVMValueRef s1
, LLVMValueRef s2
);
585 void ac_build_waitcnt(struct ac_llvm_context
*ctx
, unsigned wait_flags
);
587 LLVMValueRef
ac_build_fract(struct ac_llvm_context
*ctx
, LLVMValueRef src0
,
590 LLVMValueRef
ac_build_fmed3(struct ac_llvm_context
*ctx
, LLVMValueRef src0
,
591 LLVMValueRef src1
, LLVMValueRef src2
,
594 LLVMValueRef
ac_build_isign(struct ac_llvm_context
*ctx
, LLVMValueRef src0
,
597 LLVMValueRef
ac_build_fsign(struct ac_llvm_context
*ctx
, LLVMValueRef src0
,
600 LLVMValueRef
ac_build_bit_count(struct ac_llvm_context
*ctx
, LLVMValueRef src0
);
602 LLVMValueRef
ac_build_bitfield_reverse(struct ac_llvm_context
*ctx
,
605 void ac_optimize_vs_outputs(struct ac_llvm_context
*ac
,
606 LLVMValueRef main_fn
,
607 uint8_t *vs_output_param_offset
,
608 uint32_t num_outputs
,
609 uint8_t *num_param_exports
);
610 void ac_init_exec_full_mask(struct ac_llvm_context
*ctx
);
612 void ac_declare_lds_as_pointer(struct ac_llvm_context
*ac
);
613 LLVMValueRef
ac_lds_load(struct ac_llvm_context
*ctx
,
614 LLVMValueRef dw_addr
);
615 void ac_lds_store(struct ac_llvm_context
*ctx
,
616 LLVMValueRef dw_addr
, LLVMValueRef value
);
618 LLVMValueRef
ac_find_lsb(struct ac_llvm_context
*ctx
,
619 LLVMTypeRef dst_type
,
622 LLVMTypeRef
ac_array_in_const_addr_space(LLVMTypeRef elem_type
);
623 LLVMTypeRef
ac_array_in_const32_addr_space(LLVMTypeRef elem_type
);
625 void ac_build_bgnloop(struct ac_llvm_context
*ctx
, int lable_id
);
626 void ac_build_break(struct ac_llvm_context
*ctx
);
627 void ac_build_continue(struct ac_llvm_context
*ctx
);
628 void ac_build_else(struct ac_llvm_context
*ctx
, int lable_id
);
629 void ac_build_endif(struct ac_llvm_context
*ctx
, int lable_id
);
630 void ac_build_endloop(struct ac_llvm_context
*ctx
, int lable_id
);
631 void ac_build_ifcc(struct ac_llvm_context
*ctx
, LLVMValueRef cond
, int label_id
);
632 void ac_build_if(struct ac_llvm_context
*ctx
, LLVMValueRef value
,
634 void ac_build_uif(struct ac_llvm_context
*ctx
, LLVMValueRef value
,
637 LLVMValueRef
ac_build_alloca(struct ac_llvm_context
*ac
, LLVMTypeRef type
,
639 LLVMValueRef
ac_build_alloca_undef(struct ac_llvm_context
*ac
, LLVMTypeRef type
,
642 LLVMValueRef
ac_cast_ptr(struct ac_llvm_context
*ctx
, LLVMValueRef ptr
,
645 LLVMValueRef
ac_trim_vector(struct ac_llvm_context
*ctx
, LLVMValueRef value
,
648 LLVMValueRef
ac_unpack_param(struct ac_llvm_context
*ctx
, LLVMValueRef param
,
649 unsigned rshift
, unsigned bitwidth
);
651 void ac_apply_fmask_to_sample(struct ac_llvm_context
*ac
, LLVMValueRef fmask
,
652 LLVMValueRef
*addr
, bool is_array_tex
);
655 ac_build_ds_swizzle(struct ac_llvm_context
*ctx
, LLVMValueRef src
, unsigned mask
);
658 ac_build_readlane(struct ac_llvm_context
*ctx
, LLVMValueRef src
, LLVMValueRef lane
);
661 ac_build_writelane(struct ac_llvm_context
*ctx
, LLVMValueRef src
, LLVMValueRef value
, LLVMValueRef lane
);
664 ac_build_mbcnt(struct ac_llvm_context
*ctx
, LLVMValueRef mask
);
667 ac_build_inclusive_scan(struct ac_llvm_context
*ctx
, LLVMValueRef src
, nir_op op
);
670 ac_build_exclusive_scan(struct ac_llvm_context
*ctx
, LLVMValueRef src
, nir_op op
);
673 ac_build_reduce(struct ac_llvm_context
*ctx
, LLVMValueRef src
, nir_op op
, unsigned cluster_size
);
676 * Common arguments for a scan/reduce operation that accumulates per-wave
677 * values across an entire workgroup, while respecting the order of waves.
681 bool enable_exclusive
;
682 bool enable_inclusive
;
684 LLVMValueRef src
; /* clobbered! */
685 LLVMValueRef result_reduce
;
686 LLVMValueRef result_exclusive
;
687 LLVMValueRef result_inclusive
;
689 LLVMValueRef waveidx
;
690 LLVMValueRef numwaves
; /* only needed for "reduce" operations */
692 /* T addrspace(LDS) pointer to the same type as value, at least maxwaves entries */
693 LLVMValueRef scratch
;
698 ac_build_wg_wavescan_top(struct ac_llvm_context
*ctx
, struct ac_wg_scan
*ws
);
700 ac_build_wg_wavescan_bottom(struct ac_llvm_context
*ctx
, struct ac_wg_scan
*ws
);
702 ac_build_wg_wavescan(struct ac_llvm_context
*ctx
, struct ac_wg_scan
*ws
);
705 ac_build_wg_scan_top(struct ac_llvm_context
*ctx
, struct ac_wg_scan
*ws
);
707 ac_build_wg_scan_bottom(struct ac_llvm_context
*ctx
, struct ac_wg_scan
*ws
);
709 ac_build_wg_scan(struct ac_llvm_context
*ctx
, struct ac_wg_scan
*ws
);
712 ac_build_quad_swizzle(struct ac_llvm_context
*ctx
, LLVMValueRef src
,
713 unsigned lane0
, unsigned lane1
, unsigned lane2
, unsigned lane3
);
716 ac_build_shuffle(struct ac_llvm_context
*ctx
, LLVMValueRef src
, LLVMValueRef index
);
719 ac_build_frexp_exp(struct ac_llvm_context
*ctx
, LLVMValueRef src0
,
723 ac_build_frexp_mant(struct ac_llvm_context
*ctx
, LLVMValueRef src0
,
727 ac_build_ddxy_interp(struct ac_llvm_context
*ctx
, LLVMValueRef interp_ij
);
730 ac_build_load_helper_invocation(struct ac_llvm_context
*ctx
);
732 LLVMValueRef
ac_build_call(struct ac_llvm_context
*ctx
, LLVMValueRef func
,
733 LLVMValueRef
*args
, unsigned num_args
);
735 LLVMValueRef
ac_build_atomic_rmw(struct ac_llvm_context
*ctx
, LLVMAtomicRMWBinOp op
,
736 LLVMValueRef ptr
, LLVMValueRef val
,
737 const char *sync_scope
);
739 LLVMValueRef
ac_build_atomic_cmp_xchg(struct ac_llvm_context
*ctx
, LLVMValueRef ptr
,
740 LLVMValueRef cmp
, LLVMValueRef val
,
741 const char *sync_scope
);