Kenneth Graunke <kenn...@whitecape.org> writes: > These helper macros save you from writing nasty expressions like: > > if ((inst->src[1].type == BRW_REGISTER_TYPE_F && > inst->src[1].imm.f == 1.0) || > ((inst->src[1].type == BRW_REGISTER_TYPE_D || > inst->src[1].type == BRW_REGISTER_TYPE_UD) && > inst->src[1].imm.u == 1)) { > > Instead, you simply get to write inst->src[1].is_one(). Simple. > Also, this makes the FS backend match the VS backend (which has these). > > This patch also converts opt_algebraic to use the new helper functions. > As a consequence, it will now also optimize integer-typed expressions.
Reviewed-by: Eric Anholt <e...@anholt.net>
pgpznfNpcrmf3.pgp
Description: PGP signature
_______________________________________________ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev