On Fri, May 8, 2015 at 6:36 AM, Kenneth Graunke <kenn...@whitecape.org> wrote: > + # Multiplication by 4 comes up fairly often in indirect offset > calculations. > + # Some GPUs have weird integer multiplication limitations, but shifts > should work > + # equally well everywhere. > + (('imul', 4, a), ('ishl', a, 2)),
Not sure what the cost of doing it this way, but really you want all powers of 2... and also udiv -> shr. Since this is python, should be easy enough to append onto that list. AFAIK all GPU's prefer a shift over a mul. Adreno doen't have 32-bit imul in the first place (and no idiv either). In nouveau/codegen we just have a single check for whether the immediate is a power of 2, perhaps that can be encoded here in some way. Cheers, -ilia _______________________________________________ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev