summaryrefslogtreecommitdiffstats
path: root/src/glsl
diff options
context:
space:
mode:
authorMatt Turner <[email protected]>2016-01-11 12:13:24 -0800
committerMatt Turner <[email protected]>2016-01-13 10:35:12 -0800
commit92f177386954caced2e7ddca156917cf166f9c23 (patch)
treef2bdcfe953170f5d35d9fd7a90f1346f586e4c43 /src/glsl
parent7dc2e5f94024746ab2e39f77ab778fe3b89c0eb1 (diff)
nir: Fix constant evaluation of bfm.
NIR's bfm, like Intel/AMD's hardware instructions and GLSL IR's ir_binop_bfm takes <bits> as src0 and <offset> as src1. Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Iago Toral Quiroga <[email protected]>
Diffstat (limited to 'src/glsl')
-rw-r--r--src/glsl/nir/nir_opcodes.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/glsl/nir/nir_opcodes.py b/src/glsl/nir/nir_opcodes.py
index d31507fe531..398ae50f9f7 100644
--- a/src/glsl/nir/nir_opcodes.py
+++ b/src/glsl/nir/nir_opcodes.py
@@ -512,7 +512,7 @@ binop_horiz("pack_half_2x16_split", 1, tuint, 1, tfloat, 1, tfloat,
"pack_half_1x16(src0.x) | (pack_half_1x16(src1.x) << 16)")
binop_convert("bfm", tuint, tint, "", """
-int offset = src0, bits = src1;
+int bits = src0, offset = src1;
if (offset < 0 || bits < 0 || offset + bits > 32)
dst = 0; /* undefined per the spec */
else