This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [ARM] ARM NEON support part 1/7: VFPv3 support
- From: Richard Earnshaw <Richard dot Earnshaw at buzzard dot freeserve dot co dot uk>
- To: Julian Brown <julian at codesourcery dot com>
- Cc: Richard Earnshaw <rearnsha at arm dot com>, GCC Patches <gcc-patches at gcc dot gnu dot org>, Paul Brook <paul at codesourcery dot com>
- Date: Thu, 05 Jul 2007 20:20:56 +0100
- Subject: Re: [ARM] ARM NEON support part 1/7: VFPv3 support
- References: <4661DE3A.20307@codesourcery.com> <1181236362.21501.12.camel@pc960.cambridge.arm.com> <468AA805.2040301@codesourcery.com> <468C188F.4010006@codesourcery.com>
On Wed, 2007-07-04 at 23:00 +0100, Julian Brown wrote:
> Julian Brown wrote:
> > I've committed this version (r126272), which hopefully addresses all the
> > points mentioned (also a couple of Neon-specific bits which crept in
> > have been removed).
>
> Richard E told me on IRC that this patch fails native bootstrap on ARM.
> Richard, could you see if the attached (untested) patch fixes it for you
> please?
>
> OK to commit if successful?
>
> Cheers,
>
> Julian
>
> ChangeLog
>
> gcc/
> * config/arm/arm.c (vfp3_const_double_index): Cast pointers passed
> to REAL_VALUE_TO_INT to HOST_WIDE_INT*.
I can't say I like the casts on the pointers (ok, we're only changing
the signedness, but it's still dodgy in my book. I think I'd prefer
something like the attached. Agreed?
gcc/
* config/arm/arm.c (vfp3_const_double_index): Copy signed
results of REAL_VALUE_TO_INT into unsigned vars.
*** arm.c (revision 126323)
--- arm.c (local)
*************** vfp3_const_double_index (rtx x)
*** 5679,5684 ****
--- 5679,5685 ----
int sign, exponent;
unsigned HOST_WIDE_INT mantissa, mant_hi;
unsigned HOST_WIDE_INT mask;
+ HOST_WIDE_INT m1, m2;
int point_pos = 2 * HOST_BITS_PER_WIDE_INT - 1;
if (!TARGET_VFP3 || GET_CODE (x) != CONST_DOUBLE)
*************** vfp3_const_double_index (rtx x)
*** 5699,5705 ****
WARNING: If there's ever a VFP version which uses more than 2 * H_W_I - 1
bits for the mantissa, this may fail (low bits would be lost). */
real_ldexp (&m, &r, point_pos - exponent);
! REAL_VALUE_TO_INT (&mantissa, &mant_hi, m);
/* If there are bits set in the low part of the mantissa, we can't
represent this value. */
--- 5700,5708 ----
WARNING: If there's ever a VFP version which uses more than 2 * H_W_I - 1
bits for the mantissa, this may fail (low bits would be lost). */
real_ldexp (&m, &r, point_pos - exponent);
! REAL_VALUE_TO_INT (&m1, &m2, m);
! mantissa = m1;
! mant_hi = m2;
/* If there are bits set in the low part of the mantissa, we can't
represent this value. */