This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [ARM] ARM NEON support part 1/7: VFPv3 support


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.  */

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]