summaryrefslogtreecommitdiffstats
path: root/src/panfrost/midgard/helpers.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/panfrost/midgard/helpers.h')
-rw-r--r--src/panfrost/midgard/helpers.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/panfrost/midgard/helpers.h b/src/panfrost/midgard/helpers.h
index 92545cfc787..0cd2e71862c 100644
--- a/src/panfrost/midgard/helpers.h
+++ b/src/panfrost/midgard/helpers.h
@@ -177,8 +177,8 @@ quadword_size(int tag)
#define SSA_UNUSED_1 -2
#define SSA_FIXED_SHIFT 24
-#define SSA_FIXED_REGISTER(reg) ((1 + reg) << SSA_FIXED_SHIFT)
-#define SSA_REG_FROM_FIXED(reg) ((reg >> SSA_FIXED_SHIFT) - 1)
+#define SSA_FIXED_REGISTER(reg) (((1 + (reg)) << SSA_FIXED_SHIFT) | 1)
+#define SSA_REG_FROM_FIXED(reg) ((((reg) & ~1) >> SSA_FIXED_SHIFT) - 1)
#define SSA_FIXED_MINIMUM SSA_FIXED_REGISTER(0)
/* Swizzle support */