This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [sh PATCH] PR/27717, sh backend lies to reload about index registers
Paolo Bonzini <paolo.bonzini@lu.unisi.ch> wrote:
>> Whether sh really needs that is beyond my understanding. The more I
>> read the patch, the more I hope it doesn't. For example, another way to
>> achieve the same would be to emit the memory access as an UNSPEC.
>
> As in this patch. I am curious whether anybody thinks it's too much of
> a hack (compared to INDEX_REG_CLASS_FOR_MODE).
>
> It fixes PR27117, and produces correct code by inspection and comparison
> with sh.md's example:
>
> movi (((datalabel ___div_table) >> 16) & 65535), r3
> shori ((datalabel ___div_table) & 65535), r3
> ...
> shari r1, 58, r6
> ldx.ub r3, r6, r7 ;; divsi_inv_qitable
> shari r1, 32, r5
> shlli r6, 1, r6
> muls.l r5, r7, r7
> ldx.w r3, r6, r6 ;; divsi_inv_hitable
> ...
>
> I haven't run a simulator test on it, though.
FYI, I've tested this patch on x86 cross sh64-unknown-linux-gnu.
There is no build problem and no regression.
Regards,
kaz