This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Redundant sign-extension instructions on RISC-V
- From: Richard Henderson <rth at twiddle dot net>
- To: Michael Clark <michaeljclark at mac dot com>, Richard Biener <richard dot guenther at gmail dot com>
- Cc: GCC Development <gcc at gcc dot gnu dot org>, Andrew Waterman <andrew at sifive dot com>, Palmer Dabbelt <palmer at sifive dot com>
- Date: Wed, 6 Sep 2017 09:56:26 -0700
- Subject: Re: Redundant sign-extension instructions on RISC-V
- Authentication-results: sourceware.org; auth=none
- References: <25835613-5493-42EB-B4C8-E44BAC9F401E@mac.com> <CAFiYyc0_jc3N=+_VRi2c4bGBr7EDfnRAidYLfwD0oX3hx-2KbQ@mail.gmail.com> <E11F5B57-0756-48BB-B0A3-EC409EC7C2D2@mac.com>
On 08/30/2017 02:43 AM, Michael Clark wrote:
> POINTERS_EXTEND_UNSIGNED -1 (which is true) is defined on some targets. I assume they sign-extend but the meaning has been overloaded.
Just for your edification, this is for e.g. ia64's "addp4" instruction and it
is not a normal extension. A 2-bit segment tag of a 32-bit pointer is remapped
to a 3-bit segment tag of a 64-bit pointer and also zeros bits {60:32}.
If you care,
http://refspecs.linuxbase.org/IA64-softdevman-vol3
has a nice picture that better describes this.
r~