diff mbox series

[v3,46/48] tcg/optimize: Propagate sign info for setcond

Message ID 20211021210539.825582-47-richard.henderson@linaro.org
State Superseded
Headers show
Series tcg: optimize redundant sign extensions | expand

Commit Message

Richard Henderson Oct. 21, 2021, 9:05 p.m. UTC
The result is either 0 or 1, which means that we have
a 2 bit signed result, and thus 62 bits of sign.
For clarity, use the smask_from_zmask function.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>

---
 tcg/optimize.c | 2 ++
 1 file changed, 2 insertions(+)

-- 
2.25.1

Comments

Alex Bennée Oct. 26, 2021, 4:36 p.m. UTC | #1
Richard Henderson <richard.henderson@linaro.org> writes:

> The result is either 0 or 1, which means that we have

> a 2 bit signed result, and thus 62 bits of sign.

> For clarity, use the smask_from_zmask function.

>

> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>


Reviewed-by: Alex Bennée <alex.bennee@linaro.org>


-- 
Alex Bennée
diff mbox series

Patch

diff --git a/tcg/optimize.c b/tcg/optimize.c
index d08cf7e4eb..64d3256bbc 100644
--- a/tcg/optimize.c
+++ b/tcg/optimize.c
@@ -1688,6 +1688,7 @@  static bool fold_setcond(OptContext *ctx, TCGOp *op)
     }
 
     ctx->z_mask = 1;
+    ctx->s_mask = smask_from_zmask(1);
     return false;
 }
 
@@ -1760,6 +1761,7 @@  static bool fold_setcond2(OptContext *ctx, TCGOp *op)
     }
 
     ctx->z_mask = 1;
+    ctx->s_mask = smask_from_zmask(1);
     return false;
 
  do_setcond_const: