Browse Source

llvmpipe/nir: use nir_max_vec_components in more places

This is prep work for when vec8/16 have landed.

Acked-by: Roland Scheidegger <sroland@vmware.com>
master
Dave Airlie 7 years ago
parent
commit
b16fd4d9e9

+ 31
- 31
src/gallium/auxiliary/gallivm/lp_bld_nir.c View File

} }


static void assign_ssa_dest(struct lp_build_nir_context *bld_base, const nir_ssa_def *ssa, static void assign_ssa_dest(struct lp_build_nir_context *bld_base, const nir_ssa_def *ssa,
LLVMValueRef vals[4])
LLVMValueRef vals[NIR_MAX_VEC_COMPONENTS])
{ {
assign_ssa(bld_base, ssa->index, ssa->num_components == 1 ? vals[0] : lp_nir_array_build_gather_values(bld_base->base.gallivm->builder, vals, ssa->num_components)); assign_ssa(bld_base, ssa->index, ssa->num_components == 1 ? vals[0] : lp_nir_array_build_gather_values(bld_base->base.gallivm->builder, vals, ssa->num_components));
} }


static void assign_reg(struct lp_build_nir_context *bld_base, const nir_reg_dest *reg, static void assign_reg(struct lp_build_nir_context *bld_base, const nir_reg_dest *reg,
unsigned write_mask, unsigned write_mask,
LLVMValueRef vals[4])
LLVMValueRef vals[NIR_MAX_VEC_COMPONENTS])
{ {
struct hash_entry *entry = _mesa_hash_table_search(bld_base->regs, reg->reg); struct hash_entry *entry = _mesa_hash_table_search(bld_base->regs, reg->reg);
LLVMValueRef reg_storage = (LLVMValueRef)entry->data; LLVMValueRef reg_storage = (LLVMValueRef)entry->data;
bld_base->store_reg(bld_base, reg_bld, reg, write_mask ? write_mask : 0xf, indir_src, reg_storage, vals); bld_base->store_reg(bld_base, reg_bld, reg, write_mask ? write_mask : 0xf, indir_src, reg_storage, vals);
} }


static void assign_dest(struct lp_build_nir_context *bld_base, const nir_dest *dest, LLVMValueRef vals[4])
static void assign_dest(struct lp_build_nir_context *bld_base, const nir_dest *dest, LLVMValueRef vals[NIR_MAX_VEC_COMPONENTS])
{ {
if (dest->is_ssa) if (dest->is_ssa)
assign_ssa_dest(bld_base, &dest->ssa, vals); assign_ssa_dest(bld_base, &dest->ssa, vals);
assign_reg(bld_base, &dest->reg, 0, vals); assign_reg(bld_base, &dest->reg, 0, vals);
} }


static void assign_alu_dest(struct lp_build_nir_context *bld_base, const nir_alu_dest *dest, LLVMValueRef vals[4])
static void assign_alu_dest(struct lp_build_nir_context *bld_base, const nir_alu_dest *dest, LLVMValueRef vals[NIR_MAX_VEC_COMPONENTS])
{ {
if (dest->dest.is_ssa) if (dest->dest.is_ssa)
assign_ssa_dest(bld_base, &dest->dest.ssa, vals); assign_ssa_dest(bld_base, &dest->dest.ssa, vals);
static LLVMValueRef fcmp32(struct lp_build_nir_context *bld_base, static LLVMValueRef fcmp32(struct lp_build_nir_context *bld_base,
enum pipe_compare_func compare, enum pipe_compare_func compare,
uint32_t src_bit_size, uint32_t src_bit_size,
LLVMValueRef src[4])
LLVMValueRef src[NIR_MAX_VEC_COMPONENTS])
{ {
LLVMBuilderRef builder = bld_base->base.gallivm->builder; LLVMBuilderRef builder = bld_base->base.gallivm->builder;
struct lp_build_context *flt_bld = get_flt_bld(bld_base, src_bit_size); struct lp_build_context *flt_bld = get_flt_bld(bld_base, src_bit_size);
enum pipe_compare_func compare, enum pipe_compare_func compare,
bool is_unsigned, bool is_unsigned,
uint32_t src_bit_size, uint32_t src_bit_size,
LLVMValueRef src[4])
LLVMValueRef src[NIR_MAX_VEC_COMPONENTS])
{ {
LLVMBuilderRef builder = bld_base->base.gallivm->builder; LLVMBuilderRef builder = bld_base->base.gallivm->builder;
struct lp_build_context *i_bld = get_int_bld(bld_base, is_unsigned, src_bit_size); struct lp_build_context *i_bld = get_int_bld(bld_base, is_unsigned, src_bit_size);
} }


static LLVMValueRef emit_b32csel(struct lp_build_nir_context *bld_base, static LLVMValueRef emit_b32csel(struct lp_build_nir_context *bld_base,
unsigned src_bit_size[4],
LLVMValueRef src[4])
unsigned src_bit_size[NIR_MAX_VEC_COMPONENTS],
LLVMValueRef src[NIR_MAX_VEC_COMPONENTS])
{ {
LLVMValueRef sel = cast_type(bld_base, src[0], nir_type_int, 32); LLVMValueRef sel = cast_type(bld_base, src[0], nir_type_int, 32);
LLVMValueRef v = lp_build_compare(bld_base->base.gallivm, bld_base->int_bld.type, PIPE_FUNC_NOTEQUAL, sel, bld_base->int_bld.zero); LLVMValueRef v = lp_build_compare(bld_base->base.gallivm, bld_base->int_bld.type, PIPE_FUNC_NOTEQUAL, sel, bld_base->int_bld.zero);
} }


static LLVMValueRef do_alu_action(struct lp_build_nir_context *bld_base, static LLVMValueRef do_alu_action(struct lp_build_nir_context *bld_base,
nir_op op, unsigned src_bit_size[4], LLVMValueRef src[4])
nir_op op, unsigned src_bit_size[NIR_MAX_VEC_COMPONENTS], LLVMValueRef src[NIR_MAX_VEC_COMPONENTS])
{ {
struct gallivm_state *gallivm = bld_base->base.gallivm; struct gallivm_state *gallivm = bld_base->base.gallivm;
LLVMBuilderRef builder = gallivm->builder; LLVMBuilderRef builder = gallivm->builder;
static void visit_alu(struct lp_build_nir_context *bld_base, const nir_alu_instr *instr) static void visit_alu(struct lp_build_nir_context *bld_base, const nir_alu_instr *instr)
{ {
struct gallivm_state *gallivm = bld_base->base.gallivm; struct gallivm_state *gallivm = bld_base->base.gallivm;
LLVMValueRef src[4];
unsigned src_bit_size[4];
LLVMValueRef src[NIR_MAX_VEC_COMPONENTS];
unsigned src_bit_size[NIR_MAX_VEC_COMPONENTS];
unsigned num_components = nir_dest_num_components(instr->dest.dest); unsigned num_components = nir_dest_num_components(instr->dest.dest);
unsigned src_components; unsigned src_components;
switch (instr->op) { switch (instr->op) {
src_bit_size[i] = nir_src_bit_size(instr->src[i].src); src_bit_size[i] = nir_src_bit_size(instr->src[i].src);
} }


LLVMValueRef result[4];
LLVMValueRef result[NIR_MAX_VEC_COMPONENTS];
if (instr->op == nir_op_vec4 || instr->op == nir_op_vec3 || instr->op == nir_op_vec2) { if (instr->op == nir_op_vec4 || instr->op == nir_op_vec3 || instr->op == nir_op_vec2) {
for (unsigned i = 0; i < nir_op_infos[instr->op].num_inputs; i++) { for (unsigned i = 0; i < nir_op_infos[instr->op].num_inputs; i++) {
result[i] = cast_type(bld_base, src[i], nir_op_infos[instr->op].input_types[i], src_bit_size[i]); result[i] = cast_type(bld_base, src[i], nir_op_infos[instr->op].input_types[i], src_bit_size[i]);
} }
} else { } else {
for (unsigned c = 0; c < num_components; c++) { for (unsigned c = 0; c < num_components; c++) {
LLVMValueRef src_chan[4];
LLVMValueRef src_chan[NIR_MAX_VEC_COMPONENTS];


for (unsigned i = 0; i < nir_op_infos[instr->op].num_inputs; i++) { for (unsigned i = 0; i < nir_op_infos[instr->op].num_inputs; i++) {
if (num_components > 1) { if (num_components > 1) {
static void visit_load_const(struct lp_build_nir_context *bld_base, static void visit_load_const(struct lp_build_nir_context *bld_base,
const nir_load_const_instr *instr) const nir_load_const_instr *instr)
{ {
LLVMValueRef result[4];
LLVMValueRef result[NIR_MAX_VEC_COMPONENTS];
struct lp_build_context *int_bld = get_int_bld(bld_base, true, instr->def.bit_size); struct lp_build_context *int_bld = get_int_bld(bld_base, true, instr->def.bit_size);
for (unsigned i = 0; i < instr->def.num_components; i++) for (unsigned i = 0; i < instr->def.num_components; i++)
result[i] = lp_build_const_int_vec(bld_base->base.gallivm, int_bld->type, instr->value[i].u64); result[i] = lp_build_const_int_vec(bld_base->base.gallivm, int_bld->type, instr->value[i].u64);


static void visit_load_var(struct lp_build_nir_context *bld_base, static void visit_load_var(struct lp_build_nir_context *bld_base,
nir_intrinsic_instr *instr, nir_intrinsic_instr *instr,
LLVMValueRef result[4])
LLVMValueRef result[NIR_MAX_VEC_COMPONENTS])
{ {
nir_deref_instr *deref = nir_instr_as_deref(instr->src[0].ssa->parent_instr); nir_deref_instr *deref = nir_instr_as_deref(instr->src[0].ssa->parent_instr);
nir_variable *var = nir_deref_instr_get_variable(deref); nir_variable *var = nir_deref_instr_get_variable(deref);


static void visit_load_ubo(struct lp_build_nir_context *bld_base, static void visit_load_ubo(struct lp_build_nir_context *bld_base,
nir_intrinsic_instr *instr, nir_intrinsic_instr *instr,
LLVMValueRef result[4])
LLVMValueRef result[NIR_MAX_VEC_COMPONENTS])
{ {
struct gallivm_state *gallivm = bld_base->base.gallivm; struct gallivm_state *gallivm = bld_base->base.gallivm;
LLVMBuilderRef builder = gallivm->builder; LLVMBuilderRef builder = gallivm->builder;


static void visit_load_ssbo(struct lp_build_nir_context *bld_base, static void visit_load_ssbo(struct lp_build_nir_context *bld_base,
nir_intrinsic_instr *instr, nir_intrinsic_instr *instr,
LLVMValueRef result[4])
LLVMValueRef result[NIR_MAX_VEC_COMPONENTS])
{ {
LLVMValueRef idx = get_src(bld_base, instr->src[0]); LLVMValueRef idx = get_src(bld_base, instr->src[0]);
LLVMValueRef offset = get_src(bld_base, instr->src[1]); LLVMValueRef offset = get_src(bld_base, instr->src[1]);


static void visit_get_buffer_size(struct lp_build_nir_context *bld_base, static void visit_get_buffer_size(struct lp_build_nir_context *bld_base,
nir_intrinsic_instr *instr, nir_intrinsic_instr *instr,
LLVMValueRef result[4])
LLVMValueRef result[NIR_MAX_VEC_COMPONENTS])
{ {
LLVMValueRef idx = get_src(bld_base, instr->src[0]); LLVMValueRef idx = get_src(bld_base, instr->src[0]);
result[0] = bld_base->get_buffer_size(bld_base, idx); result[0] = bld_base->get_buffer_size(bld_base, idx);


static void visit_ssbo_atomic(struct lp_build_nir_context *bld_base, static void visit_ssbo_atomic(struct lp_build_nir_context *bld_base,
nir_intrinsic_instr *instr, nir_intrinsic_instr *instr,
LLVMValueRef result[4])
LLVMValueRef result[NIR_MAX_VEC_COMPONENTS])
{ {
LLVMValueRef idx = get_src(bld_base, instr->src[0]); LLVMValueRef idx = get_src(bld_base, instr->src[0]);
LLVMValueRef offset = get_src(bld_base, instr->src[1]); LLVMValueRef offset = get_src(bld_base, instr->src[1]);


static void visit_load_image(struct lp_build_nir_context *bld_base, static void visit_load_image(struct lp_build_nir_context *bld_base,
nir_intrinsic_instr *instr, nir_intrinsic_instr *instr,
LLVMValueRef result[4])
LLVMValueRef result[NIR_MAX_VEC_COMPONENTS])
{ {
struct gallivm_state *gallivm = bld_base->base.gallivm; struct gallivm_state *gallivm = bld_base->base.gallivm;
LLVMBuilderRef builder = gallivm->builder; LLVMBuilderRef builder = gallivm->builder;


static void visit_atomic_image(struct lp_build_nir_context *bld_base, static void visit_atomic_image(struct lp_build_nir_context *bld_base,
nir_intrinsic_instr *instr, nir_intrinsic_instr *instr,
LLVMValueRef result[4])
LLVMValueRef result[NIR_MAX_VEC_COMPONENTS])
{ {
struct gallivm_state *gallivm = bld_base->base.gallivm; struct gallivm_state *gallivm = bld_base->base.gallivm;
LLVMBuilderRef builder = gallivm->builder; LLVMBuilderRef builder = gallivm->builder;


static void visit_image_size(struct lp_build_nir_context *bld_base, static void visit_image_size(struct lp_build_nir_context *bld_base,
nir_intrinsic_instr *instr, nir_intrinsic_instr *instr,
LLVMValueRef result[4])
LLVMValueRef result[NIR_MAX_VEC_COMPONENTS])
{ {
nir_deref_instr *deref = nir_instr_as_deref(instr->src[0].ssa->parent_instr); nir_deref_instr *deref = nir_instr_as_deref(instr->src[0].ssa->parent_instr);
nir_variable *var = nir_deref_instr_get_variable(deref); nir_variable *var = nir_deref_instr_get_variable(deref);


static void visit_shared_load(struct lp_build_nir_context *bld_base, static void visit_shared_load(struct lp_build_nir_context *bld_base,
nir_intrinsic_instr *instr, nir_intrinsic_instr *instr,
LLVMValueRef result[4])
LLVMValueRef result[NIR_MAX_VEC_COMPONENTS])
{ {
LLVMValueRef offset = get_src(bld_base, instr->src[0]); LLVMValueRef offset = get_src(bld_base, instr->src[0]);
bld_base->load_mem(bld_base, nir_dest_num_components(instr->dest), nir_dest_bit_size(instr->dest), bld_base->load_mem(bld_base, nir_dest_num_components(instr->dest), nir_dest_bit_size(instr->dest),


static void visit_shared_atomic(struct lp_build_nir_context *bld_base, static void visit_shared_atomic(struct lp_build_nir_context *bld_base,
nir_intrinsic_instr *instr, nir_intrinsic_instr *instr,
LLVMValueRef result[4])
LLVMValueRef result[NIR_MAX_VEC_COMPONENTS])
{ {
LLVMValueRef offset = get_src(bld_base, instr->src[0]); LLVMValueRef offset = get_src(bld_base, instr->src[0]);
LLVMValueRef val = get_src(bld_base, instr->src[1]); LLVMValueRef val = get_src(bld_base, instr->src[1]);
} }


static void visit_load_kernel_input(struct lp_build_nir_context *bld_base, static void visit_load_kernel_input(struct lp_build_nir_context *bld_base,
nir_intrinsic_instr *instr, LLVMValueRef result[4])
nir_intrinsic_instr *instr, LLVMValueRef result[NIR_MAX_VEC_COMPONENTS])
{ {
LLVMValueRef offset = get_src(bld_base, instr->src[0]); LLVMValueRef offset = get_src(bld_base, instr->src[0]);


} }


static void visit_load_global(struct lp_build_nir_context *bld_base, static void visit_load_global(struct lp_build_nir_context *bld_base,
nir_intrinsic_instr *instr, LLVMValueRef result[4])
nir_intrinsic_instr *instr, LLVMValueRef result[NIR_MAX_VEC_COMPONENTS])
{ {
LLVMValueRef addr = get_src(bld_base, instr->src[0]); LLVMValueRef addr = get_src(bld_base, instr->src[0]);
bld_base->load_global(bld_base, nir_dest_num_components(instr->dest), nir_dest_bit_size(instr->dest), bld_base->load_global(bld_base, nir_dest_num_components(instr->dest), nir_dest_bit_size(instr->dest),


static void visit_global_atomic(struct lp_build_nir_context *bld_base, static void visit_global_atomic(struct lp_build_nir_context *bld_base,
nir_intrinsic_instr *instr, nir_intrinsic_instr *instr,
LLVMValueRef result[4])
LLVMValueRef result[NIR_MAX_VEC_COMPONENTS])
{ {
LLVMValueRef addr = get_src(bld_base, instr->src[0]); LLVMValueRef addr = get_src(bld_base, instr->src[0]);
LLVMValueRef val = get_src(bld_base, instr->src[1]); LLVMValueRef val = get_src(bld_base, instr->src[1]);
static void visit_intrinsic(struct lp_build_nir_context *bld_base, static void visit_intrinsic(struct lp_build_nir_context *bld_base,
nir_intrinsic_instr *instr) nir_intrinsic_instr *instr)
{ {
LLVMValueRef result[4] = {0};
LLVMValueRef result[NIR_MAX_VEC_COMPONENTS] = {0};
switch (instr->intrinsic) { switch (instr->intrinsic) {
case nir_intrinsic_load_deref: case nir_intrinsic_load_deref:
visit_load_var(bld_base, instr, result); visit_load_var(bld_base, instr, result);
static void visit_txs(struct lp_build_nir_context *bld_base, nir_tex_instr *instr) static void visit_txs(struct lp_build_nir_context *bld_base, nir_tex_instr *instr)
{ {
struct lp_sampler_size_query_params params; struct lp_sampler_size_query_params params;
LLVMValueRef sizes_out[4];
LLVMValueRef sizes_out[NIR_MAX_VEC_COMPONENTS];
LLVMValueRef explicit_lod = NULL; LLVMValueRef explicit_lod = NULL;


for (unsigned i = 0; i < instr->num_srcs; i++) { for (unsigned i = 0; i < instr->num_srcs; i++) {
unsigned sample_key = 0; unsigned sample_key = 0;
nir_deref_instr *texture_deref_instr = NULL; nir_deref_instr *texture_deref_instr = NULL;
nir_deref_instr *sampler_deref_instr = NULL; nir_deref_instr *sampler_deref_instr = NULL;
LLVMValueRef texel[4];
LLVMValueRef texel[NIR_MAX_VEC_COMPONENTS];
unsigned lod_src = 0; unsigned lod_src = 0;
LLVMValueRef coord_undef = LLVMGetUndef(bld_base->base.int_vec_type); LLVMValueRef coord_undef = LLVMGetUndef(bld_base->base.int_vec_type);


const nir_ssa_undef_instr *instr) const nir_ssa_undef_instr *instr)
{ {
unsigned num_components = instr->def.num_components; unsigned num_components = instr->def.num_components;
LLVMValueRef undef[4];
LLVMValueRef undef[NIR_MAX_VEC_COMPONENTS];
for (unsigned i = 0; i < num_components; i++) for (unsigned i = 0; i < num_components; i++)
undef[i] = LLVMGetUndef(bld_base->base.vec_type); undef[i] = LLVMGetUndef(bld_base->base.vec_type);
assign_ssa_dest(bld_base, &instr->def, undef); assign_ssa_dest(bld_base, &instr->def, undef);

+ 7
- 7
src/gallium/auxiliary/gallivm/lp_bld_nir.h View File

unsigned nc, unsigned nc,
unsigned bit_size, unsigned bit_size,
bool offset_is_uniform, bool offset_is_uniform,
LLVMValueRef index, LLVMValueRef offset, LLVMValueRef result[4]);
LLVMValueRef index, LLVMValueRef offset, LLVMValueRef result[NIR_MAX_VEC_COMPONENTS]);


void (*load_kernel_arg)(struct lp_build_nir_context *bld_base, void (*load_kernel_arg)(struct lp_build_nir_context *bld_base,
unsigned nc, unsigned nc,
unsigned bit_size, unsigned bit_size,
unsigned offset_bit_size, unsigned offset_bit_size,
bool offset_is_uniform, bool offset_is_uniform,
LLVMValueRef offset, LLVMValueRef result[4]);
LLVMValueRef offset, LLVMValueRef result[NIR_MAX_VEC_COMPONENTS]);


void (*load_global)(struct lp_build_nir_context *bld_base, void (*load_global)(struct lp_build_nir_context *bld_base,
unsigned nc, unsigned bit_size, unsigned nc, unsigned bit_size,
unsigned offset_bit_size, unsigned offset_bit_size,
LLVMValueRef offset, LLVMValueRef result[4]);
LLVMValueRef offset, LLVMValueRef result[NIR_MAX_VEC_COMPONENTS]);


void (*store_global)(struct lp_build_nir_context *bld_base, void (*store_global)(struct lp_build_nir_context *bld_base,
unsigned writemask, unsigned writemask,
/* for SSBO and shared memory */ /* for SSBO and shared memory */
void (*load_mem)(struct lp_build_nir_context *bld_base, void (*load_mem)(struct lp_build_nir_context *bld_base,
unsigned nc, unsigned bit_size, unsigned nc, unsigned bit_size,
LLVMValueRef index, LLVMValueRef offset, LLVMValueRef result[4]);
LLVMValueRef index, LLVMValueRef offset, LLVMValueRef result[NIR_MAX_VEC_COMPONENTS]);
void (*store_mem)(struct lp_build_nir_context *bld_base, void (*store_mem)(struct lp_build_nir_context *bld_base,
unsigned writemask, unsigned nc, unsigned bit_size, unsigned writemask, unsigned nc, unsigned bit_size,
LLVMValueRef index, LLVMValueRef offset, LLVMValueRef dst); LLVMValueRef index, LLVMValueRef offset, LLVMValueRef dst);
unsigned vertex_index, unsigned vertex_index,
unsigned const_index, unsigned const_index,
LLVMValueRef indir_index, LLVMValueRef indir_index,
LLVMValueRef result[4]);
LLVMValueRef result[NIR_MAX_VEC_COMPONENTS]);
void (*store_var)(struct lp_build_nir_context *bld_base, void (*store_var)(struct lp_build_nir_context *bld_base,
nir_variable_mode deref_mode, nir_variable_mode deref_mode,
unsigned bit_size, unsigned bit_size,
unsigned writemask, unsigned writemask,
LLVMValueRef indir_src, LLVMValueRef indir_src,
LLVMValueRef reg_storage, LLVMValueRef reg_storage,
LLVMValueRef dst[4]);
LLVMValueRef dst[NIR_MAX_VEC_COMPONENTS]);


void (*emit_var_decl)(struct lp_build_nir_context *bld_base, void (*emit_var_decl)(struct lp_build_nir_context *bld_base,
nir_variable *var); nir_variable *var);


void (*sysval_intrin)(struct lp_build_nir_context *bld_base, void (*sysval_intrin)(struct lp_build_nir_context *bld_base,
nir_intrinsic_instr *instr, nir_intrinsic_instr *instr,
LLVMValueRef result[4]);
LLVMValueRef result[NIR_MAX_VEC_COMPONENTS]);
void (*discard)(struct lp_build_nir_context *bld_base, void (*discard)(struct lp_build_nir_context *bld_base,
LLVMValueRef cond); LLVMValueRef cond);



+ 8
- 8
src/gallium/auxiliary/gallivm/lp_bld_nir_soa.c View File

unsigned vertex_index, unsigned vertex_index,
unsigned const_index, unsigned const_index,
LLVMValueRef indir_index, LLVMValueRef indir_index,
LLVMValueRef result[4])
LLVMValueRef result[NIR_MAX_VEC_COMPONENTS])
{ {
struct lp_build_nir_soa_context *bld = (struct lp_build_nir_soa_context *)bld_base; struct lp_build_nir_soa_context *bld = (struct lp_build_nir_soa_context *)bld_base;
struct gallivm_state *gallivm = bld_base->base.gallivm; struct gallivm_state *gallivm = bld_base->base.gallivm;
struct gallivm_state *gallivm = bld_base->base.gallivm; struct gallivm_state *gallivm = bld_base->base.gallivm;
LLVMBuilderRef builder = gallivm->builder; LLVMBuilderRef builder = gallivm->builder;
int nc = reg->reg->num_components; int nc = reg->reg->num_components;
LLVMValueRef vals[4];
LLVMValueRef vals[NIR_MAX_VEC_COMPONENTS];
struct lp_build_context *uint_bld = &bld_base->uint_bld; struct lp_build_context *uint_bld = &bld_base->uint_bld;
if (reg->reg->num_array_elems) { if (reg->reg->num_array_elems) {
LLVMValueRef indirect_val = lp_build_const_int_vec(gallivm, uint_bld->type, reg->base_offset); LLVMValueRef indirect_val = lp_build_const_int_vec(gallivm, uint_bld->type, reg->base_offset);
unsigned writemask, unsigned writemask,
LLVMValueRef indir_src, LLVMValueRef indir_src,
LLVMValueRef reg_storage, LLVMValueRef reg_storage,
LLVMValueRef dst[4])
LLVMValueRef dst[NIR_MAX_VEC_COMPONENTS])
{ {
struct lp_build_nir_soa_context *bld = (struct lp_build_nir_soa_context *)bld_base; struct lp_build_nir_soa_context *bld = (struct lp_build_nir_soa_context *)bld_base;
struct gallivm_state *gallivm = bld_base->base.gallivm; struct gallivm_state *gallivm = bld_base->base.gallivm;
unsigned offset_bit_size, unsigned offset_bit_size,
bool offset_is_uniform, bool offset_is_uniform,
LLVMValueRef offset, LLVMValueRef offset,
LLVMValueRef result[4])
LLVMValueRef result[NIR_MAX_VEC_COMPONENTS])
{ {
struct lp_build_nir_soa_context *bld = (struct lp_build_nir_soa_context *)bld_base; struct lp_build_nir_soa_context *bld = (struct lp_build_nir_soa_context *)bld_base;
struct gallivm_state *gallivm = bld_base->base.gallivm; struct gallivm_state *gallivm = bld_base->base.gallivm;
unsigned bit_size, unsigned bit_size,
unsigned addr_bit_size, unsigned addr_bit_size,
LLVMValueRef addr, LLVMValueRef addr,
LLVMValueRef outval[4])
LLVMValueRef outval[NIR_MAX_VEC_COMPONENTS])
{ {
struct gallivm_state *gallivm = bld_base->base.gallivm; struct gallivm_state *gallivm = bld_base->base.gallivm;
LLVMBuilderRef builder = gallivm->builder; LLVMBuilderRef builder = gallivm->builder;
bool offset_is_uniform, bool offset_is_uniform,
LLVMValueRef index, LLVMValueRef index,
LLVMValueRef offset, LLVMValueRef offset,
LLVMValueRef result[4])
LLVMValueRef result[NIR_MAX_VEC_COMPONENTS])
{ {
struct lp_build_nir_soa_context *bld = (struct lp_build_nir_soa_context *)bld_base; struct lp_build_nir_soa_context *bld = (struct lp_build_nir_soa_context *)bld_base;
struct gallivm_state *gallivm = bld_base->base.gallivm; struct gallivm_state *gallivm = bld_base->base.gallivm;
unsigned bit_size, unsigned bit_size,
LLVMValueRef index, LLVMValueRef index,
LLVMValueRef offset, LLVMValueRef offset,
LLVMValueRef outval[4])
LLVMValueRef outval[NIR_MAX_VEC_COMPONENTS])
{ {
struct gallivm_state *gallivm = bld_base->base.gallivm; struct gallivm_state *gallivm = bld_base->base.gallivm;
struct lp_build_nir_soa_context *bld = (struct lp_build_nir_soa_context *)bld_base; struct lp_build_nir_soa_context *bld = (struct lp_build_nir_soa_context *)bld_base;


static void emit_sysval_intrin(struct lp_build_nir_context *bld_base, static void emit_sysval_intrin(struct lp_build_nir_context *bld_base,
nir_intrinsic_instr *instr, nir_intrinsic_instr *instr,
LLVMValueRef result[4])
LLVMValueRef result[NIR_MAX_VEC_COMPONENTS])
{ {
struct lp_build_nir_soa_context *bld = (struct lp_build_nir_soa_context *)bld_base; struct lp_build_nir_soa_context *bld = (struct lp_build_nir_soa_context *)bld_base;
struct gallivm_state *gallivm = bld_base->base.gallivm; struct gallivm_state *gallivm = bld_base->base.gallivm;

Loading…
Cancel
Save