From 28ff66a13c9dcc7aeb7bcff8d173495ee53deef9 Mon Sep 17 00:00:00 2001 From: Damien Lespiau Date: Thu, 31 Jan 2013 14:28:00 +0000 Subject: assembler: Put struct opcode_desc back in brw_context.h I originally moved struct opcode_desc from brw_context.h to brw_eu.h on the mesa side, but that was before the realization we needed struct brw_context if we wanted to not touch the code too much. So put it back there now that the mesa patch has been dropped. Signed-off-by: Damien Lespiau --- assembler/brw_context.h | 14 ++++++++++++++ assembler/brw_disasm.c | 17 +++++++++-------- assembler/brw_eu.h | 11 ----------- 3 files changed, 23 insertions(+), 19 deletions(-) (limited to 'assembler') diff --git a/assembler/brw_context.h b/assembler/brw_context.h index 16a9f702..90e66f71 100644 --- a/assembler/brw_context.h +++ b/assembler/brw_context.h @@ -31,6 +31,9 @@ #define __BRW_CONTEXT_H__ #include +#include + +#include "brw_structs.h" #ifdef __cplusplus extern "C" { @@ -57,6 +60,17 @@ struct brw_context bool brw_init_context(struct brw_context *brw, int gen); +/* brw_disasm.c */ +struct opcode_desc { + char *name; + int nsrc; + int ndst; +}; + +extern const struct opcode_desc opcode_descs[128]; + +int brw_disasm (FILE *file, struct brw_instruction *inst, int gen); + #ifdef __cplusplus } /* end of extern "C" */ #endif diff --git a/assembler/brw_disasm.c b/assembler/brw_disasm.c index 8524d410..9781f6bd 100644 --- a/assembler/brw_disasm.c +++ b/assembler/brw_disasm.c @@ -27,7 +27,8 @@ #include #include -#include "brw_eu.h" +#include "brw_context.h" +#include "brw_defines.h" const struct opcode_desc opcode_descs[128] = { [BRW_OPCODE_MOV] = { .name = "mov", .nsrc = 1, .ndst = 1 }, @@ -99,7 +100,7 @@ static const char * const conditional_modifier[16] = { [BRW_CONDITIONAL_U] = ".u", }; -static const char * const negate_op[2] = { +static const char * const negate[2] = { [0] = "", [1] = "-", }; @@ -602,7 +603,7 @@ static int src_da1 (FILE *file, GLuint type, GLuint _reg_file, GLuint reg_num, GLuint sub_reg_num, GLuint __abs, GLuint _negate) { int err = 0; - err |= control (file, "negate", negate_op, _negate, NULL); + err |= control (file, "negate", negate, _negate, NULL); err |= control (file, "abs", _abs, __abs, NULL); err |= reg (file, _reg_file, reg_num); @@ -628,7 +629,7 @@ static int src_ia1 (FILE *file, GLuint _vert_stride) { int err = 0; - err |= control (file, "negate", negate_op, _negate, NULL); + err |= control (file, "negate", negate, _negate, NULL); err |= control (file, "abs", _abs, __abs, NULL); string (file, "g[a0"); @@ -656,7 +657,7 @@ static int src_da16 (FILE *file, GLuint swz_w) { int err = 0; - err |= control (file, "negate", negate_op, _negate, NULL); + err |= control (file, "negate", negate, _negate, NULL); err |= control (file, "abs", _abs, __abs, NULL); err |= reg (file, _reg_file, _reg_nr); @@ -707,7 +708,7 @@ static int src0_3src (FILE *file, struct brw_instruction *inst) GLuint swz_z = (inst->bits2.da3src.src0_swizzle >> 4) & 0x3; GLuint swz_w = (inst->bits2.da3src.src0_swizzle >> 6) & 0x3; - err |= control (file, "negate", negate_op, inst->bits1.da3src.src0_negate, NULL); + err |= control (file, "negate", negate, inst->bits1.da3src.src0_negate, NULL); err |= control (file, "abs", _abs, inst->bits1.da3src.src0_abs, NULL); err |= reg (file, BRW_GENERAL_REGISTER_FILE, inst->bits2.da3src.src0_reg_nr); @@ -757,7 +758,7 @@ static int src1_3src (FILE *file, struct brw_instruction *inst) GLuint src1_subreg_nr = (inst->bits2.da3src.src1_subreg_nr_low | (inst->bits3.da3src.src1_subreg_nr_high << 2)); - err |= control (file, "negate", negate_op, inst->bits1.da3src.src1_negate, + err |= control (file, "negate", negate, inst->bits1.da3src.src1_negate, NULL); err |= control (file, "abs", _abs, inst->bits1.da3src.src1_abs, NULL); @@ -808,7 +809,7 @@ static int src2_3src (FILE *file, struct brw_instruction *inst) GLuint swz_z = (inst->bits3.da3src.src2_swizzle >> 4) & 0x3; GLuint swz_w = (inst->bits3.da3src.src2_swizzle >> 6) & 0x3; - err |= control (file, "negate", negate_op, inst->bits1.da3src.src2_negate, + err |= control (file, "negate", negate, inst->bits1.da3src.src2_negate, NULL); err |= control (file, "abs", _abs, inst->bits1.da3src.src2_abs, NULL); diff --git a/assembler/brw_eu.h b/assembler/brw_eu.h index 5d623c04..83c82d16 100644 --- a/assembler/brw_eu.h +++ b/assembler/brw_eu.h @@ -420,17 +420,6 @@ void brw_optimize(struct brw_compile *p); void brw_remove_duplicate_mrf_moves(struct brw_compile *p); void brw_remove_grf_to_mrf_moves(struct brw_compile *p); -/* brw_disasm.c */ -struct opcode_desc { - char *name; - int nsrc; - int ndst; -}; - -extern const struct opcode_desc opcode_descs[128]; - -int brw_disasm (FILE *file, struct brw_instruction *inst, int gen); - #ifdef __cplusplus } #endif -- cgit v1.2.3