RFA: rs6000: Fix type conversion in __ev_set_acc_{s|u}64

Nick Clifton nickc@redhat.com
Tue Oct 8 08:02:00 GMT 2002


Hi Aldy,

  Please can I apply the patch below.  It fixes the __ev_set_acc_s64
  and __ev_set_acc_u64 macros in the spe.h header to perform explicit
  type conversion, rather than replying upon C's automatic
  conversions, which do not work when vectors are involved.

Cheers
        Nick

2002-10-08  Nick Clifton  <nickc@redhat.com>

	* config/rs6000/spe.h (__ev_set_acc_u64): Use __ev_create_u64 to
	convert uint64_t into __ev64_opaque__.
	(__ev_set_acc_s64): Likewise, but using signed types.

Index: gcc/config/rs6000/spe.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/rs6000/spe.h,v
retrieving revision 1.2
diff -c -3 -p -w -r1.2 spe.h
*** gcc/config/rs6000/spe.h	29 Jul 2002 19:07:10 -0000	1.2
--- gcc/config/rs6000/spe.h	8 Oct 2002 14:59:09 -0000
*************** __ev_get_s16_internal (__ev64_opaque__ a
*** 779,793 ****
  static inline __ev64_opaque__
  __ev_set_acc_u64 (uint64_t a)
  {
!   __ev_mra (a);
!   return (__ev64_opaque__) a;
  }
  
  static inline __ev64_opaque__
  __ev_set_acc_s64 (int64_t a)
  {
!   __ev_mra (a);
!   return (__ev64_opaque__) a;
  }
  
  static inline __ev64_opaque__
--- 779,797 ----
  static inline __ev64_opaque__
  __ev_set_acc_u64 (uint64_t a)
  {
!   __ev64_opaque__ ev32;
!   ev32 = __ev_create_u64 (a);
!   __ev_mra (ev32);
!   return ev32;
  }
  
  static inline __ev64_opaque__
  __ev_set_acc_s64 (int64_t a)
  {
!   __ev64_opaque__ ev32;
!   ev32 = __ev_create_s64 (a);
!   __ev_mra (ev32);
!   return ev32;
  }
  
  static inline __ev64_opaque__



More information about the Gcc-patches mailing list