From: Kenneth Graunke Date: Wed, 5 Dec 2018 06:04:16 +0000 (-0800) Subject: iris: Add _MI_ALU helpers that don't paste X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=754d678b0ab894c4427d5181c17f02e11e2dc715;p=mesa.git iris: Add _MI_ALU helpers that don't paste This lets you pass arguments as function parameters --- diff --git a/src/gallium/drivers/iris/iris_query.c b/src/gallium/drivers/iris/iris_query.c index a50d919d366..e07aea5dc47 100644 --- a/src/gallium/drivers/iris/iris_query.c +++ b/src/gallium/drivers/iris/iris_query.c @@ -83,10 +83,15 @@ #define MI_ALU_ZF 0x32 #define MI_ALU_CF 0x33 -#define MI_ALU0(op) ((MI_ALU_##op << 20)) -#define MI_ALU1(op, x) ((MI_ALU_##op << 20) | (MI_ALU_##x << 10)) -#define MI_ALU2(op, x, y) \ - ((MI_ALU_##op << 20) | (MI_ALU_##x << 10) | (MI_ALU_##y)) +#define _MI_ALU(op, x, y) (((op) << 20) | ((x) << 10) | (y)) + +#define _MI_ALU0(op) _MI_ALU(MI_ALU_##op, 0, 0) +#define _MI_ALU1(op, x) _MI_ALU(MI_ALU_##op, x, 0) +#define _MI_ALU2(op, x, y) _MI_ALU(MI_ALU_##op, x, y) + +#define MI_ALU0(op) _MI_ALU0(op) +#define MI_ALU1(op, x) _MI_ALU1(op, MI_ALU_##x) +#define MI_ALU2(op, x, y) _MI_ALU2(op, MI_ALU_##x, MI_ALU_##y) struct iris_query { enum pipe_query_type type;