#include "bi_print_common.h"
static const char *
-bi_segment_name(enum bi_segment seg)
+bi_seg_name(enum bi_seg seg)
{
switch (seg) {
- case BI_SEGMENT_NONE: return "global";
- case BI_SEGMENT_WLS: return "wls";
- case BI_SEGMENT_UBO: return "ubo";
- case BI_SEGMENT_TLS: return "tls";
+ case BI_SEG_NONE: return "global";
+ case BI_SEG_WLS: return "wls";
+ case BI_SEG_UBO: return "ubo";
+ case BI_SEG_TL: return "tls";
default: return "invalid";
}
}
fprintf(fp, ".v%u", ins->vector_channels);
if (ins->segment)
- fprintf(fp, ".%s", bi_segment_name(ins->segment));
+ fprintf(fp, ".%s", bi_seg_name(ins->segment));
if (ins->dest)
pan_print_alu_type(ins->dest_type, fp);
{
bi_instruction store = {
.type = BI_STORE,
- .segment = BI_SEGMENT_TLS,
+ .segment = BI_SEG_TL,
.vector_channels = channels,
.src = {
node,
{
bi_instruction load = {
.type = BI_LOAD,
- .segment = BI_SEGMENT_TLS,
+ .segment = BI_SEG_TL,
.vector_channels = channels,
.dest = node,
.dest_type = nir_type_uint32,
if (!bi_has_arg(ins, node)) continue;
/* Don't rewrite spills themselves */
- if (ins->segment == BI_SEGMENT_TLS) continue;
+ if (ins->segment == BI_SEG_TL) continue;
unsigned index = bi_make_temp(ctx);
bi_instruction ld = {
.type = BI_LOAD_UNIFORM,
- .segment = BI_SEGMENT_UBO,
+ .segment = BI_SEG_UBO,
.vector_channels = instr->num_components,
.src_types = { nir_type_uint32, nir_type_uint32 },
.dest = pan_dest_index(&instr->dest),
bi_instruction load = {
.type = BI_LOAD_UNIFORM,
- .segment = BI_SEGMENT_UBO,
+ .segment = BI_SEG_UBO,
.vector_channels = nr_components,
.src = { BIR_INDEX_CONSTANT, BIR_INDEX_ZERO },
.src_types = { nir_type_uint32, nir_type_uint32 },
* instructions for address calculation, and directly in SEG_ADD/SEG_SUB
* instructions. */
-enum bi_segment {
+enum bi_seg {
/* No segment (use global addressing, offset from GPU VA 0x0) */
- BI_SEGMENT_NONE = 1,
+ BI_SEG_NONE = 1,
/* Within workgroup local memory (shared memory). Relative to
* wls_base_pointer in the draw's thread storage descriptor */
- BI_SEGMENT_WLS = 2,
+ BI_SEG_WLS = 2,
/* Within one of the bound uniform buffers. Low 32-bits are the index
* within the uniform buffer; high 32-bits are the index of the uniform
* buffer itself. Relative to the uniform_array_pointer indexed within
* the draw's uniform remap table indexed by the high 32-bits. */
- BI_SEGMENT_UBO = 4,
+ BI_SEG_UBO = 4,
/* Within thread local storage (for spilling). Relative to
* tls_base_pointer in the draw's thread storage descriptor */
- BI_SEGMENT_TLS = 7
+ BI_SEG_TL = 7
};
/* Opcodes within a class */
enum bi_cond cond;
/* For memory ops, base address */
- enum bi_segment segment;
+ enum bi_seg segment;
/* Can we spill the value written here? Used to prevent
* useless double fills */
body.append('assert(ins->segment);')
return 'ins->segment'
elif opts == ['none', 'wls']:
- body.append('assert(ins->segment == BI_SEGMENT_NONE || ins->segment == BI_SEGMENT_WLS);')
- return 'ins->segment == BI_SEGMENT_WLS ? 1 : 0'
+ body.append('assert(ins->segment == BI_SEG_NONE || ins->segment == BI_SEG_WLS);')
+ return 'ins->segment == BI_SEG_WLS ? 1 : 0'
else:
assert(False)