Mesa (master): i965: Define GEN_GE/GEN_LE macros in terms of GEN_LT.

Matt Turner mattst88 at kemper.freedesktop.org
Wed May 4 05:59:50 UTC 2016


Module: Mesa
Branch: master
Commit: 9f81434c5f593bd50a9069c5e845a5730ed501db
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=9f81434c5f593bd50a9069c5e845a5730ed501db

Author: Matt Turner <mattst88 at gmail.com>
Date:   Sun May  1 13:20:25 2016 -0700

i965: Define GEN_GE/GEN_LE macros in terms of GEN_LT.

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>
Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>

---

 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 369bc34..48c8439 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 },




More information about the mesa-commit mailing list