[Mesa-dev] [PATCH v3] nv50/ir: emit VOTE instruction

Samuel Pitoiset samuel.pitoiset at gmail.com
Wed Mar 2 15:36:01 UTC 2016



On 03/02/2016 04:32 PM, Matt Turner wrote:
> On Sun, Feb 28, 2016 at 11:44 AM, Samuel Pitoiset
> <samuel.pitoiset at gmail.com> wrote:
>> Changes from v2:
>>   - add missing NOT modifier for GK110/GM107
>>
>> Signed-off-by: Samuel Pitoiset <samuel.pitoiset at gmail.com>
>> ---
>>   src/gallium/drivers/nouveau/codegen/nv50_ir.h      |  4 +++
>>   .../drivers/nouveau/codegen/nv50_ir_emit_gk110.cpp | 23 +++++++++++++++++
>>   .../drivers/nouveau/codegen/nv50_ir_emit_gm107.cpp | 29 ++++++++++++++++++++++
>>   .../drivers/nouveau/codegen/nv50_ir_emit_nvc0.cpp  | 23 +++++++++++++++++
>>   .../drivers/nouveau/codegen/nv50_ir_print.cpp      |  1 +
>>   .../drivers/nouveau/codegen/nv50_ir_target.cpp     |  3 +++
>>   6 files changed, 83 insertions(+)
>>
>> diff --git a/src/gallium/drivers/nouveau/codegen/nv50_ir.h b/src/gallium/drivers/nouveau/codegen/nv50_ir.h
>> index 97ebed4..7b0eb2f 100644
>> --- a/src/gallium/drivers/nouveau/codegen/nv50_ir.h
>> +++ b/src/gallium/drivers/nouveau/codegen/nv50_ir.h
>> @@ -161,6 +161,7 @@ enum operation
>>      OP_VSEL,
>>      OP_CCTL, // cache control
>>      OP_SHFL, // warp shuffle
>> +   OP_VOTE,
>>      OP_LAST
>>   };
>>
>> @@ -244,6 +245,9 @@ enum operation
>>   #define NV50_IR_SUBOP_V2(d,a,b)    (((d) << 10) | ((b) << 5) | (a) | 0x4000)
>>   #define NV50_IR_SUBOP_V4(d,a,b)    (((d) << 10) | ((b) << 5) | (a) | 0x8000)
>>   #define NV50_IR_SUBOP_Vn(n)        ((n) >> 14)
>> +#define NV50_IR_SUBOP_VOTE_ALL 0
>> +#define NV50_IR_SUBOP_VOTE_ANY 1
>> +#define NV50_IR_SUBOP_VOTE_UNI 2
>>
>>   enum DataType
>>   {
>> 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 90c6a610..b6b3ec7 100644
>> --- a/src/gallium/drivers/nouveau/codegen/nv50_ir_emit_gk110.cpp
>> +++ b/src/gallium/drivers/nouveau/codegen/nv50_ir_emit_gk110.cpp
>> @@ -128,6 +128,8 @@ private:
>>
>>      void emitFlow(const Instruction *);
>>
>> +   void emitVOTE(const Instruction *);
>> +
>>      inline void defId(const ValueDef&, const int pos);
>>      inline void srcId(const ValueRef&, const int pos);
>>      inline void srcId(const ValueRef *, const int pos);
>> @@ -1371,6 +1373,24 @@ CodeEmitterGK110::emitFlow(const Instruction *i)
>>   }
>>
>>   void
>> +CodeEmitterGK110::emitVOTE(const Instruction *i)
>> +{
>> +   assert(i->src(0).getFile() == FILE_PREDICATE &&
>> +          i->def(1).getFile() == FILE_PREDICATE);
>> +
>> +   code[0] = 0x00000002;
>> +   code[1] = 0x86c00000 | (i->subOp << 19);
>> +
>> +   emitPredicate(i);
>> +
>> +   defId(i->def(0), 2);
>> +   defId(i->def(1), 48);
>> +   if (i->src(0).mod == Modifier(NV50_IR_MOD_NOT))
>> +      code[0] |= 1 << 45;
>
>
> This is broken.
>
> Presumably you want code[1] |= 1 << 23 instead?

Yes, I have a patch which fixes that but I forgot to send it.
Will do a bit later.

>

-- 
-Samuel


More information about the mesa-dev mailing list