https://gcc.gnu.org/bugzilla/show_bug.cgi?id=127100

--- Comment #5 from Robin Dapp <rdapp at gcc dot gnu.org> ---
(In reply to Jakub Jelinek from comment #4)
> riscv for which r14-1932 was done only uses 0 bias, so it is just s390 that
> uses bias -1.  So I wonder if it just wasn't a documentation mistake in
> r14-1932 which then lead to wrong change in r16-5984.

I originally, when introducing bias, started with len - bias.
See e.g.

+      gassign *minus = gimple_build_assign (adjusted_len, PLUS_EXPR,

where the gassign still has the old name but uses PLUS_EXPR (grml).

If the effective length is 0 (the value passed to the s390 insn), it loads 1
byte as it is a byte index rather than a length.  So the unbiased length is 1,
we add -1 and have a biased length of 0 that gets passed around as
bias_adjusted_ctrl.

The docs specify that only 0 and -1 are supported bias values and that never
changed.  So following that, we should subtract here, vn already does len +
-bias.

I can take it but won't get to it very soon.  If somebody else wants to, feel
free.

The whole len area is messy/inconsistent and something I wanted to clean up
this year but haven't found time yet...

Reply via email to