From: Aldy Hernandez Date: Tue, 5 Feb 2002 02:18:55 +0000 (+0000) Subject: rs6000.c (altivec_init_builtins): Fix typo building void typed builtins. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=3deb275873f7810c2e98fbea6b4f05ddddf846ef;p=gcc.git rs6000.c (altivec_init_builtins): Fix typo building void typed builtins. 2002-02-05 Aldy Hernandez * config/rs6000/rs6000.c (altivec_init_builtins): Fix typo building void typed builtins. * config/rs6000/altivec.h (vec_ld*): Fix typos. (vec_step): Implement for C++. From-SVN: r49510 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 35e658c6cf2..509b220d22a 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,11 @@ +2002-02-05 Aldy Hernandez + + * config/rs6000/rs6000.c (altivec_init_builtins): Fix typo + building void typed builtins. + + * config/rs6000/altivec.h (vec_ld*): Fix typos. + (vec_step): Implement for C++. + Mon Feb 4 19:23:19 2002 Richard Kenner * final.c (final_scan_insn): Add case for NOTE_INSN_LOOP_END_TOP_COND. diff --git a/gcc/config/rs6000/altivec.h b/gcc/config/rs6000/altivec.h index 4e8cdf27b09..a1c4cb57e01 100644 --- a/gcc/config/rs6000/altivec.h +++ b/gcc/config/rs6000/altivec.h @@ -720,82 +720,124 @@ vec_ld (int a1, vector float *a2) return (vector float) __builtin_altivec_lvx (a1, (void *) a2); } +inline vector float +vec_ld (int a1, float *a2) +{ + return (vector float) __builtin_altivec_lvx (a1, (void *) a2); +} + inline vector signed int vec_ld (int a1, vector signed int *a2) { return (vector signed int) __builtin_altivec_lvx (a1, (void *) a2); } +inline vector signed int +vec_ld (int a1, signed int *a2) +{ + return (vector signed int) __builtin_altivec_lvx (a1, (void *) a2); +} + inline vector unsigned int vec_ld (int a1, vector unsigned int *a2) { return (vector unsigned int) __builtin_altivec_lvx (a1, (void *) a2); } +inline vector unsigned int +vec_ld (int a1, unsigned int *a2) +{ + return (vector unsigned int) __builtin_altivec_lvx (a1, (void *) a2); +} + inline vector signed short vec_ld (int a1, vector signed short *a2) { return (vector signed short) __builtin_altivec_lvx (a1, (void *) a2); } +inline vector signed short +vec_ld (int a1, signed short *a2) +{ + return (vector signed short) __builtin_altivec_lvx (a1, (void *) a2); +} + inline vector unsigned short vec_ld (int a1, vector unsigned short *a2) { return (vector unsigned short) __builtin_altivec_lvx (a1, (void *) a2); } +inline vector unsigned short +vec_ld (int a1, unsigned short *a2) +{ + return (vector unsigned short) __builtin_altivec_lvx (a1, (void *) a2); +} + inline vector signed char vec_ld (int a1, vector signed char *a2) { return (vector signed char) __builtin_altivec_lvx (a1, (void *) a2); } +inline vector signed char +vec_ld (int a1, signed char *a2) +{ + return (vector signed char) __builtin_altivec_lvx (a1, (void *) a2); +} + inline vector unsigned char vec_ld (int a1, vector unsigned char *a2) { return (vector unsigned char) __builtin_altivec_lvx (a1, (void *) a2); } +inline vector unsigned char +vec_ld (int a1, unsigned char *a2) +{ + return (vector unsigned char) __builtin_altivec_lvx (a1, (void *) a2); +} + /* vec_lde */ inline vector signed char -vec_lde (int a1, vector signed char *a2) +vec_lde (int a1, signed char *a2) { return (vector signed char) __builtin_altivec_lvebx (a1, (void *) a2); } inline vector unsigned char -vec_lde (int a1, vector unsigned char *a2) +vec_lde (int a1, unsigned char *a2) { return (vector unsigned char) __builtin_altivec_lvebx (a1, (void *) a2); } inline vector signed short -vec_lde (int a1, vector signed short *a2) +vec_lde (int a1, signed short *a2) { return (vector signed short) __builtin_altivec_lvehx (a1, (void *) a2); } inline vector unsigned short -vec_lde (int a1, vector unsigned short *a2) +vec_lde (int a1, unsigned short *a2) { return (vector unsigned short) __builtin_altivec_lvehx (a1, (void *) a2); } inline vector float -vec_lde (int a1, vector float *a2) +vec_lde (int a1, float *a2) { return (vector float) __builtin_altivec_lvewx (a1, (void *) a2); } inline vector signed int -vec_lde (int a1, vector signed int *a2) +vec_lde (int a1, signed int *a2) { return (vector signed int) __builtin_altivec_lvewx (a1, (void *) a2); } inline vector unsigned int -vec_lde (int a1, vector unsigned int *a2) +vec_lde (int a1, unsigned int *a2) { return (vector unsigned int) __builtin_altivec_lvewx (a1, (void *) a2); } @@ -808,42 +850,84 @@ vec_ldl (int a1, vector float *a2) return (vector float) __builtin_altivec_lvxl (a1, (void *) a2); } +inline vector float +vec_ldl (int a1, float *a2) +{ + return (vector float) __builtin_altivec_lvxl (a1, (void *) a2); +} + inline vector signed int vec_ldl (int a1, vector signed int *a2) { return (vector signed int) __builtin_altivec_lvxl (a1, (void *) a2); } +inline vector signed int +vec_ldl (int a1, signed int *a2) +{ + return (vector signed int) __builtin_altivec_lvxl (a1, (void *) a2); +} + inline vector unsigned int vec_ldl (int a1, vector unsigned int *a2) { return (vector unsigned int) __builtin_altivec_lvxl (a1, (void *) a2); } +inline vector unsigned int +vec_ldl (int a1, unsigned int *a2) +{ + return (vector unsigned int) __builtin_altivec_lvxl (a1, (void *) a2); +} + inline vector signed short vec_ldl (int a1, vector signed short *a2) { return (vector signed short) __builtin_altivec_lvxl (a1, (void *) a2); } +inline vector signed short +vec_ldl (int a1, signed short *a2) +{ + return (vector signed short) __builtin_altivec_lvxl (a1, (void *) a2); +} + inline vector unsigned short vec_ldl (int a1, vector unsigned short *a2) { return (vector unsigned short) __builtin_altivec_lvxl (a1, (void *) a2); } +inline vector unsigned short +vec_ldl (int a1, unsigned short *a2) +{ + return (vector unsigned short) __builtin_altivec_lvxl (a1, (void *) a2); +} + inline vector signed char vec_ldl (int a1, vector signed char *a2) { return (vector signed char) __builtin_altivec_lvxl (a1, (void *) a2); } +inline vector signed char +vec_ldl (int a1, signed char *a2) +{ + return (vector signed char) __builtin_altivec_lvxl (a1, (void *) a2); +} + inline vector unsigned char vec_ldl (int a1, vector unsigned char *a2) { return (vector unsigned char) __builtin_altivec_lvxl (a1, (void *) a2); } +inline vector unsigned char +vec_ldl (int a1, unsigned char *a2) +{ + return (vector unsigned char) __builtin_altivec_lvxl (a1, (void *) a2); +} + /* vec_loge */ inline vector float @@ -3897,6 +3981,59 @@ vec_any_out (vector float a1, vector float a2) { return __builtin_altivec_vcmpbfp_p (__CR6_EQ_REV, a1, a2); } + +/* vec_step */ + +template +struct vec_step_help +{ + // All proper vector types will specialize elem. +}; + +template<> +struct vec_step_help +{ + static const int elem = 8; +}; + +template<> +struct vec_step_help +{ + static const int elem = 8; +}; + +template<> +struct vec_step_help +{ + static const int elem = 4; +}; + +template<> +struct vec_step_help +{ + static const int elem = 4; +}; + +template<> +struct vec_step_help +{ + static const int elem = 16; +}; + +template<> +struct vec_step_help +{ + static const int elem = 16; +}; + +template<> +struct vec_step_help +{ + static const int elem = 4; +}; + +#define vec_step(t) vec_step_help::elem + #else /* not C++ */ /* "... and so I think no man in a century will suffer as greatly as diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c index 7a33dc21820..01439814e65 100644 --- a/gcc/config/rs6000/rs6000.c +++ b/gcc/config/rs6000/rs6000.c @@ -1802,6 +1802,7 @@ rs6000_legitimize_reload_address (x, mode, opnum, type, ind_levels, win) *win = 1; return x; } + #if TARGET_MACHO if (DEFAULT_ABI == ABI_DARWIN && flag_pic && GET_CODE (x) == LO_SUM @@ -4161,15 +4162,11 @@ altivec_init_builtins (void) /* void foo (void). */ tree void_ftype_void - = build_function_type (void_type_node, - tree_cons (NULL_TREE, void_type_node, - endlink)); + = build_function_type (void_type_node, void_list_node); /* vshort foo (void). */ tree v8hi_ftype_void - = build_function_type (V8HI_type_node, - tree_cons (NULL_TREE, void_type_node, - endlink)); + = build_function_type (V8HI_type_node, void_list_node); tree v4si_ftype_v4si_v4si = build_function_type (V4SI_type_node,