diff options
author | Ilia Mirkin <imirkin@alum.mit.edu> | 2014-04-25 22:40:42 -0400 |
---|---|---|
committer | Ilia Mirkin <imirkin@alum.mit.edu> | 2014-04-28 19:05:16 -0400 |
commit | b4b20d42f6a8cd5aec3ba529a0b8d6ea22e73305 (patch) | |
tree | 6e4561bca3585baa22a3de0cd87b849f78f3d523 /src/gallium/drivers/nouveau/codegen/nv50_ir_emit_gk110.cpp | |
parent | 1db993f2fe1c2b43a9658efba6eac93665bb859c (diff) |
nvc0/ir: add support for new bitfield manipulation opcodes
This adds support for:
IBFE, UBFE, BFI, LSB, IMSB, UMSB, BREV, POPC
Which are all required for ARB_gs5 support.
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Diffstat (limited to 'src/gallium/drivers/nouveau/codegen/nv50_ir_emit_gk110.cpp')
-rw-r--r-- | src/gallium/drivers/nouveau/codegen/nv50_ir_emit_gk110.cpp | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/src/gallium/drivers/nouveau/codegen/nv50_ir_emit_gk110.cpp b/src/gallium/drivers/nouveau/codegen/nv50_ir_emit_gk110.cpp index c258b6b4fef..63d55252b54 100644 --- a/src/gallium/drivers/nouveau/codegen/nv50_ir_emit_gk110.cpp +++ b/src/gallium/drivers/nouveau/codegen/nv50_ir_emit_gk110.cpp @@ -94,6 +94,8 @@ private: void emitLogicOp(const Instruction *, uint8_t subOp); void emitPOPC(const Instruction *); void emitINSBF(const Instruction *); + void emitEXTBF(const Instruction *); + void emitBFIND(const Instruction *); void emitShift(const Instruction *); void emitSFnOp(const Instruction *, uint8_t subOp); @@ -696,6 +698,30 @@ CodeEmitterGK110::emitINSBF(const Instruction *i) } void +CodeEmitterGK110::emitEXTBF(const Instruction *i) +{ + emitForm_21(i, 0x600, 0xc00); + + if (i->dType == TYPE_S32) + code[1] |= 0x80000; + if (i->subOp == NV50_IR_SUBOP_EXTBF_REV) + code[1] |= 0x800; +} + +void +CodeEmitterGK110::emitBFIND(const Instruction *i) +{ + emitForm_21(i, 0x618, 0xc18); + + if (i->dType == TYPE_S32) + code[1] |= 0x80000; + if (i->src(0).mod == Modifier(NV50_IR_MOD_NOT)) + code[1] |= 0x800; + if (i->subOp == NV50_IR_SUBOP_BFIND_SAMT) + code[1] |= 0x1000; +} + +void CodeEmitterGK110::emitShift(const Instruction *i) { if (i->op == OP_SHR) { @@ -1725,6 +1751,15 @@ CodeEmitterGK110::emitInstruction(Instruction *insn) case OP_POPCNT: emitPOPC(insn); break; + case OP_INSBF: + emitINSBF(insn); + break; + case OP_EXTBF: + emitEXTBF(insn); + break; + case OP_BFIND: + emitBFIND(insn); + break; case OP_JOIN: emitNOP(insn); insn->join = 1; |