lightning
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: GNU Lightning 2.2.1 release


From: Paulo César Pereira de Andrade
Subject: Re: GNU Lightning 2.2.1 release
Date: Mon, 20 Feb 2023 08:28:31 -0300

Em seg., 20 de fev. de 2023 às 07:26, Paul Cercueil
<paul@crapouillou.net> escreveu:

  Hi Paul,

[snip]

> > It appears CLO, and CLZ are special cases about the top 32 bits.
>
> No, please trust me on this. If you only ever emit MIPS32 opcodes
> (which is the case when __WORDSIZE == 32), the upper 32 bits will
> always correspond to the sign bit.

  Yes. I already removed it in my WIP mips release 6 update. I was just
uncertain about any possible code path that could have the wrong
sign extension.

> This is ensured by the MIPS64 spec, and would otherwise make MIPS32
> backwards-compatibility impossible.
>
> Your code path in _movi() that uses can_zero_extend_int_p (which is
> never called on MIPS32 but let's say it was), would generate:
>
> ORI(r0, _ZERO_REGNO, i0 >> 16);
> SLL(r0, r0, 16);
>
> On a MIPS64 processor running a 32-bit OS, if i0 == 0x8000.0000, you
> would end up with r0 == 0xffff.ffff.8000.0000, because SLL is a MIPS32
> instruction.
>
> The CLO and CLZ instructions are no different; their source register
> has to be sign-extended, but that is only something that you need to
> care about when mixing these instructions with MIPS64 code.
>
> Cheers,
> -Paul

[snip]

Thanks,
Paulo



reply via email to

[Prev in Thread] Current Thread [Next in Thread]