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]

altivec: load functions now handle arrays


a few people had complained about the need for unecessary casts.
now the load functions handle arrays and pointers transparently.

committed as obvious.  branch and trunk.

2002-04-17  Aldy Hernandez  <aldyh@redhat.com>

	* config/rs6000/altivec.h (vec_ld): Add array variants.
	(vec_lde): Same.
	(vec_ldl): Same.


Index: config/rs6000/altivec.h
===================================================================
RCS file: /cvs/uberbaum/gcc/config/rs6000/altivec.h,v
retrieving revision 1.14
diff -c -p -r1.14 altivec.h
*** config/rs6000/altivec.h	17 Apr 2002 02:03:43 -0000	1.14
--- config/rs6000/altivec.h	17 Apr 2002 02:30:08 -0000
*************** __ch (__un_args_eq (vector float, (a1)),
*** 4501,4579 ****
  #define vec_ld(a, b) \
  __ch (__un_args_eq (vector unsigned char *, (b)), \
        ((vector unsigned char) __builtin_altivec_lvx ((a), (b))), \
  __ch (__un_args_eq (unsigned char *, (b)), \
        ((vector unsigned char) __builtin_altivec_lvx ((a), (b))), \
  __ch (__un_args_eq (vector signed char *, (b)), \
        ((vector signed char) __builtin_altivec_lvx ((a), (b))), \
  __ch (__un_args_eq (signed char *, (b)), \
        ((vector signed char) __builtin_altivec_lvx ((a), (b))), \
  __ch (__un_args_eq (vector unsigned short *, (b)), \
        ((vector unsigned short) __builtin_altivec_lvx ((a), (b))), \
  __ch (__un_args_eq (unsigned short *, (b)), \
        ((vector unsigned short) __builtin_altivec_lvx ((a), (b))), \
  __ch (__un_args_eq (vector signed short *, (b)), \
        ((vector signed short) __builtin_altivec_lvx ((a), (b))), \
  __ch (__un_args_eq (signed short *, (b)), \
        ((vector signed short) __builtin_altivec_lvx ((a), (b))), \
  __ch (__un_args_eq (vector unsigned int *, (b)), \
        ((vector unsigned int) __builtin_altivec_lvx ((a), (b))), \
  __ch (__un_args_eq (unsigned int *, (b)), \
        ((vector unsigned int) __builtin_altivec_lvx ((a), (b))), \
  __ch (__un_args_eq (vector signed int *, (b)), \
        ((vector signed int) __builtin_altivec_lvx ((a), (b))), \
  __ch (__un_args_eq (signed int *, (b)), \
        ((vector signed int) __builtin_altivec_lvx ((a), (b))), \
  __ch (__un_args_eq (vector float *, (b)), \
        ((vector float) __builtin_altivec_lvx ((a), (b))), \
  __ch (__un_args_eq (float *, (b)), \
        ((vector float) __builtin_altivec_lvx ((a), (b))), \
! __altivec_link_error_invalid_argument ()))))))))))))))
  
  #define vec_lde(a, b) \
  __ch (__un_args_eq (unsigned char *, (b)), \
        ((vector unsigned char) __builtin_altivec_lvebx ((a), (b))), \
  __ch (__un_args_eq (signed char *, (b)), \
        ((vector signed char) __builtin_altivec_lvebx ((a), (b))), \
  __ch (__un_args_eq (unsigned short *, (b)), \
        ((vector unsigned short) __builtin_altivec_lvehx ((a), (b))), \
  __ch (__un_args_eq (signed short *, (b)), \
        ((vector signed short) __builtin_altivec_lvehx ((a), (b))), \
  __ch (__un_args_eq (unsigned int *, (b)), \
        ((vector unsigned int) __builtin_altivec_lvewx ((a), (b))), \
  __ch (__un_args_eq (signed int *, (b)), \
        ((vector signed int) __builtin_altivec_lvewx ((a), (b))), \
! __altivec_link_error_invalid_argument ()))))))
  
  #define vec_ldl(a, b) \
  __ch (__un_args_eq (vector unsigned char *, (b)), \
        ((vector unsigned char) __builtin_altivec_lvxl ((a), (b))), \
  __ch (__un_args_eq (unsigned char *, (b)), \
        ((vector unsigned char) __builtin_altivec_lvxl ((a), (b))), \
  __ch (__un_args_eq (vector signed char *, (b)), \
        ((vector signed char) __builtin_altivec_lvxl ((a), (b))), \
  __ch (__un_args_eq (signed char *, (b)), \
        ((vector signed char) __builtin_altivec_lvxl ((a), (b))), \
  __ch (__un_args_eq (vector unsigned short *, (b)), \
        ((vector unsigned short) __builtin_altivec_lvxl ((a), (b))), \
  __ch (__un_args_eq (unsigned short *, (b)), \
        ((vector unsigned short) __builtin_altivec_lvxl ((a), (b))), \
  __ch (__un_args_eq (vector signed short *, (b)), \
        ((vector signed short) __builtin_altivec_lvxl ((a), (b))), \
  __ch (__un_args_eq (signed short *, (b)), \
        ((vector signed short) __builtin_altivec_lvxl ((a), (b))), \
  __ch (__un_args_eq (vector unsigned int *, (b)), \
        ((vector unsigned int) __builtin_altivec_lvxl ((a), (b))), \
  __ch (__un_args_eq (unsigned int *, (b)), \
        ((vector unsigned int) __builtin_altivec_lvxl ((a), (b))), \
  __ch (__un_args_eq (vector signed int *, (b)), \
        ((vector signed int) __builtin_altivec_lvxl ((a), (b))), \
  __ch (__un_args_eq (signed int *, (b)), \
        ((vector signed int) __builtin_altivec_lvxl ((a), (b))), \
  __ch (__un_args_eq (vector float *, (b)), \
        ((vector float) __builtin_altivec_lvxl ((a), (b))), \
  __ch (__un_args_eq (float *, (b)), \
        ((vector float) __builtin_altivec_lvxl ((a), (b))), \
! __altivec_link_error_invalid_argument ()))))))))))))))
  
  #define vec_loge(a1) __builtin_altivec_vlogefp ((a1))
  
--- 4501,4647 ----
  #define vec_ld(a, b) \
  __ch (__un_args_eq (vector unsigned char *, (b)), \
        ((vector unsigned char) __builtin_altivec_lvx ((a), (b))), \
+ __ch (__un_args_eq (vector unsigned char [], (b)), \
+       ((vector unsigned char) __builtin_altivec_lvx ((a), (b))), \
  __ch (__un_args_eq (unsigned char *, (b)), \
        ((vector unsigned char) __builtin_altivec_lvx ((a), (b))), \
+ __ch (__un_args_eq (unsigned char [], (b)), \
+       ((vector unsigned char) __builtin_altivec_lvx ((a), (b))), \
  __ch (__un_args_eq (vector signed char *, (b)), \
        ((vector signed char) __builtin_altivec_lvx ((a), (b))), \
+ __ch (__un_args_eq (vector signed char [], (b)), \
+       ((vector signed char) __builtin_altivec_lvx ((a), (b))), \
  __ch (__un_args_eq (signed char *, (b)), \
        ((vector signed char) __builtin_altivec_lvx ((a), (b))), \
+ __ch (__un_args_eq (signed char [], (b)), \
+       ((vector signed char) __builtin_altivec_lvx ((a), (b))), \
  __ch (__un_args_eq (vector unsigned short *, (b)), \
        ((vector unsigned short) __builtin_altivec_lvx ((a), (b))), \
+ __ch (__un_args_eq (vector unsigned short [], (b)), \
+       ((vector unsigned short) __builtin_altivec_lvx ((a), (b))), \
  __ch (__un_args_eq (unsigned short *, (b)), \
        ((vector unsigned short) __builtin_altivec_lvx ((a), (b))), \
+ __ch (__un_args_eq (unsigned short [], (b)), \
+       ((vector unsigned short) __builtin_altivec_lvx ((a), (b))), \
  __ch (__un_args_eq (vector signed short *, (b)), \
        ((vector signed short) __builtin_altivec_lvx ((a), (b))), \
+ __ch (__un_args_eq (vector signed short [], (b)), \
+       ((vector signed short) __builtin_altivec_lvx ((a), (b))), \
  __ch (__un_args_eq (signed short *, (b)), \
        ((vector signed short) __builtin_altivec_lvx ((a), (b))), \
+ __ch (__un_args_eq (signed short [], (b)), \
+       ((vector signed short) __builtin_altivec_lvx ((a), (b))), \
  __ch (__un_args_eq (vector unsigned int *, (b)), \
        ((vector unsigned int) __builtin_altivec_lvx ((a), (b))), \
+ __ch (__un_args_eq (vector unsigned int [], (b)), \
+       ((vector unsigned int) __builtin_altivec_lvx ((a), (b))), \
  __ch (__un_args_eq (unsigned int *, (b)), \
        ((vector unsigned int) __builtin_altivec_lvx ((a), (b))), \
+ __ch (__un_args_eq (unsigned int [], (b)), \
+       ((vector unsigned int) __builtin_altivec_lvx ((a), (b))), \
  __ch (__un_args_eq (vector signed int *, (b)), \
        ((vector signed int) __builtin_altivec_lvx ((a), (b))), \
+ __ch (__un_args_eq (vector signed int [], (b)), \
+       ((vector signed int) __builtin_altivec_lvx ((a), (b))), \
  __ch (__un_args_eq (signed int *, (b)), \
        ((vector signed int) __builtin_altivec_lvx ((a), (b))), \
+ __ch (__un_args_eq (signed int [], (b)), \
+       ((vector signed int) __builtin_altivec_lvx ((a), (b))), \
  __ch (__un_args_eq (vector float *, (b)), \
        ((vector float) __builtin_altivec_lvx ((a), (b))), \
+ __ch (__un_args_eq (vector float [], (b)), \
+       ((vector float) __builtin_altivec_lvx ((a), (b))), \
  __ch (__un_args_eq (float *, (b)), \
        ((vector float) __builtin_altivec_lvx ((a), (b))), \
! __ch (__un_args_eq (float [], (b)), \
!       ((vector float) __builtin_altivec_lvx ((a), (b))), \
! __altivec_link_error_invalid_argument ()))))))))))))))))))))))))))))
  
  #define vec_lde(a, b) \
  __ch (__un_args_eq (unsigned char *, (b)), \
        ((vector unsigned char) __builtin_altivec_lvebx ((a), (b))), \
+ __ch (__un_args_eq (unsigned char [], (b)), \
+       ((vector unsigned char) __builtin_altivec_lvebx ((a), (b))), \
  __ch (__un_args_eq (signed char *, (b)), \
        ((vector signed char) __builtin_altivec_lvebx ((a), (b))), \
+ __ch (__un_args_eq (signed char [], (b)), \
+       ((vector signed char) __builtin_altivec_lvebx ((a), (b))), \
  __ch (__un_args_eq (unsigned short *, (b)), \
        ((vector unsigned short) __builtin_altivec_lvehx ((a), (b))), \
+ __ch (__un_args_eq (unsigned short [], (b)), \
+       ((vector unsigned short) __builtin_altivec_lvehx ((a), (b))), \
  __ch (__un_args_eq (signed short *, (b)), \
        ((vector signed short) __builtin_altivec_lvehx ((a), (b))), \
+ __ch (__un_args_eq (signed short [], (b)), \
+       ((vector signed short) __builtin_altivec_lvehx ((a), (b))), \
  __ch (__un_args_eq (unsigned int *, (b)), \
        ((vector unsigned int) __builtin_altivec_lvewx ((a), (b))), \
+ __ch (__un_args_eq (unsigned int [], (b)), \
+       ((vector unsigned int) __builtin_altivec_lvewx ((a), (b))), \
  __ch (__un_args_eq (signed int *, (b)), \
        ((vector signed int) __builtin_altivec_lvewx ((a), (b))), \
! __ch (__un_args_eq (signed int [], (b)), \
!       ((vector signed int) __builtin_altivec_lvewx ((a), (b))), \
! __altivec_link_error_invalid_argument ()))))))))))))
  
  #define vec_ldl(a, b) \
  __ch (__un_args_eq (vector unsigned char *, (b)), \
        ((vector unsigned char) __builtin_altivec_lvxl ((a), (b))), \
+ __ch (__un_args_eq (vector unsigned char [], (b)), \
+       ((vector unsigned char) __builtin_altivec_lvxl ((a), (b))), \
  __ch (__un_args_eq (unsigned char *, (b)), \
        ((vector unsigned char) __builtin_altivec_lvxl ((a), (b))), \
+ __ch (__un_args_eq (unsigned char [], (b)), \
+       ((vector unsigned char) __builtin_altivec_lvxl ((a), (b))), \
  __ch (__un_args_eq (vector signed char *, (b)), \
        ((vector signed char) __builtin_altivec_lvxl ((a), (b))), \
+ __ch (__un_args_eq (vector signed char [], (b)), \
+       ((vector signed char) __builtin_altivec_lvxl ((a), (b))), \
  __ch (__un_args_eq (signed char *, (b)), \
        ((vector signed char) __builtin_altivec_lvxl ((a), (b))), \
+ __ch (__un_args_eq (signed char [], (b)), \
+       ((vector signed char) __builtin_altivec_lvxl ((a), (b))), \
  __ch (__un_args_eq (vector unsigned short *, (b)), \
        ((vector unsigned short) __builtin_altivec_lvxl ((a), (b))), \
+ __ch (__un_args_eq (vector unsigned short [], (b)), \
+       ((vector unsigned short) __builtin_altivec_lvxl ((a), (b))), \
  __ch (__un_args_eq (unsigned short *, (b)), \
        ((vector unsigned short) __builtin_altivec_lvxl ((a), (b))), \
+ __ch (__un_args_eq (unsigned short [], (b)), \
+       ((vector unsigned short) __builtin_altivec_lvxl ((a), (b))), \
  __ch (__un_args_eq (vector signed short *, (b)), \
        ((vector signed short) __builtin_altivec_lvxl ((a), (b))), \
+ __ch (__un_args_eq (vector signed short [], (b)), \
+       ((vector signed short) __builtin_altivec_lvxl ((a), (b))), \
  __ch (__un_args_eq (signed short *, (b)), \
        ((vector signed short) __builtin_altivec_lvxl ((a), (b))), \
+ __ch (__un_args_eq (signed short [], (b)), \
+       ((vector signed short) __builtin_altivec_lvxl ((a), (b))), \
  __ch (__un_args_eq (vector unsigned int *, (b)), \
        ((vector unsigned int) __builtin_altivec_lvxl ((a), (b))), \
+ __ch (__un_args_eq (vector unsigned int [], (b)), \
+       ((vector unsigned int) __builtin_altivec_lvxl ((a), (b))), \
  __ch (__un_args_eq (unsigned int *, (b)), \
        ((vector unsigned int) __builtin_altivec_lvxl ((a), (b))), \
+ __ch (__un_args_eq (unsigned int [], (b)), \
+       ((vector unsigned int) __builtin_altivec_lvxl ((a), (b))), \
  __ch (__un_args_eq (vector signed int *, (b)), \
        ((vector signed int) __builtin_altivec_lvxl ((a), (b))), \
+ __ch (__un_args_eq (vector signed int [], (b)), \
+       ((vector signed int) __builtin_altivec_lvxl ((a), (b))), \
  __ch (__un_args_eq (signed int *, (b)), \
        ((vector signed int) __builtin_altivec_lvxl ((a), (b))), \
+ __ch (__un_args_eq (signed int [], (b)), \
+       ((vector signed int) __builtin_altivec_lvxl ((a), (b))), \
  __ch (__un_args_eq (vector float *, (b)), \
        ((vector float) __builtin_altivec_lvxl ((a), (b))), \
+ __ch (__un_args_eq (vector float [], (b)), \
+       ((vector float) __builtin_altivec_lvxl ((a), (b))), \
  __ch (__un_args_eq (float *, (b)), \
        ((vector float) __builtin_altivec_lvxl ((a), (b))), \
! __ch (__un_args_eq (float [], (b)), \
!       ((vector float) __builtin_altivec_lvxl ((a), (b))), \
! __altivec_link_error_invalid_argument ()))))))))))))))))))))))))))))
  
  #define vec_loge(a1) __builtin_altivec_vlogefp ((a1))
  


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