aboutsummaryrefslogtreecommitdiffstats
path: root/src/compiler/nir/nir_clone.c
diff options
context:
space:
mode:
authorCaio Marcelo de Oliveira Filho <[email protected]>2019-05-17 13:46:38 -0700
committerCaio Marcelo de Oliveira Filho <[email protected]>2019-06-26 14:13:02 -0700
commitae37237713681121d7fa83489ef9370e3fdcce2a (patch)
treedff2088713308310e7d2ec9390a62d3d28866987 /src/compiler/nir/nir_clone.c
parentf97dcb7a55bac650e55bb58182d0af16ba384305 (diff)
nir: Add a no wrapping bits to nir_alu_instr
They indicate the operation does not cause overflow or underflow. This is motivated by SPIR-V decorations NoSignedWrap and NoUnsignedWrap. Change the storage of `exact` to be a single bit, so they pack together. v2: Handle no_wrap in nir_instr_set. (Karol) v3: Use two separate flags, since the NIR SSA values and certain instructions are typeless, so just no_wrap would be insufficient to know which one was referred to. (Connor) v4: Don't use nir_instr_set to propagate the flags, unlike `exact`, consider the instructions different if the flags have different values. Fix hashing/comparing. (Jason) Reviewed-by: Karol Herbst <[email protected]> [v1] Reviewed-by: Jason Ekstrand <[email protected]>
Diffstat (limited to 'src/compiler/nir/nir_clone.c')
-rw-r--r--src/compiler/nir/nir_clone.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/compiler/nir/nir_clone.c b/src/compiler/nir/nir_clone.c
index 803923e2578..71303086db7 100644
--- a/src/compiler/nir/nir_clone.c
+++ b/src/compiler/nir/nir_clone.c
@@ -290,6 +290,8 @@ clone_alu(clone_state *state, const nir_alu_instr *alu)
{
nir_alu_instr *nalu = nir_alu_instr_create(state->ns, alu->op);
nalu->exact = alu->exact;
+ nalu->no_signed_wrap = alu->no_signed_wrap;
+ nalu->no_unsigned_wrap = alu->no_unsigned_wrap;
__clone_dst(state, &nalu->instr, &nalu->dest.dest, &alu->dest.dest);
nalu->dest.saturate = alu->dest.saturate;