OSDN Git Service

tcg/optimize: Propagate sign info for shifting
authorRichard Henderson <richard.henderson@linaro.org>
Thu, 26 Aug 2021 20:24:59 +0000 (13:24 -0700)
committerRichard Henderson <richard.henderson@linaro.org>
Fri, 29 Oct 2021 03:55:07 +0000 (20:55 -0700)
commit93a967fbb571ae34857c769dbf0bcc08f2286328
tree6d48adccdac938a187965e46ff3a029432a8ec84
parent2b9d0c59edec097c72ce9b917d3c08dc5d59cdda
tcg/optimize: Propagate sign info for shifting

For constant shifts, we can simply shift the s_mask.

For variable shifts, we know that sar does not reduce
the s_mask, which helps for sequences like

    ext32s_i64  t, in
    sar_i64     t, t, v
    ext32s_i64  out, t

allowing the final extend to be eliminated.

Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Luis Pires <luis.pires@eldorado.org.br>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
tcg/optimize.c