[Mesa-dev] [PATCH] i965: Define GEN_GE/GEN_LE macros in terms of GEN_LT.

Kenneth Graunke kenneth at whitecape.org
Mon May 2 01:02:30 UTC 2016


On Sunday, May 1, 2016 1:25:20 PM PDT Matt Turner wrote:
> GEN_LT has a straightforward implementation on which we can build the
> GEN_GE and GEN_LE macros.
> 
> Suggested-by:  Ilia Mirkin <imirkin at alum.mit.edu>
> ---
>  src/mesa/drivers/dri/i965/brw_eu.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/src/mesa/drivers/dri/i965/brw_eu.c b/src/mesa/drivers/dri/i965/
brw_eu.c
> index 4dacac7..3fa0880 100644
> --- a/src/mesa/drivers/dri/i965/brw_eu.c
> +++ b/src/mesa/drivers/dri/i965/brw_eu.c
> @@ -352,8 +352,9 @@ enum gen {
>     GEN_ALL = ~0
>  };
>  
> -#define GEN_GE(gen) (~((gen) - 1) | gen)
> -#define GEN_LE(gen) (((gen) - 1) | gen)
> +#define GEN_LT(gen) ((gen) - 1)
> +#define GEN_GE(gen) (~GEN_LT(gen))
> +#define GEN_LE(gen) (GEN_LT(gen) | (gen))
>  
>  static const struct opcode_desc opcode_10_descs[] = {
>     { .name = "dim",   .nsrc = 0, .ndst = 0, .gens = GEN75 },
> 

Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: This is a digitally signed message part.
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20160501/facc6b40/attachment.sig>


More information about the mesa-dev mailing list