diff --git a/src/gallium/drivers/r300/compiler/nir_to_rc.c b/src/gallium/drivers/r300/compiler/nir_to_rc.c index 409538c71d2..275c9974617 100644 --- a/src/gallium/drivers/r300/compiler/nir_to_rc.c +++ b/src/gallium/drivers/r300/compiler/nir_to_rc.c @@ -11,8 +11,6 @@ #include "compiler/nir/nir_worklist.h" #include "compiler/radeon_code.h" #include "compiler/radeon_program_constants.h" -#include "r300_nir.h" -#include "r300_screen.h" #include "pipe/p_screen.h" #include "pipe/p_state.h" #include "tgsi/tgsi_dump.h" @@ -126,53 +124,53 @@ ntr_insn(struct ntr_compile *c, enum tgsi_opcode opcode, struct ureg_dst dst, st return util_dynarray_top_ptr(&c->cur_block->insns, struct ntr_insn); } -#define OP00(op) \ - static inline void ntr_##op(struct ntr_compile *c) \ - { \ - ntr_insn(c, TGSI_OPCODE_##op, ureg_dst_undef(), ureg_src_undef(), ureg_src_undef(), \ - ureg_src_undef(), ureg_src_undef()); \ +#define OP00(op) \ + static inline void ntr_##op(struct ntr_compile *c) \ + { \ + ntr_insn(c, TGSI_OPCODE_##op, ureg_dst_undef(), ureg_src_undef(), ureg_src_undef(), \ + ureg_src_undef(), ureg_src_undef()); \ } -#define OP01(op) \ - static inline void ntr_##op(struct ntr_compile *c, struct ureg_src src0) \ - { \ - ntr_insn(c, TGSI_OPCODE_##op, ureg_dst_undef(), src0, ureg_src_undef(), ureg_src_undef(), \ - ureg_src_undef()); \ +#define OP01(op) \ + static inline void ntr_##op(struct ntr_compile *c, struct ureg_src src0) \ + { \ + ntr_insn(c, TGSI_OPCODE_##op, ureg_dst_undef(), src0, ureg_src_undef(), ureg_src_undef(), \ + ureg_src_undef()); \ } -#define OP10(op) \ - static inline void ntr_##op(struct ntr_compile *c, struct ureg_dst dst) \ - { \ - ntr_insn(c, TGSI_OPCODE_##op, dst, ureg_src_undef(), ureg_src_undef(), ureg_src_undef(), \ - ureg_src_undef()); \ +#define OP10(op) \ + static inline void ntr_##op(struct ntr_compile *c, struct ureg_dst dst) \ + { \ + ntr_insn(c, TGSI_OPCODE_##op, dst, ureg_src_undef(), ureg_src_undef(), ureg_src_undef(), \ + ureg_src_undef()); \ } -#define OP11(op) \ - static inline void ntr_##op(struct ntr_compile *c, struct ureg_dst dst, struct ureg_src src0) \ - { \ - ntr_insn(c, TGSI_OPCODE_##op, dst, src0, ureg_src_undef(), ureg_src_undef(), \ - ureg_src_undef()); \ +#define OP11(op) \ + static inline void ntr_##op(struct ntr_compile *c, struct ureg_dst dst, struct ureg_src src0) \ + { \ + ntr_insn(c, TGSI_OPCODE_##op, dst, src0, ureg_src_undef(), ureg_src_undef(), \ + ureg_src_undef()); \ } -#define OP12(op) \ - static inline void ntr_##op(struct ntr_compile *c, struct ureg_dst dst, struct ureg_src src0, \ - struct ureg_src src1) \ - { \ - ntr_insn(c, TGSI_OPCODE_##op, dst, src0, src1, ureg_src_undef(), ureg_src_undef()); \ +#define OP12(op) \ + static inline void ntr_##op(struct ntr_compile *c, struct ureg_dst dst, struct ureg_src src0, \ + struct ureg_src src1) \ + { \ + ntr_insn(c, TGSI_OPCODE_##op, dst, src0, src1, ureg_src_undef(), ureg_src_undef()); \ } -#define OP13(op) \ - static inline void ntr_##op(struct ntr_compile *c, struct ureg_dst dst, struct ureg_src src0, \ - struct ureg_src src1, struct ureg_src src2) \ - { \ - ntr_insn(c, TGSI_OPCODE_##op, dst, src0, src1, src2, ureg_src_undef()); \ +#define OP13(op) \ + static inline void ntr_##op(struct ntr_compile *c, struct ureg_dst dst, struct ureg_src src0, \ + struct ureg_src src1, struct ureg_src src2) \ + { \ + ntr_insn(c, TGSI_OPCODE_##op, dst, src0, src1, src2, ureg_src_undef()); \ } -#define OP14(op) \ - static inline void ntr_##op(struct ntr_compile *c, struct ureg_dst dst, struct ureg_src src0, \ - struct ureg_src src1, struct ureg_src src2, struct ureg_src src3) \ - { \ - ntr_insn(c, TGSI_OPCODE_##op, dst, src0, src1, src2, src3); \ +#define OP14(op) \ + static inline void ntr_##op(struct ntr_compile *c, struct ureg_dst dst, struct ureg_src src0, \ + struct ureg_src src1, struct ureg_src src2, struct ureg_src src3) \ + { \ + ntr_insn(c, TGSI_OPCODE_##op, dst, src0, src1, src2, src3); \ } /* We hand-craft our tex instructions */ diff --git a/src/gallium/drivers/r300/compiler/r300_fragprog_emit.c b/src/gallium/drivers/r300/compiler/r300_fragprog_emit.c index 0a7a52e1633..8d247dcc124 100644 --- a/src/gallium/drivers/r300/compiler/r300_fragprog_emit.c +++ b/src/gallium/drivers/r300/compiler/r300_fragprog_emit.c @@ -32,13 +32,13 @@ struct r300_emit_state { uint32_t node_flags; }; -#define PROG_CODE \ - struct r300_fragment_program_compiler *c = emit->compiler; \ +#define PROG_CODE \ + struct r300_fragment_program_compiler *c = emit->compiler; \ struct r300_fragment_program_code *code = &c->code->code.r300 -#define error(fmt, args...) \ - do { \ - rc_error(&c->Base, "%s::%s(): " fmt, __FILE__, __func__, ##args); \ +#define error(fmt, args...) \ + do { \ + rc_error(&c->Base, "%s::%s(): " fmt, __FILE__, __func__, ##args); \ } while (0) static unsigned int diff --git a/src/gallium/drivers/r300/compiler/r300_fragprog_swizzle.c b/src/gallium/drivers/r300/compiler/r300_fragprog_swizzle.c index 3ec0adea677..3f322ca2240 100644 --- a/src/gallium/drivers/r300/compiler/r300_fragprog_swizzle.c +++ b/src/gallium/drivers/r300/compiler/r300_fragprog_swizzle.c @@ -17,7 +17,7 @@ #include "r300_reg.h" #include "radeon_compiler.h" -#define MAKE_SWZ3(x, y, z) \ +#define MAKE_SWZ3(x, y, z) \ (RC_MAKE_SWIZZLE(RC_SWIZZLE_##x, RC_SWIZZLE_##y, RC_SWIZZLE_##z, RC_SWIZZLE_ZERO)) struct swizzle_data { diff --git a/src/gallium/drivers/r300/compiler/r300_nir.c b/src/gallium/drivers/r300/compiler/r300_nir.c index afaaf40a7af..627508acc8d 100644 --- a/src/gallium/drivers/r300/compiler/r300_nir.c +++ b/src/gallium/drivers/r300/compiler/r300_nir.c @@ -128,11 +128,11 @@ remove_clip_vertex(nir_builder *b, nir_instr *instr, UNUSED void *_) if (deref->deref_type == nir_deref_type_var && deref->var->data.mode == nir_var_shader_out && deref->var->data.location == VARYING_SLOT_CLIP_VERTEX) { - nir_foreach_use_safe(src, &deref->def) { - nir_instr_remove(nir_src_parent_instr(src)); - } - nir_instr_remove(instr); - return true; + nir_foreach_use_safe (src, &deref->def) { + nir_instr_remove(nir_src_parent_instr(src)); + } + nir_instr_remove(instr); + return true; } return false; } @@ -147,12 +147,12 @@ r300_optimize_nir(struct nir_shader *s, struct r300_screen *screen) if (nir_shader_instructions_pass(s, remove_clip_vertex, nir_metadata_control_flow, NULL)) { unsigned clip_vertex_location = 0; - nir_foreach_variable_with_modes(var, s, nir_var_shader_out) { + nir_foreach_variable_with_modes (var, s, nir_var_shader_out) { if (var->data.location == VARYING_SLOT_CLIP_VERTEX) { clip_vertex_location = var->data.driver_location; } } - nir_foreach_variable_with_modes(var, s, nir_var_shader_out) { + nir_foreach_variable_with_modes (var, s, nir_var_shader_out) { if (var->data.driver_location > clip_vertex_location) { var->data.driver_location--; } diff --git a/src/gallium/drivers/r300/compiler/r300_nir.h b/src/gallium/drivers/r300/compiler/r300_nir.h index dfc7032c816..18e8797e62e 100644 --- a/src/gallium/drivers/r300/compiler/r300_nir.h +++ b/src/gallium/drivers/r300/compiler/r300_nir.h @@ -50,7 +50,7 @@ static inline bool is_only_used_by_intrinsic(const nir_alu_instr *instr, nir_intrinsic_op op) { bool is_used = false; - nir_foreach_use(src, &instr->def) { + nir_foreach_use (src, &instr->def) { is_used = true; nir_instr *user_instr = nir_src_parent_instr(src); @@ -60,7 +60,7 @@ is_only_used_by_intrinsic(const nir_alu_instr *instr, nir_intrinsic_op op) const nir_intrinsic_instr *const user_intrinsic = nir_instr_as_intrinsic(user_instr); if (user_intrinsic->intrinsic != op) - return false; + return false; } return is_used; } diff --git a/src/gallium/drivers/r300/compiler/r3xx_vertprog.c b/src/gallium/drivers/r300/compiler/r3xx_vertprog.c index ffd4ccd128a..554e593cd17 100644 --- a/src/gallium/drivers/r300/compiler/r3xx_vertprog.c +++ b/src/gallium/drivers/r300/compiler/r3xx_vertprog.c @@ -25,9 +25,9 @@ * Take an already-setup and valid source then swizzle it appropriately to * obtain a constant ZERO or ONE source. */ -#define __CONST(x, y) \ - (PVS_SRC_OPERAND(t_src_index(vp, &vpi->SrcReg[x]), t_swizzle(y), t_swizzle(y), t_swizzle(y), \ - t_swizzle(y), t_src_class(vpi->SrcReg[x].File), RC_MASK_NONE) | \ +#define __CONST(x, y) \ + (PVS_SRC_OPERAND(t_src_index(vp, &vpi->SrcReg[x]), t_swizzle(y), t_swizzle(y), t_swizzle(y), \ + t_swizzle(y), t_src_class(vpi->SrcReg[x].File), RC_MASK_NONE) | \ (vpi->SrcReg[x].RelAddr << 4)) static unsigned long diff --git a/src/gallium/drivers/r300/compiler/r500_fragprog_emit.c b/src/gallium/drivers/r300/compiler/r500_fragprog_emit.c index fac09e6adbe..b96facc1e6f 100644 --- a/src/gallium/drivers/r300/compiler/r500_fragprog_emit.c +++ b/src/gallium/drivers/r300/compiler/r500_fragprog_emit.c @@ -25,9 +25,9 @@ #define PROG_CODE struct r500_fragment_program_code *code = &c->code->code.r500 -#define error(fmt, args...) \ - do { \ - rc_error(&c->Base, "%s::%s(): " fmt "\n", __FILE__, __func__, ##args); \ +#define error(fmt, args...) \ + do { \ + rc_error(&c->Base, "%s::%s(): " fmt "\n", __FILE__, __func__, ##args); \ } while (0) struct branch_info { @@ -544,8 +544,8 @@ emit_flowcontrol(struct emit_state *s, struct rc_instruction *inst) | R500_FC_B_POP_CNT(1); s->Code->inst[branch->Endif].inst3 = R500_FC_JUMP_ADDR(branch->Endif + 1); s->Code->inst[branch->If].inst2 = R500_FC_OP_JUMP | R500_FC_A_OP_NONE /* no address stack */ - | R500_FC_JUMP_FUNC(0x0f) /* jump if ALU result is false */ - | R500_FC_B_OP0_INCR /* increment branch counter if stay */ + | R500_FC_JUMP_FUNC(0x0f) /* jump if ALU result is false */ + | R500_FC_B_OP0_INCR /* increment branch counter if stay */ | R500_FC_IGNORE_UNCOVERED; if (branch->Else >= 0) { diff --git a/src/gallium/drivers/r300/compiler/radeon_compiler.h b/src/gallium/drivers/r300/compiler/radeon_compiler.h index 30683ed6871..8743c159fda 100644 --- a/src/gallium/drivers/r300/compiler/radeon_compiler.h +++ b/src/gallium/drivers/r300/compiler/radeon_compiler.h @@ -14,13 +14,15 @@ #define RC_DBG_LOG (1 << 0) -#define RC_MATH_DX 0x00 -#define RC_MATH_IEEE 0x01 -#define RC_MATH_FF 0x02 +#define RC_MATH_DX 0x00 +#define RC_MATH_IEEE 0x01 +#define RC_MATH_FF 0x02 struct rc_swizzle_caps; -enum rc_program_type { RC_VERTEX_PROGRAM, RC_FRAGMENT_PROGRAM, RC_NUM_PROGRAM_TYPES }; +enum rc_program_type { RC_VERTEX_PROGRAM, + RC_FRAGMENT_PROGRAM, + RC_NUM_PROGRAM_TYPES }; struct radeon_compiler { struct memory_pool Pool; @@ -126,7 +128,7 @@ struct radeon_compiler_pass { int dump; /* Dump the program if Debug == 1? */ int predicate; /* Run this pass? */ void (*run)(struct radeon_compiler *c, void *user); /* The main entrypoint. */ - void *user; /* Optional parameter which is passed to the run function. */ + void *user; /* Optional parameter which is passed to the run function. */ }; struct rc_program_stats { diff --git a/src/gallium/drivers/r300/compiler/radeon_inline_literals.c b/src/gallium/drivers/r300/compiler/radeon_inline_literals.c index 25ef0de6cbf..d1278dfef89 100644 --- a/src/gallium/drivers/r300/compiler/radeon_inline_literals.c +++ b/src/gallium/drivers/r300/compiler/radeon_inline_literals.c @@ -15,10 +15,10 @@ #define VERBOSE 0 -#define DBG(...) \ - do { \ - if (VERBOSE) \ - fprintf(stderr, __VA_ARGS__); \ +#define DBG(...) \ + do { \ + if (VERBOSE) \ + fprintf(stderr, __VA_ARGS__); \ } while (0) /* IEEE-754: diff --git a/src/gallium/drivers/r300/compiler/radeon_pair_schedule.c b/src/gallium/drivers/r300/compiler/radeon_pair_schedule.c index 790096a1008..3fa0e49d692 100644 --- a/src/gallium/drivers/r300/compiler/radeon_pair_schedule.c +++ b/src/gallium/drivers/r300/compiler/radeon_pair_schedule.c @@ -17,10 +17,10 @@ #define VERBOSE 0 -#define DBG(...) \ - do { \ - if (VERBOSE) \ - fprintf(stderr, __VA_ARGS__); \ +#define DBG(...) \ + do { \ + if (VERBOSE) \ + fprintf(stderr, __VA_ARGS__); \ } while (0) struct schedule_instruction { diff --git a/src/gallium/drivers/r300/compiler/radeon_program.h b/src/gallium/drivers/r300/compiler/radeon_program.h index fb6046cb35d..eea49f59f80 100644 --- a/src/gallium/drivers/r300/compiler/radeon_program.h +++ b/src/gallium/drivers/r300/compiler/radeon_program.h @@ -103,7 +103,8 @@ struct rc_sub_instruction { rc_omod_op Omod; }; -typedef enum { RC_INSTRUCTION_NORMAL = 0, RC_INSTRUCTION_PAIR } rc_instruction_type; +typedef enum { RC_INSTRUCTION_NORMAL = 0, + RC_INSTRUCTION_PAIR } rc_instruction_type; struct rc_instruction { struct rc_instruction *Prev; diff --git a/src/gallium/drivers/r300/compiler/radeon_program_constants.h b/src/gallium/drivers/r300/compiler/radeon_program_constants.h index 9c6f4f16824..4e0f72c85a5 100644 --- a/src/gallium/drivers/r300/compiler/radeon_program_constants.h +++ b/src/gallium/drivers/r300/compiler/radeon_program_constants.h @@ -103,9 +103,9 @@ is_swizzle_inline_constant(rc_swizzle swizzle) #define RC_MAKE_SWIZZLE_SMEAR(a) RC_MAKE_SWIZZLE((a), (a), (a), (a)) #define GET_SWZ(swz, idx) (((swz) >> ((idx) * 3)) & 0x7) #define GET_BIT(msk, idx) (((msk) >> (idx)) & 0x1) -#define SET_SWZ(swz, idx, newv) \ - do { \ - (swz) = ((swz) & ~(7 << ((idx) * 3))) | ((newv) << ((idx) * 3)); \ +#define SET_SWZ(swz, idx, newv) \ + do { \ + (swz) = ((swz) & ~(7 << ((idx) * 3))) | ((newv) << ((idx) * 3)); \ } while (0) #define RC_SWIZZLE_XYZW RC_MAKE_SWIZZLE(RC_SWIZZLE_X, RC_SWIZZLE_Y, RC_SWIZZLE_Z, RC_SWIZZLE_W) @@ -138,7 +138,9 @@ is_swizzle_inline_constant(rc_swizzle swizzle) #define RC_MASK_XYZW (RC_MASK_X | RC_MASK_Y | RC_MASK_Z | RC_MASK_W) /*@}*/ -typedef enum { RC_ALURESULT_NONE = 0, RC_ALURESULT_X, RC_ALURESULT_W } rc_write_aluresult; +typedef enum { RC_ALURESULT_NONE = 0, + RC_ALURESULT_X, + RC_ALURESULT_W } rc_write_aluresult; typedef enum { RC_PRESUB_NONE = 0, @@ -186,6 +188,8 @@ rc_presubtract_src_reg_count(rc_presubtract_op op) #define RC_SOURCE_RGB 0x1 #define RC_SOURCE_ALPHA 0x2 -typedef enum { RC_PRED_DISABLED, RC_PRED_SET, RC_PRED_INV } rc_predicate_mode; +typedef enum { RC_PRED_DISABLED, + RC_PRED_SET, + RC_PRED_INV } rc_predicate_mode; #endif /* RADEON_PROGRAM_CONSTANTS_H */ diff --git a/src/gallium/drivers/r300/compiler/radeon_regalloc.c b/src/gallium/drivers/r300/compiler/radeon_regalloc.c index 083b3151cd8..472077e7451 100644 --- a/src/gallium/drivers/r300/compiler/radeon_regalloc.c +++ b/src/gallium/drivers/r300/compiler/radeon_regalloc.c @@ -9,10 +9,10 @@ #define VERBOSE 0 -#define DBG(...) \ - do { \ - if (VERBOSE) \ - fprintf(stderr, __VA_ARGS__); \ +#define DBG(...) \ + do { \ + if (VERBOSE) \ + fprintf(stderr, __VA_ARGS__); \ } while (0) const struct rc_class rc_class_list_vp[] = {