summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJason Ekstrand <[email protected]>2016-01-04 17:32:33 -0800
committerJason Ekstrand <[email protected]>2016-01-04 17:37:10 -0800
commit3a3c4aecf16baad74417f1bcb05730043af6f9cf (patch)
tree1bb58d7d9ceb92b1c86a7bed45b4e19cff934af6 /src
parent01ba96e0593251aed33bc44960d8f3ae0013b9a2 (diff)
nir/spirv: Add support for bitfield operations
Diffstat (limited to 'src')
-rw-r--r--src/glsl/nir/spirv/spirv_to_nir.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/glsl/nir/spirv/spirv_to_nir.c b/src/glsl/nir/spirv/spirv_to_nir.c
index 9a5cedd5d95..1dfce1f87bc 100644
--- a/src/glsl/nir/spirv/spirv_to_nir.c
+++ b/src/glsl/nir/spirv/spirv_to_nir.c
@@ -2729,6 +2729,12 @@ vtn_handle_alu(struct vtn_builder *b, SpvOp opcode,
case SpvOpSelect: op = nir_op_bcsel; break;
case SpvOpIEqual: op = nir_op_ieq; break;
+ case SpvOpBitFieldInsert: op = nir_op_bitfield_insert; break;
+ case SpvOpBitFieldSExtract: op = nir_op_ibitfield_extract; break;
+ case SpvOpBitFieldUExtract: op = nir_op_ubitfield_extract; break;
+ case SpvOpBitReverse: op = nir_op_bitfield_reverse; break;
+ case SpvOpBitCount: op = nir_op_bit_count; break;
+
/* Comparisons: (TODO: How do we want to handled ordered/unordered?) */
case SpvOpFOrdEqual: op = nir_op_feq; break;
case SpvOpFUnordEqual: op = nir_op_feq; break;
@@ -3672,6 +3678,11 @@ vtn_handle_body_instruction(struct vtn_builder *b, SpvOp opcode,
case SpvOpDPdxCoarse:
case SpvOpDPdyCoarse:
case SpvOpFwidthCoarse:
+ case SpvOpBitFieldInsert:
+ case SpvOpBitFieldSExtract:
+ case SpvOpBitFieldUExtract:
+ case SpvOpBitReverse:
+ case SpvOpBitCount:
vtn_handle_alu(b, opcode, w, count);
break;