diff options
Diffstat (limited to 'src/gallium/drivers/nv50/nv50_pc.h')
-rw-r--r-- | src/gallium/drivers/nv50/nv50_pc.h | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/src/gallium/drivers/nv50/nv50_pc.h b/src/gallium/drivers/nv50/nv50_pc.h index adc46dec8db..703d32d334e 100644 --- a/src/gallium/drivers/nv50/nv50_pc.h +++ b/src/gallium/drivers/nv50/nv50_pc.h @@ -347,9 +347,10 @@ struct nv_pc { }; void nvbb_insert_tail(struct nv_basic_block *, struct nv_instruction *); +void nvi_insert_after(struct nv_instruction *, struct nv_instruction *); static INLINE struct nv_instruction * -new_instruction(struct nv_pc *pc, uint opcode) +nv_alloc_instruction(struct nv_pc *pc, uint opcode) { struct nv_instruction *insn; @@ -359,10 +360,27 @@ new_instruction(struct nv_pc *pc, uint opcode) insn->cc = NV_CC_TR; insn->opcode = opcode; + return insn; +} + +static INLINE struct nv_instruction * +new_instruction(struct nv_pc *pc, uint opcode) +{ + struct nv_instruction *insn = nv_alloc_instruction(pc, opcode); + nvbb_insert_tail(pc->current_block, insn); return insn; } +static INLINE struct nv_instruction * +new_instruction_at(struct nv_pc *pc, struct nv_instruction *at, uint opcode) +{ + struct nv_instruction *insn = nv_alloc_instruction(pc, opcode); + + nvi_insert_after(at, insn); + return insn; +} + static INLINE struct nv_value * new_value(struct nv_pc *pc, ubyte file, ubyte type) { |