[PATCH v4 49/51] tcg/optimize: Propagate sign info for setcond

Richard Henderson posted 51 patches 4 years, 3 months ago
Maintainers: Richard Henderson <richard.henderson@linaro.org>
[PATCH v4 49/51] tcg/optimize: Propagate sign info for setcond
Posted by Richard Henderson 4 years, 3 months ago
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.

Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
 tcg/optimize.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/tcg/optimize.c b/tcg/optimize.c
index 311d9779f2..515087876c 100644
--- a/tcg/optimize.c
+++ b/tcg/optimize.c
@@ -1729,6 +1729,7 @@ static bool fold_setcond(OptContext *ctx, TCGOp *op)
     }
 
     ctx->z_mask = 1;
+    ctx->s_mask = smask_from_zmask(1);
     return false;
 }
 
@@ -1801,6 +1802,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:
-- 
2.25.1


RE: [PATCH v4 49/51] tcg/optimize: Propagate sign info for setcond
Posted by Luis Fernando Fujita Pires 4 years, 3 months ago
From: Richard Henderson <richard.henderson@linaro.org>
> 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.
> 
> Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
> ---
>  tcg/optimize.c | 2 ++
>  1 file changed, 2 insertions(+)

Reviewed-by: Luis Pires <luis.pires@eldorado.org.br>

--
Luis Pires
Instituto de Pesquisas ELDORADO
Aviso Legal - Disclaimer <https://www.eldorado.org.br/disclaimer.html>