diff options
author | Jason Ekstrand <[email protected]> | 2016-03-28 12:27:40 -0700 |
---|---|---|
committer | Jason Ekstrand <[email protected]> | 2016-03-28 13:07:39 -0700 |
commit | 433cf90650f12039e16c2c245fd2e1cbf1ed3ac2 (patch) | |
tree | 73e365e9de3c9bcae92759b4139c35cf2e2c7f71 /src/compiler/nir/spirv | |
parent | 5d9afb65a60f022af0daddbb21bc57bb2c830606 (diff) |
nir/spirv: Remove the NoContraction hack
NIR now just handles this for us by not fusing if the multiply is marked as
exact.
Diffstat (limited to 'src/compiler/nir/spirv')
-rw-r--r-- | src/compiler/nir/spirv/vtn_alu.c | 23 |
1 files changed, 1 insertions, 22 deletions
diff --git a/src/compiler/nir/spirv/vtn_alu.c b/src/compiler/nir/spirv/vtn_alu.c index c9526f1d818..8b9a63ce760 100644 --- a/src/compiler/nir/spirv/vtn_alu.c +++ b/src/compiler/nir/spirv/vtn_alu.c @@ -329,30 +329,9 @@ vtn_handle_alu(struct vtn_builder *b, SpvOp opcode, /* Collect the various SSA sources */ const unsigned num_inputs = count - 3; struct vtn_ssa_value *vtn_src[4] = { NULL, }; - for (unsigned i = 0; i < num_inputs; i++) { + for (unsigned i = 0; i < num_inputs; i++) vtn_src[i] = vtn_ssa_value(b, w[i + 3]); - /* The way SPIR-V defines the NoContraction decoration is rediculous. - * It expressly says in the SPIR-V spec: - * - * "For example, if applied to an OpFMul, that multiply can’t be - * combined with an addition to yield a fused multiply-add - * operation." - * - * Technically, this means we would have to either rewrite NIR with - * another silly "don't fuse me" flag or we would have to propagate - * the NoContraction decoration to all consumers of a value which - * would make it far more infectious than anyone intended. - * - * Instead, we take a short-cut by simply looking at the sources and - * see if any of them have it. That should be good enough. - * - * See also issue #17 on the SPIR-V gitlab - */ - vtn_foreach_decoration(b, vtn_untyped_value(b, w[i + 3]), - handle_no_contraction, NULL); - } - if (glsl_type_is_matrix(vtn_src[0]->type) || (num_inputs >= 2 && glsl_type_is_matrix(vtn_src[1]->type))) { vtn_handle_matrix_alu(b, opcode, val, vtn_src[0], vtn_src[1]); |