On Thu, May 29, 2014 at 3:43 PM, Tobias Klausmann <tobias.johannes.klausm...@mni.thm.de> wrote: > Signed-off-by: Tobias Klausmann <tobias.johannes.klausm...@mni.thm.de> > --- > src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp | 10 ++++++++++ > 1 file changed, 10 insertions(+) > > diff --git a/src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp > b/src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp > index 93f7c2a..68b9a6d 100644 > --- a/src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp > +++ b/src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp > @@ -546,6 +546,16 @@ ConstantFolding::expr(Instruction *i, > } > break; > } > + case OP_POPCNT: { > + switch (i->dType) { > + case TYPE_S32: > + case TYPE_U32: > + res.data.u32 = util_bitcount(a->data.u32 & b->data.u32); break; > + default: > + return; > + } > + break; > + }
Why does the data type matter? I think you can handle this like AND is handled -- just always do it. Also, please add support for a single-argument version of POPCNT. This will happen as a result of lowering for sm50 (maxwell), for which it's a 1-arg instruction. Basically you need to add a case to opnd() which checks that there's only one argument and does it accordingly. [The existing function assumes a float op, and it'd be a pain to modify it.] > default: > return; > } > -- > 1.8.4.5 > _______________________________________________ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev