*/
void
ureg_insn(struct ureg_program *ureg,
- unsigned opcode,
+ enum tgsi_opcode opcode,
const struct ureg_dst *dst,
unsigned nr_dst,
const struct ureg_src *src,
void
ureg_tex_insn(struct ureg_program *ureg,
- unsigned opcode,
+ enum tgsi_opcode opcode,
const struct ureg_dst *dst,
unsigned nr_dst,
enum tgsi_texture_type target,
void
ureg_memory_insn(struct ureg_program *ureg,
- unsigned opcode,
+ enum tgsi_opcode opcode,
const struct ureg_dst *dst,
unsigned nr_dst,
const struct ureg_src *src,
struct ureg_emit_insn_result
ureg_emit_insn(struct ureg_program *ureg,
- unsigned opcode,
+ enum tgsi_opcode opcode,
boolean saturate,
unsigned precise,
unsigned num_dst,
#define OP00( op ) \
static inline void ureg_##op( struct ureg_program *ureg ) \
{ \
- unsigned opcode = TGSI_OPCODE_##op; \
+ enum tgsi_opcode opcode = TGSI_OPCODE_##op; \
struct ureg_emit_insn_result insn; \
insn = ureg_emit_insn(ureg, \
opcode, \
static inline void ureg_##op( struct ureg_program *ureg, \
struct ureg_src src ) \
{ \
- unsigned opcode = TGSI_OPCODE_##op; \
+ enum tgsi_opcode opcode = TGSI_OPCODE_##op; \
struct ureg_emit_insn_result insn; \
insn = ureg_emit_insn(ureg, \
opcode, \
static inline void ureg_##op( struct ureg_program *ureg, \
unsigned *label_token ) \
{ \
- unsigned opcode = TGSI_OPCODE_##op; \
+ enum tgsi_opcode opcode = TGSI_OPCODE_##op; \
struct ureg_emit_insn_result insn; \
insn = ureg_emit_insn(ureg, \
opcode, \
struct ureg_src src, \
unsigned *label_token ) \
{ \
- unsigned opcode = TGSI_OPCODE_##op; \
+ enum tgsi_opcode opcode = TGSI_OPCODE_##op; \
struct ureg_emit_insn_result insn; \
insn = ureg_emit_insn(ureg, \
opcode, \
static inline void ureg_##op( struct ureg_program *ureg, \
struct ureg_dst dst ) \
{ \
- unsigned opcode = TGSI_OPCODE_##op; \
+ enum tgsi_opcode opcode = TGSI_OPCODE_##op; \
struct ureg_emit_insn_result insn; \
if (ureg_dst_is_empty(dst)) \
return; \
struct ureg_dst dst, \
struct ureg_src src ) \
{ \
- unsigned opcode = TGSI_OPCODE_##op; \
+ enum tgsi_opcode opcode = TGSI_OPCODE_##op; \
struct ureg_emit_insn_result insn; \
if (ureg_dst_is_empty(dst)) \
return; \
struct ureg_src src0, \
struct ureg_src src1 ) \
{ \
- unsigned opcode = TGSI_OPCODE_##op; \
+ enum tgsi_opcode opcode = TGSI_OPCODE_##op; \
struct ureg_emit_insn_result insn; \
if (ureg_dst_is_empty(dst)) \
return; \
struct ureg_src src0, \
struct ureg_src src1 ) \
{ \
- unsigned opcode = TGSI_OPCODE_##op; \
+ enum tgsi_opcode opcode = TGSI_OPCODE_##op; \
enum tgsi_return_type return_type = TGSI_RETURN_TYPE_UNKNOWN; \
struct ureg_emit_insn_result insn; \
if (ureg_dst_is_empty(dst)) \
struct ureg_src src1, \
struct ureg_src src2 ) \
{ \
- unsigned opcode = TGSI_OPCODE_##op; \
+ enum tgsi_opcode opcode = TGSI_OPCODE_##op; \
struct ureg_emit_insn_result insn; \
if (ureg_dst_is_empty(dst)) \
return; \
struct ureg_src src2, \
struct ureg_src src3 ) \
{ \
- unsigned opcode = TGSI_OPCODE_##op; \
+ enum tgsi_opcode opcode = TGSI_OPCODE_##op; \
enum tgsi_return_type return_type = TGSI_RETURN_TYPE_UNKNOWN; \
struct ureg_emit_insn_result insn; \
if (ureg_dst_is_empty(dst)) \
void visit_membar_intrinsic(ir_call *);
void visit_shared_intrinsic(ir_call *);
void visit_image_intrinsic(ir_call *);
- void visit_generic_intrinsic(ir_call *, unsigned op);
+ void visit_generic_intrinsic(ir_call *, enum tgsi_opcode op);
st_src_reg result;
/** List of glsl_to_tgsi_instruction */
exec_list instructions;
- glsl_to_tgsi_instruction *emit_asm(ir_instruction *ir, unsigned op,
+ glsl_to_tgsi_instruction *emit_asm(ir_instruction *ir, enum tgsi_opcode op,
st_dst_reg dst = undef_dst,
st_src_reg src0 = undef_src,
st_src_reg src1 = undef_src,
st_src_reg src2 = undef_src,
st_src_reg src3 = undef_src);
- glsl_to_tgsi_instruction *emit_asm(ir_instruction *ir, unsigned op,
+ glsl_to_tgsi_instruction *emit_asm(ir_instruction *ir, enum tgsi_opcode op,
st_dst_reg dst, st_dst_reg dst1,
st_src_reg src0 = undef_src,
st_src_reg src1 = undef_src,
st_src_reg src2 = undef_src,
st_src_reg src3 = undef_src);
- unsigned get_opcode(unsigned op,
- st_dst_reg dst,
- st_src_reg src0, st_src_reg src1);
+ enum tgsi_opcode get_opcode(enum tgsi_opcode op,
+ st_dst_reg dst,
+ st_src_reg src0, st_src_reg src1);
/**
* Emit the correct dot-product instruction for the type of arguments
st_src_reg src1,
unsigned elements);
- void emit_scalar(ir_instruction *ir, unsigned op,
+ void emit_scalar(ir_instruction *ir, enum tgsi_opcode op,
st_dst_reg dst, st_src_reg src0);
- void emit_scalar(ir_instruction *ir, unsigned op,
+ void emit_scalar(ir_instruction *ir, enum tgsi_opcode op,
st_dst_reg dst, st_src_reg src0, st_src_reg src1);
void emit_arl(ir_instruction *ir, st_dst_reg dst, st_src_reg src0);
glsl_to_tgsi_instruction *
-glsl_to_tgsi_visitor::emit_asm(ir_instruction *ir, unsigned op,
+glsl_to_tgsi_visitor::emit_asm(ir_instruction *ir, enum tgsi_opcode op,
st_dst_reg dst, st_dst_reg dst1,
st_src_reg src0, st_src_reg src1,
st_src_reg src2, st_src_reg src3)
}
glsl_to_tgsi_instruction *
-glsl_to_tgsi_visitor::emit_asm(ir_instruction *ir, unsigned op,
+glsl_to_tgsi_visitor::emit_asm(ir_instruction *ir, enum tgsi_opcode op,
st_dst_reg dst,
st_src_reg src0, st_src_reg src1,
st_src_reg src2, st_src_reg src3)
* Determines whether to use an integer, unsigned integer, or float opcode
* based on the operands and input opcode, then emits the result.
*/
-unsigned
-glsl_to_tgsi_visitor::get_opcode(unsigned op,
+enum tgsi_opcode
+glsl_to_tgsi_visitor::get_opcode(enum tgsi_opcode op,
st_dst_reg dst,
st_src_reg src0, st_src_reg src1)
{
st_dst_reg dst, st_src_reg src0, st_src_reg src1,
unsigned elements)
{
- static const unsigned dot_opcodes[] = {
+ static const enum tgsi_opcode dot_opcodes[] = {
TGSI_OPCODE_DP2, TGSI_OPCODE_DP3, TGSI_OPCODE_DP4
};
* to produce dest channels.
*/
void
-glsl_to_tgsi_visitor::emit_scalar(ir_instruction *ir, unsigned op,
+glsl_to_tgsi_visitor::emit_scalar(ir_instruction *ir, enum tgsi_opcode op,
st_dst_reg dst,
st_src_reg orig_src0, st_src_reg orig_src1)
{
}
void
-glsl_to_tgsi_visitor::emit_scalar(ir_instruction *ir, unsigned op,
+glsl_to_tgsi_visitor::emit_scalar(ir_instruction *ir, enum tgsi_opcode op,
st_dst_reg dst, st_src_reg src0)
{
st_src_reg undef = undef_src;
glsl_to_tgsi_visitor::emit_arl(ir_instruction *ir,
st_dst_reg dst, st_src_reg src0)
{
- int op = TGSI_OPCODE_ARL;
+ enum tgsi_opcode op = TGSI_OPCODE_ARL;
if (src0.type == GLSL_TYPE_INT || src0.type == GLSL_TYPE_UINT) {
if (!this->need_uarl && src0.is_legal_tgsi_address_operand())
* emit_asm() might have actually split the op into pieces, e.g. for
* double stores. We have to go back and fix up all the generated ops.
*/
- unsigned op = inst->op;
+ enum tgsi_opcode op = inst->op;
do {
inst->resource = *buf;
if (access)
case ir_binop_lshift:
case ir_binop_rshift:
if (native_integers) {
- unsigned opcode = ir->operation == ir_binop_lshift ? TGSI_OPCODE_SHL
- : TGSI_OPCODE_ISHR;
+ enum tgsi_opcode opcode = ir->operation == ir_binop_lshift
+ ? TGSI_OPCODE_SHL : TGSI_OPCODE_ISHR;
st_src_reg count;
if (glsl_base_type_is_64bit(op[0].type)) {
val->accept(this);
st_src_reg data = this->result, data2 = undef_src;
- unsigned opcode;
+ enum tgsi_opcode opcode;
switch (ir->callee->intrinsic_id) {
case ir_intrinsic_atomic_counter_add:
opcode = TGSI_OPCODE_ATOMUADD;
val->accept(this);
st_src_reg data = this->result, data2 = undef_src;
- unsigned opcode;
+ enum tgsi_opcode opcode;
switch (ir->callee->intrinsic_id) {
case ir_intrinsic_ssbo_atomic_add:
opcode = TGSI_OPCODE_ATOMUADD;
val->accept(this);
st_src_reg data = this->result, data2 = undef_src;
- unsigned opcode;
+ enum tgsi_opcode opcode;
switch (ir->callee->intrinsic_id) {
case ir_intrinsic_shared_atomic_add:
opcode = TGSI_OPCODE_ATOMUADD;
assert(param->is_tail_sentinel());
- unsigned opcode;
+ enum tgsi_opcode opcode;
switch (ir->callee->intrinsic_id) {
case ir_intrinsic_image_load:
opcode = TGSI_OPCODE_LOAD;
}
void
-glsl_to_tgsi_visitor::visit_generic_intrinsic(ir_call *ir, unsigned op)
+glsl_to_tgsi_visitor::visit_generic_intrinsic(ir_call *ir, enum tgsi_opcode op)
{
ir->return_deref->accept(this);
st_dst_reg dst = st_dst_reg(this->result);
st_src_reg levels_src, reladdr;
st_dst_reg result_dst, coord_dst, cube_sc_dst;
glsl_to_tgsi_instruction *inst = NULL;
- unsigned opcode = TGSI_OPCODE_NOP;
+ enum tgsi_opcode opcode = TGSI_OPCODE_NOP;
const glsl_type *sampler_type = ir->sampler->type;
unsigned sampler_array_size = 1, sampler_base = 0;
bool is_cube_array = false, is_cube_shadow = false;
void
glsl_to_tgsi_visitor::visit(ir_if *ir)
{
- unsigned if_opcode;
+ enum tgsi_opcode if_opcode;
glsl_to_tgsi_instruction *if_inst;
ir->condition->accept(this);
(gl_texture_index) (NUM_TEXTURE_TARGETS - 1));
ASSERT_BITFIELD_SIZE(glsl_to_tgsi_instruction, image_format,
(enum pipe_format) (PIPE_FORMAT_COUNT - 1));
- ASSERT_BITFIELD_SIZE(glsl_to_tgsi_instruction, op, TGSI_OPCODE_LAST - 1);
+ ASSERT_BITFIELD_SIZE(glsl_to_tgsi_instruction, op,
+ (enum tgsi_opcode) (TGSI_OPCODE_LAST - 1));
t = CALLOC_STRUCT(st_translate);
if (!t) {