From 754d678b0ab894c4427d5181c17f02e11e2dc715 Mon Sep 17 00:00:00 2001 From: Kenneth Graunke Date: Tue, 4 Dec 2018 22:04:16 -0800 Subject: [PATCH] iris: Add _MI_ALU helpers that don't paste This lets you pass arguments as function parameters --- src/gallium/drivers/iris/iris_query.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) 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; -- 2.30.2