diff options
author | kan <kan@FreeBSD.org> | 2002-09-01 20:38:57 +0000 |
---|---|---|
committer | kan <kan@FreeBSD.org> | 2002-09-01 20:38:57 +0000 |
commit | 2e25f3a6c57335cba50111faceb0ce2ab59e9bcb (patch) | |
tree | c6857d31c36dbd89a881b0229bf38b062797d413 /contrib/gcc/config/rs6000 | |
parent | 0895e1acb698e05d503c26bec5471de2e88b7d93 (diff) | |
download | FreeBSD-src-2e25f3a6c57335cba50111faceb0ce2ab59e9bcb.zip FreeBSD-src-2e25f3a6c57335cba50111faceb0ce2ab59e9bcb.tar.gz |
Gcc 3.2.1-prerelease from the FSF anoncvs repo gcc-3_2-branch on 1-Sep-2002 00:00:01 EDT.
Diffstat (limited to 'contrib/gcc/config/rs6000')
-rw-r--r-- | contrib/gcc/config/rs6000/aix43.h | 15 | ||||
-rw-r--r-- | contrib/gcc/config/rs6000/aix51.h | 15 | ||||
-rw-r--r-- | contrib/gcc/config/rs6000/altivec.h | 1058 | ||||
-rw-r--r-- | contrib/gcc/config/rs6000/linux64.h | 19 | ||||
-rw-r--r-- | contrib/gcc/config/rs6000/netbsd.h | 5 | ||||
-rw-r--r-- | contrib/gcc/config/rs6000/rs6000.c | 73 | ||||
-rw-r--r-- | contrib/gcc/config/rs6000/rs6000.h | 22 | ||||
-rw-r--r-- | contrib/gcc/config/rs6000/rs6000.md | 161 | ||||
-rw-r--r-- | contrib/gcc/config/rs6000/sysv4.h | 1 | ||||
-rw-r--r-- | contrib/gcc/config/rs6000/xcoff.h | 9 |
10 files changed, 1048 insertions, 330 deletions
diff --git a/contrib/gcc/config/rs6000/aix43.h b/contrib/gcc/config/rs6000/aix43.h index 7aa8707..8fe9859 100644 --- a/contrib/gcc/config/rs6000/aix43.h +++ b/contrib/gcc/config/rs6000/aix43.h @@ -186,18 +186,15 @@ do { \ #undef LINK_SPEC #define LINK_SPEC "-bpT:0x10000000 -bpD:0x20000000 %{!r:-btextro} -bnodelcsect\ %{static:-bnso %(link_syscalls) } %{shared:-bM:SRE %{!e:-bnoentry}}\ - %{!maix64:%{!shared:%{g*: %(link_libg) }}} %{maix64:-b64}" + %{!maix64:%{!shared:%{g*: %(link_libg) }}} %{maix64:-b64}\ + %{mpe:-binitfini:poe_remote_main}" #undef STARTFILE_SPEC #define STARTFILE_SPEC "%{!shared:\ - %{mpe:%{pg:/usr/lpp/ppe.poe/lib/gcrt0.o}\ - %{!pg:%{p:/usr/lpp/ppe.poe/lib/mcrt0.o}\ - %{!p:/usr/lpp/ppe.poe/lib/crt0.o}}}\ - %{!mpe:\ - %{maix64:%{pg:gcrt0_64%O%s}%{!pg:%{p:mcrt0_64%O%s}%{!p:crt0_64%O%s}}}\ - %{!maix64:\ - %{pthread:%{pg:gcrt0_r%O%s}%{!pg:%{p:mcrt0_r%O%s}%{!p:crt0_r%O%s}}}\ - %{!pthread:%{pg:gcrt0%O%s}%{!pg:%{p:mcrt0%O%s}%{!p:crt0%O%s}}}}}}" + %{maix64:%{pg:gcrt0_64%O%s}%{!pg:%{p:mcrt0_64%O%s}%{!p:crt0_64%O%s}}}\ + %{!maix64:\ + %{pthread:%{pg:gcrt0_r%O%s}%{!pg:%{p:mcrt0_r%O%s}%{!p:crt0_r%O%s}}}\ + %{!pthread:%{pg:gcrt0%O%s}%{!pg:%{p:mcrt0%O%s}%{!p:crt0%O%s}}}}}" /* AIX 4.3 typedefs ptrdiff_t as "long" while earlier releases used "int". */ diff --git a/contrib/gcc/config/rs6000/aix51.h b/contrib/gcc/config/rs6000/aix51.h index 121c7ba..4051dd0 100644 --- a/contrib/gcc/config/rs6000/aix51.h +++ b/contrib/gcc/config/rs6000/aix51.h @@ -189,18 +189,15 @@ do { \ #undef LINK_SPEC #define LINK_SPEC "-bpT:0x10000000 -bpD:0x20000000 %{!r:-btextro} -bnodelcsect\ %{static:-bnso %(link_syscalls) } %{shared:-bM:SRE %{!e:-bnoentry}}\ - %{!maix64:%{!shared:%{g*: %(link_libg) }}} %{maix64:-b64}" + %{!maix64:%{!shared:%{g*: %(link_libg) }}} %{maix64:-b64}\ + %{mpe:-binitfini:poe_remote_main}" #undef STARTFILE_SPEC #define STARTFILE_SPEC "%{!shared:\ - %{mpe:%{pg:/usr/lpp/ppe.poe/lib/gcrt0.o}\ - %{!pg:%{p:/usr/lpp/ppe.poe/lib/mcrt0.o}\ - %{!p:/usr/lpp/ppe.poe/lib/crt0.o}}}\ - %{!mpe:\ - %{maix64:%{pg:gcrt0_64%O%s}%{!pg:%{p:mcrt0_64%O%s}%{!p:crt0_64%O%s}}}\ - %{!maix64:\ - %{pthread:%{pg:gcrt0_r%O%s}%{!pg:%{p:mcrt0_r%O%s}%{!p:crt0_r%O%s}}}\ - %{!pthread:%{pg:gcrt0%O%s}%{!pg:%{p:mcrt0%O%s}%{!p:crt0%O%s}}}}}}" + %{maix64:%{pg:gcrt0_64%O%s}%{!pg:%{p:mcrt0_64%O%s}%{!p:crt0_64%O%s}}}\ + %{!maix64:\ + %{pthread:%{pg:gcrt0_r%O%s}%{!pg:%{p:mcrt0_r%O%s}%{!p:crt0_r%O%s}}}\ + %{!pthread:%{pg:gcrt0%O%s}%{!pg:%{p:mcrt0%O%s}%{!p:crt0%O%s}}}}}" /* AIX V5 typedefs ptrdiff_t as "long" while earlier releases used "int". */ diff --git a/contrib/gcc/config/rs6000/altivec.h b/contrib/gcc/config/rs6000/altivec.h index 85869dc..f1387c0 100644 --- a/contrib/gcc/config/rs6000/altivec.h +++ b/contrib/gcc/config/rs6000/altivec.h @@ -45,8 +45,8 @@ Boston, MA 02111-1307, USA. */ #define vector __vector #define bool signed -#define pixel short -#define __pixel short +#define pixel unsigned short +#define __pixel unsigned short /* Dummy prototype. */ extern int __altivec_link_error_invalid_argument (); @@ -122,13 +122,80 @@ extern int __altivec_link_error_invalid_argument (); inlined. */ inline vector float vec_ctf (vector unsigned int, const char) __attribute__ ((always_inline)); inline vector float vec_ctf (vector signed int, const char) __attribute__ ((always_inline)); +inline vector float vec_vcfsx (vector signed int a1, const char a2) __attribute__ ((always_inline)); +inline vector float vec_vcfux (vector unsigned int a1, const char a2) __attribute__ ((always_inline)); inline vector signed int vec_cts (vector float, const char) __attribute__ ((always_inline)); inline vector unsigned int vec_ctu (vector float, const char) __attribute__ ((always_inline)); inline void vec_dss (const char) __attribute__ ((always_inline)); -inline void vec_dst (void *, int, const char) __attribute__ ((always_inline)); -inline void vec_dstst (void *, int, const char) __attribute__ ((always_inline)); -inline void vec_dststt (void *, int, const char) __attribute__ ((always_inline)); -inline void vec_dstt (void *, int, const char) __attribute__ ((always_inline)); + +inline void vec_dst (vector unsigned char *, int, const char) __attribute__ ((always_inline)); +inline void vec_dst (vector signed char *, int, const char) __attribute__ ((always_inline)); +inline void vec_dst (vector unsigned short *, int, const char) __attribute__ ((always_inline)); +inline void vec_dst (vector signed short *, int, const char) __attribute__ ((always_inline)); +inline void vec_dst (vector unsigned int *, int, const char) __attribute__ ((always_inline)); +inline void vec_dst (vector signed int *, int, const char) __attribute__ ((always_inline)); +inline void vec_dst (vector float *, int, const char) __attribute__ ((always_inline)); +inline void vec_dst (unsigned char *, int, const char) __attribute__ ((always_inline)); +inline void vec_dst (signed char *, int, const char) __attribute__ ((always_inline)); +inline void vec_dst (unsigned short *, int, const char) __attribute__ ((always_inline)); +inline void vec_dst (signed short *, int, const char) __attribute__ ((always_inline)); +inline void vec_dst (unsigned int *, int, const char) __attribute__ ((always_inline)); +inline void vec_dst (signed int *, int, const char) __attribute__ ((always_inline)); +inline void vec_dst (unsigned long *, int, const char) __attribute__ ((always_inline)); +inline void vec_dst (signed long *, int, const char) __attribute__ ((always_inline)); +inline void vec_dst (float *, int, const char) __attribute__ ((always_inline)); + +inline void vec_dstst (vector unsigned char *, int, const char) __attribute__ ((always_inline)); +inline void vec_dstst (vector signed char *, int, const char) __attribute__ ((always_inline)); +inline void vec_dstst (vector unsigned short *, int, const char) __attribute__ ((always_inline)); +inline void vec_dstst (vector signed short *, int, const char) __attribute__ ((always_inline)); +inline void vec_dstst (vector unsigned int *, int, const char) __attribute__ ((always_inline)); +inline void vec_dstst (vector signed int *, int, const char) __attribute__ ((always_inline)); +inline void vec_dstst (vector float *, int, const char) __attribute__ ((always_inline)); +inline void vec_dstst (unsigned char *, int, const char) __attribute__ ((always_inline)); +inline void vec_dstst (signed char *, int, const char) __attribute__ ((always_inline)); +inline void vec_dstst (unsigned short *, int, const char) __attribute__ ((always_inline)); +inline void vec_dstst (signed short *, int, const char) __attribute__ ((always_inline)); +inline void vec_dstst (unsigned int *, int, const char) __attribute__ ((always_inline)); +inline void vec_dstst (signed int *, int, const char) __attribute__ ((always_inline)); +inline void vec_dstst (unsigned long *, int, const char) __attribute__ ((always_inline)); +inline void vec_dstst (signed long *, int, const char) __attribute__ ((always_inline)); +inline void vec_dstst (float *, int, const char) __attribute__ ((always_inline)); + +inline void vec_dststt (vector unsigned char *, int, const char) __attribute__ ((always_inline)); +inline void vec_dststt (vector signed char *, int, const char) __attribute__ ((always_inline)); +inline void vec_dststt (vector unsigned short *, int, const char) __attribute__ ((always_inline)); +inline void vec_dststt (vector signed short *, int, const char) __attribute__ ((always_inline)); +inline void vec_dststt (vector unsigned int *, int, const char) __attribute__ ((always_inline)); +inline void vec_dststt (vector signed int *, int, const char) __attribute__ ((always_inline)); +inline void vec_dststt (vector float *, int, const char) __attribute__ ((always_inline)); +inline void vec_dststt (unsigned char *, int, const char) __attribute__ ((always_inline)); +inline void vec_dststt (signed char *, int, const char) __attribute__ ((always_inline)); +inline void vec_dststt (unsigned short *, int, const char) __attribute__ ((always_inline)); +inline void vec_dststt (signed short *, int, const char) __attribute__ ((always_inline)); +inline void vec_dststt (unsigned int *, int, const char) __attribute__ ((always_inline)); +inline void vec_dststt (signed int *, int, const char) __attribute__ ((always_inline)); +inline void vec_dststt (unsigned long *, int, const char) __attribute__ ((always_inline)); +inline void vec_dststt (signed long *, int, const char) __attribute__ ((always_inline)); +inline void vec_dststt (float *, int, const char) __attribute__ ((always_inline)); + +inline void vec_dstt (vector unsigned char *, int, const char) __attribute__ ((always_inline)); +inline void vec_dstt (vector signed char *, int, const char) __attribute__ ((always_inline)); +inline void vec_dstt (vector unsigned short *, int, const char) __attribute__ ((always_inline)); +inline void vec_dstt (vector signed short *, int, const char) __attribute__ ((always_inline)); +inline void vec_dstt (vector unsigned int *, int, const char) __attribute__ ((always_inline)); +inline void vec_dstt (vector signed int *, int, const char) __attribute__ ((always_inline)); +inline void vec_dstt (vector float *, int, const char) __attribute__ ((always_inline)); +inline void vec_dstt (unsigned char *, int, const char) __attribute__ ((always_inline)); +inline void vec_dstt (signed char *, int, const char) __attribute__ ((always_inline)); +inline void vec_dstt (unsigned short *, int, const char) __attribute__ ((always_inline)); +inline void vec_dstt (signed short *, int, const char) __attribute__ ((always_inline)); +inline void vec_dstt (unsigned int *, int, const char) __attribute__ ((always_inline)); +inline void vec_dstt (signed int *, int, const char) __attribute__ ((always_inline)); +inline void vec_dstt (unsigned long *, int, const char) __attribute__ ((always_inline)); +inline void vec_dstt (signed long *, int, const char) __attribute__ ((always_inline)); +inline void vec_dstt (float *, int, const char) __attribute__ ((always_inline)); + inline vector float vec_sld (vector float, vector float, const char) __attribute__ ((always_inline)); inline vector signed int vec_sld (vector signed int, vector signed int, const char) __attribute__ ((always_inline)); inline vector unsigned int vec_sld (vector unsigned int, vector unsigned int, const char) __attribute__ ((always_inline)); @@ -149,6 +216,13 @@ inline vector signed int vec_splat_s32 (const char) __attribute__ ((always_inlin inline vector unsigned char vec_splat_u8 (const char) __attribute__ ((always_inline)); inline vector unsigned short vec_splat_u16 (const char) __attribute__ ((always_inline)); inline vector unsigned int vec_splat_u32 (const char) __attribute__ ((always_inline)); +inline vector float vec_vspltw (vector float a1, const char a2) __attribute__ ((always_inline)); +inline vector signed int vec_vspltw (vector signed int a1, const char a2) __attribute__ ((always_inline)); +inline vector unsigned int vec_vspltw (vector unsigned int a1, const char a2) __attribute__ ((always_inline)); +inline vector signed short vec_vsplth (vector signed short a1, const char a2) __attribute__ ((always_inline)); +inline vector unsigned short vec_vsplth (vector unsigned short a1, const char a2) __attribute__ ((always_inline)); +inline vector signed char vec_vspltb (vector signed char a1, const char a2) __attribute__ ((always_inline)); +inline vector unsigned char vec_vspltb (vector unsigned char a1, const char a2) __attribute__ ((always_inline)); /* vec_abs */ @@ -1132,7 +1206,97 @@ vec_dssall () /* vec_dst */ inline void -vec_dst (void *a1, int a2, const char a3) +vec_dst (vector unsigned char *a1, int a2, const char a3) +{ + __builtin_altivec_dst ((void *) a1, a2, a3); +} + +inline void +vec_dst (vector signed char *a1, int a2, const char a3) +{ + __builtin_altivec_dst ((void *) a1, a2, a3); +} + +inline void +vec_dst (vector unsigned short *a1, int a2, const char a3) +{ + __builtin_altivec_dst ((void *) a1, a2, a3); +} + +inline void +vec_dst (vector signed short *a1, int a2, const char a3) +{ + __builtin_altivec_dst ((void *) a1, a2, a3); +} + +inline void +vec_dst (vector unsigned int *a1, int a2, const char a3) +{ + __builtin_altivec_dst ((void *) a1, a2, a3); +} + +inline void +vec_dst (vector signed int *a1, int a2, const char a3) +{ + __builtin_altivec_dst ((void *) a1, a2, a3); +} + +inline void +vec_dst (vector float *a1, int a2, const char a3) +{ + __builtin_altivec_dst ((void *) a1, a2, a3); +} + +inline void +vec_dst (unsigned char *a1, int a2, const char a3) +{ + __builtin_altivec_dst ((void *) a1, a2, a3); +} + +inline void +vec_dst (signed char *a1, int a2, const char a3) +{ + __builtin_altivec_dst ((void *) a1, a2, a3); +} + +inline void +vec_dst (unsigned short *a1, int a2, const char a3) +{ + __builtin_altivec_dst ((void *) a1, a2, a3); +} + +inline void +vec_dst (signed short *a1, int a2, const char a3) +{ + __builtin_altivec_dst ((void *) a1, a2, a3); +} + +inline void +vec_dst (unsigned int *a1, int a2, const char a3) +{ + __builtin_altivec_dst ((void *) a1, a2, a3); +} + +inline void +vec_dst (signed int *a1, int a2, const char a3) +{ + __builtin_altivec_dst ((void *) a1, a2, a3); +} + +inline void +vec_dst (unsigned long *a1, int a2, const char a3) +{ + __builtin_altivec_dst ((void *) a1, a2, a3); +} + +inline void +vec_dst (signed long *a1, int a2, const char a3) +{ + __builtin_altivec_dst ((void *) a1, a2, a3); +} + +inline void +vec_dst (float *a1, int a2, const char a3) { __builtin_altivec_dst ((void *) a1, a2, a3); } @@ -1140,7 +1304,97 @@ vec_dst (void *a1, int a2, const char a3) /* vec_dstst */ inline void -vec_dstst (void *a1, int a2, const char a3) +vec_dstst (vector unsigned char *a1, int a2, const char a3) +{ + __builtin_altivec_dstst ((void *) a1, a2, a3); +} + +inline void +vec_dstst (vector signed char *a1, int a2, const char a3) +{ + __builtin_altivec_dstst ((void *) a1, a2, a3); +} + +inline void +vec_dstst (vector unsigned short *a1, int a2, const char a3) +{ + __builtin_altivec_dstst ((void *) a1, a2, a3); +} + +inline void +vec_dstst (vector signed short *a1, int a2, const char a3) +{ + __builtin_altivec_dstst ((void *) a1, a2, a3); +} + +inline void +vec_dstst (vector unsigned int *a1, int a2, const char a3) +{ + __builtin_altivec_dstst ((void *) a1, a2, a3); +} + +inline void +vec_dstst (vector signed int *a1, int a2, const char a3) +{ + __builtin_altivec_dstst ((void *) a1, a2, a3); +} + +inline void +vec_dstst (vector float *a1, int a2, const char a3) +{ + __builtin_altivec_dstst ((void *) a1, a2, a3); +} + +inline void +vec_dstst (unsigned char *a1, int a2, const char a3) +{ + __builtin_altivec_dstst ((void *) a1, a2, a3); +} + +inline void +vec_dstst (signed char *a1, int a2, const char a3) +{ + __builtin_altivec_dstst ((void *) a1, a2, a3); +} + +inline void +vec_dstst (unsigned short *a1, int a2, const char a3) +{ + __builtin_altivec_dstst ((void *) a1, a2, a3); +} + +inline void +vec_dstst (signed short *a1, int a2, const char a3) +{ + __builtin_altivec_dstst ((void *) a1, a2, a3); +} + +inline void +vec_dstst (unsigned int *a1, int a2, const char a3) +{ + __builtin_altivec_dstst ((void *) a1, a2, a3); +} + +inline void +vec_dstst (signed int *a1, int a2, const char a3) +{ + __builtin_altivec_dstst ((void *) a1, a2, a3); +} + +inline void +vec_dstst (unsigned long *a1, int a2, const char a3) +{ + __builtin_altivec_dstst ((void *) a1, a2, a3); +} + +inline void +vec_dstst (signed long *a1, int a2, const char a3) +{ + __builtin_altivec_dstst ((void *) a1, a2, a3); +} + +inline void +vec_dstst (float *a1, int a2, const char a3) { __builtin_altivec_dstst ((void *) a1, a2, a3); } @@ -1148,7 +1402,97 @@ vec_dstst (void *a1, int a2, const char a3) /* vec_dststt */ inline void -vec_dststt (void *a1, int a2, const char a3) +vec_dststt (vector unsigned char *a1, int a2, const char a3) +{ + __builtin_altivec_dststt ((void *) a1, a2, a3); +} + +inline void +vec_dststt (vector signed char *a1, int a2, const char a3) +{ + __builtin_altivec_dststt ((void *) a1, a2, a3); +} + +inline void +vec_dststt (vector unsigned short *a1, int a2, const char a3) +{ + __builtin_altivec_dststt ((void *) a1, a2, a3); +} + +inline void +vec_dststt (vector signed short *a1, int a2, const char a3) +{ + __builtin_altivec_dststt ((void *) a1, a2, a3); +} + +inline void +vec_dststt (vector unsigned int *a1, int a2, const char a3) +{ + __builtin_altivec_dststt ((void *) a1, a2, a3); +} + +inline void +vec_dststt (vector signed int *a1, int a2, const char a3) +{ + __builtin_altivec_dststt ((void *) a1, a2, a3); +} + +inline void +vec_dststt (vector float *a1, int a2, const char a3) +{ + __builtin_altivec_dststt ((void *) a1, a2, a3); +} + +inline void +vec_dststt (unsigned char *a1, int a2, const char a3) +{ + __builtin_altivec_dststt ((void *) a1, a2, a3); +} + +inline void +vec_dststt (signed char *a1, int a2, const char a3) +{ + __builtin_altivec_dststt ((void *) a1, a2, a3); +} + +inline void +vec_dststt (unsigned short *a1, int a2, const char a3) +{ + __builtin_altivec_dststt ((void *) a1, a2, a3); +} + +inline void +vec_dststt (signed short *a1, int a2, const char a3) +{ + __builtin_altivec_dststt ((void *) a1, a2, a3); +} + +inline void +vec_dststt (unsigned int *a1, int a2, const char a3) +{ + __builtin_altivec_dststt ((void *) a1, a2, a3); +} + +inline void +vec_dststt (signed int *a1, int a2, const char a3) +{ + __builtin_altivec_dststt ((void *) a1, a2, a3); +} + +inline void +vec_dststt (unsigned long *a1, int a2, const char a3) +{ + __builtin_altivec_dststt ((void *) a1, a2, a3); +} + +inline void +vec_dststt (signed long *a1, int a2, const char a3) +{ + __builtin_altivec_dststt ((void *) a1, a2, a3); +} + +inline void +vec_dststt (float *a1, int a2, const char a3) { __builtin_altivec_dststt ((void *) a1, a2, a3); } @@ -1156,7 +1500,97 @@ vec_dststt (void *a1, int a2, const char a3) /* vec_dstt */ inline void -vec_dstt (void *a1, int a2, const char a3) +vec_dstt (vector unsigned char *a1, int a2, const char a3) +{ + __builtin_altivec_dstt ((void *) a1, a2, a3); +} + +inline void +vec_dstt (vector signed char *a1, int a2, const char a3) +{ + __builtin_altivec_dstt ((void *) a1, a2, a3); +} + +inline void +vec_dstt (vector unsigned short *a1, int a2, const char a3) +{ + __builtin_altivec_dstt ((void *) a1, a2, a3); +} + +inline void +vec_dstt (vector signed short *a1, int a2, const char a3) +{ + __builtin_altivec_dstt ((void *) a1, a2, a3); +} + +inline void +vec_dstt (vector unsigned int *a1, int a2, const char a3) +{ + __builtin_altivec_dstt ((void *) a1, a2, a3); +} + +inline void +vec_dstt (vector signed int *a1, int a2, const char a3) +{ + __builtin_altivec_dstt ((void *) a1, a2, a3); +} + +inline void +vec_dstt (vector float *a1, int a2, const char a3) +{ + __builtin_altivec_dstt ((void *) a1, a2, a3); +} + +inline void +vec_dstt (unsigned char *a1, int a2, const char a3) +{ + __builtin_altivec_dstt ((void *) a1, a2, a3); +} + +inline void +vec_dstt (signed char *a1, int a2, const char a3) +{ + __builtin_altivec_dstt ((void *) a1, a2, a3); +} + +inline void +vec_dstt (unsigned short *a1, int a2, const char a3) +{ + __builtin_altivec_dstt ((void *) a1, a2, a3); +} + +inline void +vec_dstt (signed short *a1, int a2, const char a3) +{ + __builtin_altivec_dstt ((void *) a1, a2, a3); +} + +inline void +vec_dstt (unsigned int *a1, int a2, const char a3) +{ + __builtin_altivec_dstt ((void *) a1, a2, a3); +} + +inline void +vec_dstt (signed int *a1, int a2, const char a3) +{ + __builtin_altivec_dstt ((void *) a1, a2, a3); +} + +inline void +vec_dstt (unsigned long *a1, int a2, const char a3) +{ + __builtin_altivec_dstt ((void *) a1, a2, a3); +} + +inline void +vec_dstt (signed long *a1, int a2, const char a3) +{ + __builtin_altivec_dstt ((void *) a1, a2, a3); +} + +inline void +vec_dstt (float *a1, int a2, const char a3) { __builtin_altivec_dstt ((void *) a1, a2, a3); } @@ -1203,6 +1637,12 @@ vec_ld (int a1, signed int *a2) return (vector signed int) __builtin_altivec_lvx (a1, (void *) a2); } +inline vector signed int +vec_ld (int a1, signed long *a2) +{ + return (vector signed int) __builtin_altivec_lvx (a1, (void *) a2); +} + inline vector unsigned int vec_ld (int a1, vector unsigned int *a2) { @@ -1215,6 +1655,12 @@ vec_ld (int a1, unsigned int *a2) return (vector unsigned int) __builtin_altivec_lvx (a1, (void *) a2); } +inline vector unsigned int +vec_ld (int a1, unsigned long *a2) +{ + return (vector unsigned int) __builtin_altivec_lvx (a1, (void *) a2); +} + inline vector signed short vec_ld (int a1, vector signed short *a2) { @@ -1307,6 +1753,18 @@ vec_lde (int a1, unsigned int *a2) return (vector unsigned int) __builtin_altivec_lvewx (a1, (void *) a2); } +inline vector signed int +vec_lde (int a1, signed long *a2) +{ + return (vector signed int) __builtin_altivec_lvewx (a1, (void *) a2); +} + +inline vector unsigned int +vec_lde (int a1, unsigned long *a2) +{ + return (vector unsigned int) __builtin_altivec_lvewx (a1, (void *) a2); +} + /* vec_lvewx */ inline vector float @@ -1327,6 +1785,18 @@ vec_lvewx (int a1, unsigned int *a2) return (vector unsigned int) __builtin_altivec_lvewx (a1, (void *) a2); } +inline vector signed int +vec_lvewx (int a1, signed long *a2) +{ + return (vector signed int) __builtin_altivec_lvewx (a1, (void *) a2); +} + +inline vector unsigned int +vec_lvewx (int a1, unsigned long *a2) +{ + return (vector unsigned int) __builtin_altivec_lvewx (a1, (void *) a2); +} + /* vec_lvehx */ inline vector signed short @@ -1381,6 +1851,12 @@ vec_ldl (int a1, signed int *a2) return (vector signed int) __builtin_altivec_lvxl (a1, (void *) a2); } +inline vector signed int +vec_ldl (int a1, signed long *a2) +{ + return (vector signed int) __builtin_altivec_lvxl (a1, (void *) a2); +} + inline vector unsigned int vec_ldl (int a1, vector unsigned int *a2) { @@ -1393,6 +1869,12 @@ vec_ldl (int a1, unsigned int *a2) return (vector unsigned int) __builtin_altivec_lvxl (a1, (void *) a2); } +inline vector unsigned int +vec_ldl (int a1, unsigned long *a2) +{ + return (vector unsigned int) __builtin_altivec_lvxl (a1, (void *) a2); +} + inline vector signed short vec_ldl (int a1, vector signed short *a2) { @@ -1488,6 +1970,18 @@ vec_lvsl (int a1, signed int *a2) } inline vector unsigned char +vec_lvsl (int a1, unsigned long *a2) +{ + return (vector unsigned char) __builtin_altivec_lvsl (a1, (void *) a2); +} + +inline vector unsigned char +vec_lvsl (int a1, signed long *a2) +{ + return (vector unsigned char) __builtin_altivec_lvsl (a1, (void *) a2); +} + +inline vector unsigned char vec_lvsl (int a1, float *a2) { return (vector unsigned char) __builtin_altivec_lvsl (a1, (void *) a2); @@ -1532,6 +2026,18 @@ vec_lvsr (int a1, signed int *a2) } inline vector unsigned char +vec_lvsr (int a1, unsigned long *a2) +{ + return (vector unsigned char) __builtin_altivec_lvsr (a1, (void *) a2); +} + +inline vector unsigned char +vec_lvsr (int a1, signed long *a2) +{ + return (vector unsigned char) __builtin_altivec_lvsr (a1, (void *) a2); +} + +inline vector unsigned char vec_lvsr (int a1, float *a2) { return (vector unsigned char) __builtin_altivec_lvsr (a1, (void *) a2); @@ -2557,10 +3063,10 @@ vec_vpkuhum (vector unsigned short a1, vector unsigned short a2) /* vec_packpx */ -inline vector signed short +inline vector unsigned short vec_packpx (vector unsigned int a1, vector unsigned int a2) { - return (vector signed short) __builtin_altivec_vpkpx ((vector signed int) a1, (vector signed int) a2); + return (vector unsigned short) __builtin_altivec_vpkpx ((vector signed int) a1, (vector signed int) a2); } /* vec_packs */ @@ -4321,6 +4827,12 @@ vec_unpackh (vector signed short a1) return (vector signed int) __builtin_altivec_vupkhsh ((vector signed short) a1); } +inline vector unsigned int +vec_unpackh (vector unsigned short a1) +{ + return (vector unsigned int) __builtin_altivec_vupkhpx ((vector signed short) a1); +} + /* vec_vupkhsh */ inline vector signed int @@ -4332,7 +4844,7 @@ vec_vupkhsh (vector signed short a1) /* vec_vupkhpx */ inline vector unsigned int -vec_vupkhpx (vector signed short a1) +vec_vupkhpx (vector unsigned short a1) { return (vector unsigned int) __builtin_altivec_vupkhpx ((vector signed short) a1); } @@ -4354,7 +4866,7 @@ vec_unpackl (vector signed char a1) } inline vector unsigned int -vec_vupklpx (vector signed short a1) +vec_unpackl (vector unsigned short a1) { return (vector unsigned int) __builtin_altivec_vupklpx ((vector signed short) a1); } @@ -4365,6 +4877,14 @@ vec_unpackl (vector signed short a1) return (vector signed int) __builtin_altivec_vupklsh ((vector signed short) a1); } +/* vec_vupklpx */ + +inline vector unsigned int +vec_vupklpx (vector unsigned short a1) +{ + return (vector unsigned int) __builtin_altivec_vupklpx ((vector signed short) a1); +} + /* vec_upklsh */ inline vector signed int @@ -4630,7 +5150,7 @@ vec_all_ge (vector signed int a1, vector signed int a2) inline int vec_all_ge (vector float a1, vector float a2) { - return __builtin_altivec_vcmpgefp_p (__CR6_EQ, a1, a2); + return __builtin_altivec_vcmpgefp_p (__CR6_LT, a1, a2); } /* vec_all_gt */ @@ -5326,7 +5846,7 @@ vec_any_le (vector signed int a1, vector signed int a2) inline int vec_any_le (vector float a1, vector float a2) { - return __builtin_altivec_vcmpgefp_p (__CR6_LT_REV, a2, a1); + return __builtin_altivec_vcmpgefp_p (__CR6_EQ_REV, a2, a1); } /* vec_any_lt */ @@ -5595,7 +6115,7 @@ struct __vec_step_help<vector float> static const int _S_elem = 4; }; -#define vec_step(t) __vec_step_help<t>::_S_elem +#define vec_step(t) __vec_step_help<typeof(t)>::_S_elem #else /* not C++ */ @@ -5623,13 +6143,13 @@ struct __vec_step_help<vector float> __altivec_link_error_invalid_argument ()))) #define vec_step(t) \ - __ch (__builtin_types_compatible_p (t, vector signed int), 4, \ - __ch (__builtin_types_compatible_p (t, vector unsigned int), 4, \ - __ch (__builtin_types_compatible_p (t, vector signed short), 8, \ - __ch (__builtin_types_compatible_p (t, vector unsigned short), 8, \ - __ch (__builtin_types_compatible_p (t, vector signed char), 16, \ - __ch (__builtin_types_compatible_p (t, vector unsigned char), 16, \ - __ch (__builtin_types_compatible_p (t, vector float), 4, \ + __ch (__builtin_types_compatible_p (typeof (t), vector signed int), 4, \ + __ch (__builtin_types_compatible_p (typeof (t), vector unsigned int), 4, \ + __ch (__builtin_types_compatible_p (typeof (t), vector signed short), 8, \ + __ch (__builtin_types_compatible_p (typeof (t), vector unsigned short), 8, \ + __ch (__builtin_types_compatible_p (typeof (t), vector signed char), 16, \ + __ch (__builtin_types_compatible_p (typeof (t), vector unsigned char), 16, \ + __ch (__builtin_types_compatible_p (typeof (t), vector float), 4, \ __altivec_link_error_invalid_argument ()))))))) #define vec_vaddubm(a1, a2) \ @@ -5813,8 +6333,10 @@ __ch (__bin_args_eq (vector float, (a1), vector unsigned int, (a2)), \ ((vector float) __builtin_altivec_vandc ((vector signed int) (a1), (vector signed int) (a2))), \ __ch (__bin_args_eq (vector unsigned int, (a1), vector float, (a2)), \ ((vector float) __builtin_altivec_vandc ((vector signed int) (a1), (vector signed int) (a2))), \ -__ch (__bin_args_eq (vector unsigned int, (a1), vector unsigned int, (a2)), \ - ((vector unsigned int) __builtin_altivec_vandc ((vector signed int) (a1), (vector signed int) (a2))), \ +__ch (__bin_args_eq (vector signed int, (a1), vector float, (a2)), \ + ((vector float) __builtin_altivec_vandc ((vector signed int) (a1), (vector signed int) (a2))), \ +__ch (__bin_args_eq (vector float, (a1), vector signed int, (a2)), \ + ((vector float) __builtin_altivec_vandc ((vector signed int) (a1), (vector signed int) (a2))), \ __ch (__bin_args_eq (vector signed int, (a1), vector unsigned int, (a2)), \ ((vector unsigned int) __builtin_altivec_vandc ((vector signed int) (a1), (vector signed int) (a2))), \ __ch (__bin_args_eq (vector signed int, (a1), vector signed int, (a2)), \ @@ -5826,9 +6348,9 @@ __ch (__bin_args_eq (vector unsigned int, (a1), vector unsigned int, (a2)), \ __ch (__bin_args_eq (vector unsigned short, (a1), vector unsigned short, (a2)), \ ((vector unsigned short) __builtin_altivec_vandc ((vector signed int) (a1), (vector signed int) (a2))), \ __ch (__bin_args_eq (vector signed short, (a1), vector unsigned short, (a2)), \ - ((vector signed short) __builtin_altivec_vandc ((vector signed int) (a1), (vector signed int) (a2))), \ + ((vector unsigned short) __builtin_altivec_vandc ((vector signed int) (a1), (vector signed int) (a2))), \ __ch (__bin_args_eq (vector unsigned short, (a1), vector signed short, (a2)), \ - ((vector signed short) __builtin_altivec_vandc ((vector signed int) (a1), (vector signed int) (a2))), \ + ((vector unsigned short) __builtin_altivec_vandc ((vector signed int) (a1), (vector signed int) (a2))), \ __ch (__bin_args_eq (vector unsigned short, (a1), vector unsigned short, (a2)), \ ((vector signed short) __builtin_altivec_vandc ((vector signed int) (a1), (vector signed int) (a2))), \ __ch (__bin_args_eq (vector signed short, (a1), vector signed short, (a2)), \ @@ -5851,7 +6373,7 @@ __ch (__bin_args_eq (vector signed char, (a1), vector signed char, (a2)), \ ((vector signed char) __builtin_altivec_vandc ((vector signed int) (a1), (vector signed int) (a2))), \ __ch (__bin_args_eq (vector unsigned char, (a1), vector signed char, (a2)), \ ((vector signed char) __builtin_altivec_vandc ((vector signed int) (a1), (vector signed int) (a2))), \ - __altivec_link_error_invalid_argument ())))))))))))))))))))))) + __altivec_link_error_invalid_argument ()))))))))))))))))))))))) #define vec_avg(a1, a2) \ __ch (__bin_args_eq (vector unsigned char, (a1), vector unsigned char, (a2)), \ @@ -6023,17 +6545,25 @@ __ch (__bin_args_eq (vector unsigned int, (a1), int, (a2)), \ ((vector float) __builtin_altivec_vcfux ((vector signed int) (a1), (const char) (a2))), \ __ch (__bin_args_eq (vector signed int, (a1), int, (a2)), \ ((vector float) __builtin_altivec_vcfsx ((vector signed int) (a1), (const char) (a2))), \ - __altivec_link_error_invalid_argument ())) +__ch (__bin_args_eq (vector unsigned int, (a1), unsigned int, (a2)), \ + ((vector float) __builtin_altivec_vcfux ((vector signed int) (a1), (const char) (a2))), \ +__ch (__bin_args_eq (vector signed int, (a1), unsigned int, (a2)), \ + ((vector float) __builtin_altivec_vcfsx ((vector signed int) (a1), (const char) (a2))), \ + __altivec_link_error_invalid_argument ())))) #define vec_vcfsx(a1, a2) \ __ch (__bin_args_eq (vector signed int, (a1), int, (a2)), \ ((vector float) __builtin_altivec_vcfsx ((vector signed int) (a1), (const char) (a2))), \ - __altivec_link_error_invalid_argument ()) +__ch (__bin_args_eq (vector signed int, (a1), unsigned int, (a2)), \ + ((vector float) __builtin_altivec_vcfsx ((vector signed int) (a1), (const char) (a2))), \ + __altivec_link_error_invalid_argument ())) #define vec_vcfux(a1, a2) \ __ch (__bin_args_eq (vector unsigned int, (a1), int, (a2)), \ ((vector float) __builtin_altivec_vcfux ((vector signed int) (a1), (const char) (a2))), \ - __altivec_link_error_invalid_argument ()) +__ch (__bin_args_eq (vector unsigned int, (a1), unsigned int, (a2)), \ + ((vector float) __builtin_altivec_vcfux ((vector signed int) (a1), (const char) (a2))), \ + __altivec_link_error_invalid_argument ())) #define vec_cts(a1, a2) __builtin_altivec_vctsxs ((a1), (a2)) @@ -6043,209 +6573,311 @@ __ch (__bin_args_eq (vector unsigned int, (a1), int, (a2)), \ #define vec_dssall() __builtin_altivec_dssall () -#define vec_dst(a1, a2, a3) __builtin_altivec_dst ((a1), (a2), (a3)) - -#define vec_dstst(a1, a2, a3) __builtin_altivec_dstst ((a1), (a2), (a3)) - -#define vec_dststt(a1, a2, a3) __builtin_altivec_dststt ((a1), (a2), (a3)) - -#define vec_dstt(a1, a2, a3) __builtin_altivec_dstt ((a1), (a2), (a3)) +#define vec_dst(a1, a2, a3) \ +__ch (__un_args_eq (vector unsigned char, *(a1)), \ + __builtin_altivec_dst ((void *) (a1), (a2), (a3)), \ +__ch (__un_args_eq (vector signed char, *(a1)), \ + __builtin_altivec_dst ((void *) (a1), (a2), (a3)), \ +__ch (__un_args_eq (vector unsigned short, *(a1)), \ + __builtin_altivec_dst ((void *) (a1), (a2), (a3)), \ +__ch (__un_args_eq (vector signed short, *(a1)), \ + __builtin_altivec_dst ((void *) (a1), (a2), (a3)), \ +__ch (__un_args_eq (vector unsigned int, *(a1)), \ + __builtin_altivec_dst ((void *) (a1), (a2), (a3)), \ +__ch (__un_args_eq (vector signed int, *(a1)), \ + __builtin_altivec_dst ((void *) (a1), (a2), (a3)), \ +__ch (__un_args_eq (vector float, *(a1)), \ + __builtin_altivec_dst ((void *) (a1), (a2), (a3)), \ +__ch (__un_args_eq (unsigned char, *(a1)), \ + __builtin_altivec_dst ((void *) (a1), (a2), (a3)), \ +__ch (__un_args_eq (signed char, *(a1)), \ + __builtin_altivec_dst ((void *) (a1), (a2), (a3)), \ +__ch (__un_args_eq (unsigned short, *(a1)), \ + __builtin_altivec_dst ((void *) (a1), (a2), (a3)), \ +__ch (__un_args_eq (signed short, *(a1)), \ + __builtin_altivec_dst ((void *) (a1), (a2), (a3)), \ +__ch (__un_args_eq (unsigned int, *(a1)), \ + __builtin_altivec_dst ((void *) (a1), (a2), (a3)), \ +__ch (__un_args_eq (signed int, *(a1)), \ + __builtin_altivec_dst ((void *) (a1), (a2), (a3)), \ +__ch (__un_args_eq (unsigned long, *(a1)), \ + __builtin_altivec_dst ((void *) (a1), (a2), (a3)), \ +__ch (__un_args_eq (signed long, *(a1)), \ + __builtin_altivec_dst ((void *) (a1), (a2), (a3)), \ +__ch (__un_args_eq (float, *(a1)), \ + __builtin_altivec_dst ((void *) (a1), (a2), (a3)), \ + __altivec_link_error_invalid_argument ())))))))))))))))) + +#define vec_dstst(a1, a2, a3) \ +__ch (__un_args_eq (vector unsigned char, *(a1)), \ + __builtin_altivec_dstst ((void *) (a1), (a2), (a3)), \ +__ch (__un_args_eq (vector signed char, *(a1)), \ + __builtin_altivec_dstst ((void *) (a1), (a2), (a3)), \ +__ch (__un_args_eq (vector unsigned short, *(a1)), \ + __builtin_altivec_dstst ((void *) (a1), (a2), (a3)), \ +__ch (__un_args_eq (vector signed short, *(a1)), \ + __builtin_altivec_dstst ((void *) (a1), (a2), (a3)), \ +__ch (__un_args_eq (vector unsigned int, *(a1)), \ + __builtin_altivec_dstst ((void *) (a1), (a2), (a3)), \ +__ch (__un_args_eq (vector signed int, *(a1)), \ + __builtin_altivec_dstst ((void *) (a1), (a2), (a3)), \ +__ch (__un_args_eq (vector float, *(a1)), \ + __builtin_altivec_dstst ((void *) (a1), (a2), (a3)), \ +__ch (__un_args_eq (unsigned char, *(a1)), \ + __builtin_altivec_dstst ((void *) (a1), (a2), (a3)), \ +__ch (__un_args_eq (signed char, *(a1)), \ + __builtin_altivec_dstst ((void *) (a1), (a2), (a3)), \ +__ch (__un_args_eq (unsigned short, *(a1)), \ + __builtin_altivec_dstst ((void *) (a1), (a2), (a3)), \ +__ch (__un_args_eq (signed short, *(a1)), \ + __builtin_altivec_dstst ((void *) (a1), (a2), (a3)), \ +__ch (__un_args_eq (unsigned int, *(a1)), \ + __builtin_altivec_dstst ((void *) (a1), (a2), (a3)), \ +__ch (__un_args_eq (signed int, *(a1)), \ + __builtin_altivec_dstst ((void *) (a1), (a2), (a3)), \ +__ch (__un_args_eq (unsigned long, *(a1)), \ + __builtin_altivec_dstst ((void *) (a1), (a2), (a3)), \ +__ch (__un_args_eq (signed long, *(a1)), \ + __builtin_altivec_dstst ((void *) (a1), (a2), (a3)), \ +__ch (__un_args_eq (float, *(a1)), \ + __builtin_altivec_dstst ((void *) (a1), (a2), (a3)), \ + __altivec_link_error_invalid_argument ())))))))))))))))) + +#define vec_dststt(a1, a2, a3) \ +__ch (__un_args_eq (vector unsigned char, *(a1)), \ + __builtin_altivec_dststt ((void *) (a1), (a2), (a3)), \ +__ch (__un_args_eq (vector signed char, *(a1)), \ + __builtin_altivec_dststt ((void *) (a1), (a2), (a3)), \ +__ch (__un_args_eq (vector unsigned short, *(a1)), \ + __builtin_altivec_dststt ((void *) (a1), (a2), (a3)), \ +__ch (__un_args_eq (vector signed short, *(a1)), \ + __builtin_altivec_dststt ((void *) (a1), (a2), (a3)), \ +__ch (__un_args_eq (vector unsigned int, *(a1)), \ + __builtin_altivec_dststt ((void *) (a1), (a2), (a3)), \ +__ch (__un_args_eq (vector signed int, *(a1)), \ + __builtin_altivec_dststt ((void *) (a1), (a2), (a3)), \ +__ch (__un_args_eq (vector float, *(a1)), \ + __builtin_altivec_dststt ((void *) (a1), (a2), (a3)), \ +__ch (__un_args_eq (unsigned char, *(a1)), \ + __builtin_altivec_dststt ((void *) (a1), (a2), (a3)), \ +__ch (__un_args_eq (signed char, *(a1)), \ + __builtin_altivec_dststt ((void *) (a1), (a2), (a3)), \ +__ch (__un_args_eq (unsigned short, *(a1)), \ + __builtin_altivec_dststt ((void *) (a1), (a2), (a3)), \ +__ch (__un_args_eq (signed short, *(a1)), \ + __builtin_altivec_dststt ((void *) (a1), (a2), (a3)), \ +__ch (__un_args_eq (unsigned int, *(a1)), \ + __builtin_altivec_dststt ((void *) (a1), (a2), (a3)), \ +__ch (__un_args_eq (signed int, *(a1)), \ + __builtin_altivec_dststt ((void *) (a1), (a2), (a3)), \ +__ch (__un_args_eq (unsigned long, *(a1)), \ + __builtin_altivec_dststt ((void *) (a1), (a2), (a3)), \ +__ch (__un_args_eq (signed long, *(a1)), \ + __builtin_altivec_dststt ((void *) (a1), (a2), (a3)), \ +__ch (__un_args_eq (float, *(a1)), \ + __builtin_altivec_dststt ((void *) (a1), (a2), (a3)), \ + __altivec_link_error_invalid_argument ())))))))))))))))) + +#define vec_dstt(a1, a2, a3) \ +__ch (__un_args_eq (vector unsigned char, *(a1)), \ + __builtin_altivec_dstt ((void *) (a1), (a2), (a3)), \ +__ch (__un_args_eq (vector signed char, *(a1)), \ + __builtin_altivec_dstt ((void *) (a1), (a2), (a3)), \ +__ch (__un_args_eq (vector unsigned short, *(a1)), \ + __builtin_altivec_dstt ((void *) (a1), (a2), (a3)), \ +__ch (__un_args_eq (vector signed short, *(a1)), \ + __builtin_altivec_dstt ((void *) (a1), (a2), (a3)), \ +__ch (__un_args_eq (vector unsigned int, *(a1)), \ + __builtin_altivec_dstt ((void *) (a1), (a2), (a3)), \ +__ch (__un_args_eq (vector signed int, *(a1)), \ + __builtin_altivec_dstt ((void *) (a1), (a2), (a3)), \ +__ch (__un_args_eq (vector float, *(a1)), \ + __builtin_altivec_dstt ((void *) (a1), (a2), (a3)), \ +__ch (__un_args_eq (unsigned char, *(a1)), \ + __builtin_altivec_dstt ((void *) (a1), (a2), (a3)), \ +__ch (__un_args_eq (signed char, *(a1)), \ + __builtin_altivec_dstt ((void *) (a1), (a2), (a3)), \ +__ch (__un_args_eq (unsigned short, *(a1)), \ + __builtin_altivec_dstt ((void *) (a1), (a2), (a3)), \ +__ch (__un_args_eq (signed short, *(a1)), \ + __builtin_altivec_dstt ((void *) (a1), (a2), (a3)), \ +__ch (__un_args_eq (unsigned int, *(a1)), \ + __builtin_altivec_dstt ((void *) (a1), (a2), (a3)), \ +__ch (__un_args_eq (signed int, *(a1)), \ + __builtin_altivec_dstt ((void *) (a1), (a2), (a3)), \ +__ch (__un_args_eq (unsigned long, *(a1)), \ + __builtin_altivec_dstt ((void *) (a1), (a2), (a3)), \ +__ch (__un_args_eq (signed long, *(a1)), \ + __builtin_altivec_dstt ((void *) (a1), (a2), (a3)), \ +__ch (__un_args_eq (float, *(a1)), \ + __builtin_altivec_dstt ((void *) (a1), (a2), (a3)), \ + __altivec_link_error_invalid_argument ())))))))))))))))) #define vec_expte(a1) __builtin_altivec_vexptefp ((a1)) #define vec_floor(a1) __builtin_altivec_vrfim (a1) #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)), \ +__ch (__un_args_eq (vector unsigned char, *(b)), \ ((vector unsigned char) __builtin_altivec_lvx ((a), (b))), \ -__ch (__un_args_eq (unsigned char *, (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)), \ +__ch (__un_args_eq (vector signed char, *(b)), \ ((vector signed char) __builtin_altivec_lvx ((a), (b))), \ -__ch (__un_args_eq (signed char [], (b)), \ +__ch (__un_args_eq (signed char, *(b)), \ ((vector signed char) __builtin_altivec_lvx ((a), (b))), \ -__ch (__un_args_eq (vector unsigned short *, (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)), \ +__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 (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)), \ +__ch (__un_args_eq (vector signed short, *(b)), \ ((vector signed short) __builtin_altivec_lvx ((a), (b))), \ -__ch (__un_args_eq (signed short [], (b)), \ +__ch (__un_args_eq (signed short, *(b)), \ ((vector signed short) __builtin_altivec_lvx ((a), (b))), \ -__ch (__un_args_eq (vector unsigned int *, (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)), \ +__ch (__un_args_eq (unsigned int, *(b)), \ ((vector unsigned int) __builtin_altivec_lvx ((a), (b))), \ -__ch (__un_args_eq (unsigned int *, (b)), \ +__ch (__un_args_eq (unsigned long, *(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)), \ +__ch (__un_args_eq (vector signed int, *(b)), \ ((vector signed int) __builtin_altivec_lvx ((a), (b))), \ -__ch (__un_args_eq (signed int *, (b)), \ +__ch (__un_args_eq (signed int, *(b)), \ ((vector signed int) __builtin_altivec_lvx ((a), (b))), \ -__ch (__un_args_eq (signed int [], (b)), \ +__ch (__un_args_eq (signed long, *(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)), \ +__ch (__un_args_eq (vector float, *(b)), \ ((vector float) __builtin_altivec_lvx ((a), (b))), \ -__ch (__un_args_eq (float [], (b)), \ +__ch (__un_args_eq (float, *(b)), \ ((vector float) __builtin_altivec_lvx ((a), (b))), \ -__altivec_link_error_invalid_argument ())))))))))))))))))))))))))))) +__altivec_link_error_invalid_argument ())))))))))))))))) #define vec_lde(a, b) \ -__ch (__un_args_eq (unsigned char *, (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)), \ +__ch (__un_args_eq (signed char, *(b)), \ ((vector signed char) __builtin_altivec_lvebx ((a), (b))), \ -__ch (__un_args_eq (unsigned short *, (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)), \ +__ch (__un_args_eq (signed short, *(b)), \ ((vector signed short) __builtin_altivec_lvehx ((a), (b))), \ -__ch (__un_args_eq (unsigned int *, (b)), \ +__ch (__un_args_eq (unsigned long, *(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)), \ +__ch (__un_args_eq (signed long, *(b)), \ ((vector signed int) __builtin_altivec_lvewx ((a), (b))), \ -__ch (__un_args_eq (signed int [], (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 (float *, (b)), \ +__ch (__un_args_eq (float, *(b)), \ ((vector float) __builtin_altivec_lvewx ((a), (b))), \ -__ch (__un_args_eq (float [], (b)), \ - ((vector float) __builtin_altivec_lvewx ((a), (b))), \ -__altivec_link_error_invalid_argument ())))))))))))))) +__altivec_link_error_invalid_argument ()))))))))) #define vec_lvewx(a, b) \ -__ch (__un_args_eq (unsigned int *, (b)), \ - ((vector unsigned int) __builtin_altivec_lvewx ((a), (b))), \ -__ch (__un_args_eq (unsigned int [], (b)), \ +__ch (__un_args_eq (unsigned int, *(b)), \ ((vector unsigned int) __builtin_altivec_lvewx ((a), (b))), \ -__ch (__un_args_eq (signed int *, (b)), \ +__ch (__un_args_eq (signed int, *(b)), \ ((vector signed int) __builtin_altivec_lvewx ((a), (b))), \ -__ch (__un_args_eq (signed int [], (b)), \ +__ch (__un_args_eq (unsigned long, *(b)), \ + ((vector unsigned int) __builtin_altivec_lvewx ((a), (b))), \ +__ch (__un_args_eq (signed long, *(b)), \ ((vector signed int) __builtin_altivec_lvewx ((a), (b))), \ -__ch (__un_args_eq (float *, (b)), \ - ((vector float) __builtin_altivec_lvewx ((a), (b))), \ -__ch (__un_args_eq (float [], (b)), \ +__ch (__un_args_eq (float, *(b)), \ ((vector float) __builtin_altivec_lvewx ((a), (b))), \ -__altivec_link_error_invalid_argument ())))))) +__altivec_link_error_invalid_argument ()))))) #define vec_lvehx(a, b) \ -__ch (__un_args_eq (unsigned short *, (b)), \ - ((vector unsigned short) __builtin_altivec_lvehx ((a), (b))), \ -__ch (__un_args_eq (unsigned short [], (b)), \ +__ch (__un_args_eq (unsigned short, *(b)), \ ((vector unsigned short) __builtin_altivec_lvehx ((a), (b))), \ -__ch (__un_args_eq (signed short *, (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))), \ -__altivec_link_error_invalid_argument ())))) +__altivec_link_error_invalid_argument ())) #define vec_lvebx(a, b) \ -__ch (__un_args_eq (unsigned char *, (b)), \ - ((vector unsigned char) __builtin_altivec_lvebx ((a), (b))), \ -__ch (__un_args_eq (unsigned char [], (b)), \ +__ch (__un_args_eq (unsigned char, *(b)), \ ((vector unsigned char) __builtin_altivec_lvebx ((a), (b))), \ -__ch (__un_args_eq (signed char *, (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))), \ -__altivec_link_error_invalid_argument ())))) +__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)), \ +__ch (__un_args_eq (vector unsigned char, *(b)), \ ((vector unsigned char) __builtin_altivec_lvxl ((a), (b))), \ -__ch (__un_args_eq (unsigned char *, (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)), \ +__ch (__un_args_eq (vector signed char, *(b)), \ ((vector signed char) __builtin_altivec_lvxl ((a), (b))), \ -__ch (__un_args_eq (signed char [], (b)), \ +__ch (__un_args_eq (signed char, *(b)), \ ((vector signed char) __builtin_altivec_lvxl ((a), (b))), \ -__ch (__un_args_eq (vector unsigned short *, (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)), \ +__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 (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)), \ +__ch (__un_args_eq (vector signed short, *(b)), \ ((vector signed short) __builtin_altivec_lvxl ((a), (b))), \ -__ch (__un_args_eq (signed short [], (b)), \ +__ch (__un_args_eq (signed short, *(b)), \ ((vector signed short) __builtin_altivec_lvxl ((a), (b))), \ -__ch (__un_args_eq (vector unsigned int *, (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)), \ +__ch (__un_args_eq (unsigned int, *(b)), \ ((vector unsigned int) __builtin_altivec_lvxl ((a), (b))), \ -__ch (__un_args_eq (unsigned int *, (b)), \ +__ch (__un_args_eq (unsigned long, *(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)), \ +__ch (__un_args_eq (vector signed int, *(b)), \ ((vector signed int) __builtin_altivec_lvxl ((a), (b))), \ -__ch (__un_args_eq (signed int *, (b)), \ +__ch (__un_args_eq (signed int, *(b)), \ ((vector signed int) __builtin_altivec_lvxl ((a), (b))), \ -__ch (__un_args_eq (signed int [], (b)), \ +__ch (__un_args_eq (signed long, *(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)), \ +__ch (__un_args_eq (vector float, *(b)), \ ((vector float) __builtin_altivec_lvxl ((a), (b))), \ -__ch (__un_args_eq (float [], (b)), \ +__ch (__un_args_eq (float, *(b)), \ ((vector float) __builtin_altivec_lvxl ((a), (b))), \ -__altivec_link_error_invalid_argument ())))))))))))))))))))))))))))) +__altivec_link_error_invalid_argument ())))))))))))))))) #define vec_loge(a1) __builtin_altivec_vlogefp ((a1)) -#define vec_lvsl(a1, a2) ((vector unsigned char) __builtin_altivec_lvsl ((a1), (a2))) - -#define vec_lvsr(a1, a2) ((vector unsigned char) __builtin_altivec_lvsr ((a1), (a2))) +#define vec_lvsl(a1, a2) \ +__ch (__un_args_eq (unsigned char, *(a2)), \ + ((vector unsigned char) __builtin_altivec_lvsl ((a1), (void *) (a2))), \ +__ch (__un_args_eq (signed char, *(a2)), \ + ((vector unsigned char) __builtin_altivec_lvsl ((a1), (void *) (a2))), \ +__ch (__un_args_eq (unsigned short, *(a2)), \ + ((vector unsigned char) __builtin_altivec_lvsl ((a1), (void *) (a2))), \ +__ch (__un_args_eq (signed short, *(a2)), \ + ((vector unsigned char) __builtin_altivec_lvsl ((a1), (void *) (a2))), \ +__ch (__un_args_eq (unsigned int, *(a2)), \ + ((vector unsigned char) __builtin_altivec_lvsl ((a1), (void *) (a2))), \ +__ch (__un_args_eq (signed int, *(a2)), \ + ((vector unsigned char) __builtin_altivec_lvsl ((a1), (void *) (a2))), \ +__ch (__un_args_eq (unsigned long, *(a2)), \ + ((vector unsigned char) __builtin_altivec_lvsl ((a1), (void *) (a2))), \ +__ch (__un_args_eq (signed long, *(a2)), \ + ((vector unsigned char) __builtin_altivec_lvsl ((a1), (void *) (a2))), \ +__ch (__un_args_eq (float, *(a2)), \ + ((vector unsigned char) __builtin_altivec_lvsl ((a1), (void *) (a2))), \ +__altivec_link_error_invalid_argument ()))))))))) + +#define vec_lvsr(a1, a2) \ +__ch (__un_args_eq (unsigned char, *(a2)), \ + ((vector unsigned char) __builtin_altivec_lvsr ((a1), (void *) (a2))), \ +__ch (__un_args_eq (signed char, *(a2)), \ + ((vector unsigned char) __builtin_altivec_lvsr ((a1), (void *) (a2))), \ +__ch (__un_args_eq (unsigned short, *(a2)), \ + ((vector unsigned char) __builtin_altivec_lvsr ((a1), (void *) (a2))), \ +__ch (__un_args_eq (signed short, *(a2)), \ + ((vector unsigned char) __builtin_altivec_lvsr ((a1), (void *) (a2))), \ +__ch (__un_args_eq (unsigned int, *(a2)), \ + ((vector unsigned char) __builtin_altivec_lvsr ((a1), (void *) (a2))), \ +__ch (__un_args_eq (signed int, *(a2)), \ + ((vector unsigned char) __builtin_altivec_lvsr ((a1), (void *) (a2))), \ +__ch (__un_args_eq (unsigned long, *(a2)), \ + ((vector unsigned char) __builtin_altivec_lvsr ((a1), (void *) (a2))), \ +__ch (__un_args_eq (signed long, *(a2)), \ + ((vector unsigned char) __builtin_altivec_lvsr ((a1), (void *) (a2))), \ +__ch (__un_args_eq (float, *(a2)), \ + ((vector unsigned char) __builtin_altivec_lvsr ((a1), (void *) (a2))), \ +__altivec_link_error_invalid_argument ()))))))))) #define vec_madd(a1, a2, a3) (__builtin_altivec_vmaddfp ((a1), (a2), (a3))) @@ -6524,7 +7156,7 @@ __ch (__tern_args_eq (vector signed char, (a1), vector unsigned char, (a2), vect ((vector signed int) __builtin_altivec_vmsummbm ((vector signed char) (a1), (vector signed char) (a2), (vector signed int) (a3))), \ __altivec_link_error_invalid_argument ()) -#define vec_msumubm(a1, a2, a3) \ +#define vec_vmsumubm(a1, a2, a3) \ __ch (__tern_args_eq (vector unsigned char, (a1), vector unsigned char, (a2), vector unsigned int, (a3)), \ ((vector unsigned int) __builtin_altivec_vmsumubm ((vector signed char) (a1), (vector signed char) (a2), (vector signed int) (a3))), \ __altivec_link_error_invalid_argument ()) @@ -6613,7 +7245,7 @@ __ch (__bin_args_eq (vector unsigned short, (a1), vector unsigned short, (a2)), ((vector unsigned int) __builtin_altivec_vmulouh ((vector signed short) (a1), (vector signed short) (a2))), \ __altivec_link_error_invalid_argument ()) -#define vec_mulosb(a1, a2) \ +#define vec_vmulosb(a1, a2) \ __ch (__bin_args_eq (vector signed char, (a1), vector signed char, (a2)), \ ((vector signed short) __builtin_altivec_vmulosb ((vector signed char) (a1), (vector signed char) (a2))), \ __altivec_link_error_invalid_argument ()) @@ -6703,7 +7335,10 @@ __ch (__bin_args_eq (vector unsigned short, (a1), vector unsigned short, (a2)), ((vector unsigned char) __builtin_altivec_vpkuhum ((vector signed short) (a1), (vector signed short) (a2))), \ __altivec_link_error_invalid_argument ())) -#define vec_packpx(a1, a2) __builtin_altivec_vpkpx ((a1), (a2)) +#define vec_packpx(a1, a2) \ +__ch (__bin_args_eq (vector unsigned int, (a1), vector unsigned int, (a2)), \ + (vector unsigned short) __builtin_altivec_vpkpx ((vector signed int) (a1), (vector signed int) (a2)), \ +__altivec_link_error_invalid_argument ()) #define vec_packs(a1, a2) \ __ch (__bin_args_eq (vector unsigned short, (a1), vector unsigned short, (a2)), \ @@ -6886,19 +7521,33 @@ __altivec_link_error_invalid_argument ())) #define vec_sld(a1, a2, a3) \ __ch (__tern_args_eq (vector float, (a1), vector float, (a2), int, (a3)), \ ((vector float) __builtin_altivec_vsldoi_4si ((vector signed int) (a1), (vector signed int) (a2), (const char) (a3))), \ +__ch (__tern_args_eq (vector float, (a1), vector float, (a2), unsigned int, (a3)), \ + ((vector float) __builtin_altivec_vsldoi_4si ((vector signed int) (a1), (vector signed int) (a2), (const char) (a3))), \ __ch (__tern_args_eq (vector signed int, (a1), vector signed int, (a2), int, (a3)), \ ((vector signed int) __builtin_altivec_vsldoi_4si ((vector signed int) (a1), (vector signed int) (a2), (const char) (a3))), \ +__ch (__tern_args_eq (vector signed int, (a1), vector signed int, (a2), unsigned int, (a3)), \ + ((vector signed int) __builtin_altivec_vsldoi_4si ((vector signed int) (a1), (vector signed int) (a2), (const char) (a3))), \ __ch (__tern_args_eq (vector unsigned int, (a1), vector unsigned int, (a2), int, (a3)), \ ((vector unsigned int) __builtin_altivec_vsldoi_4si ((vector signed int) (a1), (vector signed int) (a2), (const char) (a3))), \ +__ch (__tern_args_eq (vector unsigned int, (a1), vector unsigned int, (a2), unsigned int, (a3)), \ + ((vector unsigned int) __builtin_altivec_vsldoi_4si ((vector signed int) (a1), (vector signed int) (a2), (const char) (a3))), \ __ch (__tern_args_eq (vector signed short, (a1), vector signed short, (a2), int, (a3)), \ ((vector signed short) __builtin_altivec_vsldoi_4si ((vector signed int) (a1), (vector signed int) (a2), (const char) (a3))), \ +__ch (__tern_args_eq (vector signed short, (a1), vector signed short, (a2), unsigned int, (a3)), \ + ((vector signed short) __builtin_altivec_vsldoi_4si ((vector signed int) (a1), (vector signed int) (a2), (const char) (a3))), \ __ch (__tern_args_eq (vector unsigned short, (a1), vector unsigned short, (a2), int, (a3)), \ ((vector unsigned short) __builtin_altivec_vsldoi_4si ((vector signed int) (a1), (vector signed int) (a2), (const char) (a3))), \ +__ch (__tern_args_eq (vector unsigned short, (a1), vector unsigned short, (a2), unsigned int, (a3)), \ + ((vector unsigned short) __builtin_altivec_vsldoi_4si ((vector signed int) (a1), (vector signed int) (a2), (const char) (a3))), \ __ch (__tern_args_eq (vector signed char, (a1), vector signed char, (a2), int, (a3)), \ ((vector signed char) __builtin_altivec_vsldoi_4si ((vector signed int) (a1), (vector signed int) (a2), (const char) (a3))), \ +__ch (__tern_args_eq (vector signed char, (a1), vector signed char, (a2), unsigned int, (a3)), \ + ((vector signed char) __builtin_altivec_vsldoi_4si ((vector signed int) (a1), (vector signed int) (a2), (const char) (a3))), \ __ch (__tern_args_eq (vector unsigned char, (a1), vector unsigned char, (a2), int, (a3)), \ ((vector unsigned char) __builtin_altivec_vsldoi_4si ((vector signed int) (a1), (vector signed int) (a2), (const char) (a3))), \ - __altivec_link_error_invalid_argument ()))))))) +__ch (__tern_args_eq (vector unsigned char, (a1), vector unsigned char, (a2), unsigned int, (a3)), \ + ((vector unsigned char) __builtin_altivec_vsldoi_4si ((vector signed int) (a1), (vector signed int) (a2), (const char) (a3))), \ + __altivec_link_error_invalid_argument ())))))))))))))) #define vec_sll(a1, a2) \ __ch (__bin_args_eq (vector signed int, (a1), vector unsigned int, (a2)), \ @@ -6973,42 +7622,70 @@ __ch (__bin_args_eq (vector unsigned char, (a1), vector unsigned char, (a2)), \ #define vec_splat(a1, a2) \ __ch (__bin_args_eq (vector signed char, ((a1)), int, ((a2))), \ ((vector signed char) __builtin_altivec_vspltb ((vector signed char) ((a1)), (const char) ((a2)))), \ +__ch (__bin_args_eq (vector signed char, ((a1)), unsigned int, ((a2))), \ + ((vector signed char) __builtin_altivec_vspltb ((vector signed char) ((a1)), (const char) ((a2)))), \ __ch (__bin_args_eq (vector unsigned char, ((a1)), int, ((a2))), \ ((vector unsigned char) __builtin_altivec_vspltb ((vector signed char) ((a1)), (const char) ((a2)))), \ +__ch (__bin_args_eq (vector unsigned char, ((a1)), unsigned int, ((a2))), \ + ((vector unsigned char) __builtin_altivec_vspltb ((vector signed char) ((a1)), (const char) ((a2)))), \ __ch (__bin_args_eq (vector signed short, ((a1)), int, ((a2))), \ ((vector signed short) __builtin_altivec_vsplth ((vector signed short) ((a1)), (const char) ((a2)))), \ +__ch (__bin_args_eq (vector signed short, ((a1)), unsigned int, ((a2))), \ + ((vector signed short) __builtin_altivec_vsplth ((vector signed short) ((a1)), (const char) ((a2)))), \ __ch (__bin_args_eq (vector unsigned short, ((a1)), int, ((a2))), \ ((vector unsigned short) __builtin_altivec_vsplth ((vector signed short) ((a1)), (const char) ((a2)))), \ +__ch (__bin_args_eq (vector unsigned short, ((a1)), unsigned int, ((a2))), \ + ((vector unsigned short) __builtin_altivec_vsplth ((vector signed short) ((a1)), (const char) ((a2)))), \ __ch (__bin_args_eq (vector float, ((a1)), int, ((a2))), \ ((vector float) __builtin_altivec_vspltw ((vector signed int) ((a1)), (const char) ((a2)))), \ +__ch (__bin_args_eq (vector float, ((a1)), unsigned int, ((a2))), \ + ((vector float) __builtin_altivec_vspltw ((vector signed int) ((a1)), (const char) ((a2)))), \ __ch (__bin_args_eq (vector signed int, ((a1)), int, ((a2))), \ ((vector signed int) __builtin_altivec_vspltw ((vector signed int) ((a1)), (const char) ((a2)))), \ +__ch (__bin_args_eq (vector signed int, ((a1)), unsigned int, ((a2))), \ + ((vector signed int) __builtin_altivec_vspltw ((vector signed int) ((a1)), (const char) ((a2)))), \ __ch (__bin_args_eq (vector unsigned int, ((a1)), int, ((a2))), \ ((vector unsigned int) __builtin_altivec_vspltw ((vector signed int) (a1), (const char) ((a2)))), \ - __altivec_link_error_invalid_argument ()))))))) +__ch (__bin_args_eq (vector unsigned int, ((a1)), unsigned int, ((a2))), \ + ((vector unsigned int) __builtin_altivec_vspltw ((vector signed int) (a1), (const char) ((a2)))), \ + __altivec_link_error_invalid_argument ())))))))))))))) #define vec_vspltw(a1, a2) \ __ch (__bin_args_eq (vector float, ((a1)), int, ((a2))), \ ((vector float) __builtin_altivec_vspltw ((vector signed int) ((a1)), (const char) ((a2)))), \ +__ch (__bin_args_eq (vector float, ((a1)), unsigned int, ((a2))), \ + ((vector float) __builtin_altivec_vspltw ((vector signed int) ((a1)), (const char) ((a2)))), \ __ch (__bin_args_eq (vector signed int, ((a1)), int, ((a2))), \ ((vector signed int) __builtin_altivec_vspltw ((vector signed int) ((a1)), (const char) ((a2)))), \ +__ch (__bin_args_eq (vector signed int, ((a1)), unsigned int, ((a2))), \ + ((vector signed int) __builtin_altivec_vspltw ((vector signed int) ((a1)), (const char) ((a2)))), \ __ch (__bin_args_eq (vector unsigned int, ((a1)), int, ((a2))), \ ((vector unsigned int) __builtin_altivec_vspltw ((vector signed int) (a1), (const char) ((a2)))), \ -__altivec_link_error_invalid_argument ()))) +__ch (__bin_args_eq (vector unsigned int, ((a1)), unsigned int, ((a2))), \ + ((vector unsigned int) __builtin_altivec_vspltw ((vector signed int) (a1), (const char) ((a2)))), \ +__altivec_link_error_invalid_argument ())))))) #define vec_vsplth(a1, a2) \ __ch (__bin_args_eq (vector signed short, ((a1)), int, ((a2))), \ ((vector signed short) __builtin_altivec_vsplth ((vector signed short) ((a1)), (const char) ((a2)))), \ +__ch (__bin_args_eq (vector signed short, ((a1)), unsigned int, ((a2))), \ + ((vector signed short) __builtin_altivec_vsplth ((vector signed short) ((a1)), (const char) ((a2)))), \ __ch (__bin_args_eq (vector unsigned short, ((a1)), int, ((a2))), \ ((vector unsigned short) __builtin_altivec_vsplth ((vector signed short) ((a1)), (const char) ((a2)))), \ -__altivec_link_error_invalid_argument ())) +__ch (__bin_args_eq (vector unsigned short, ((a1)), unsigned int, ((a2))), \ + ((vector unsigned short) __builtin_altivec_vsplth ((vector signed short) ((a1)), (const char) ((a2)))), \ +__altivec_link_error_invalid_argument ())))) #define vec_vspltb(a1, a2) \ __ch (__bin_args_eq (vector signed char, ((a1)), int, ((a2))), \ ((vector signed char) __builtin_altivec_vspltb ((vector signed char) ((a1)), (const char) ((a2)))), \ +__ch (__bin_args_eq (vector signed char, ((a1)), unsigned int, ((a2))), \ + ((vector signed char) __builtin_altivec_vspltb ((vector signed char) ((a1)), (const char) ((a2)))), \ __ch (__bin_args_eq (vector unsigned char, ((a1)), int, ((a2))), \ ((vector unsigned char) __builtin_altivec_vspltb ((vector signed char) ((a1)), (const char) ((a2)))), \ -__altivec_link_error_invalid_argument ())) +__ch (__bin_args_eq (vector unsigned char, ((a1)), unsigned int, ((a2))), \ + ((vector unsigned char) __builtin_altivec_vspltb ((vector signed char) ((a1)), (const char) ((a2)))), \ +__altivec_link_error_invalid_argument ())))) #define vec_splat_s8(a1) __builtin_altivec_vspltisb ((a1)) @@ -7277,7 +7954,10 @@ __ch (__bin_args_eq (vector unsigned char, (a1), vector unsigned char, (a2)), \ ((vector unsigned char) __builtin_altivec_vsububm ((vector signed char) (a1), (vector signed char) (a2))), \ __altivec_link_error_invalid_argument ())))) -#define vec_subc(a1, a2) ((vector unsigned int) __builtin_altivec_vsubcuw ((vector unsigned int) (a1), (vector unsigned int) (a2))) +#define vec_subc(a1, a2) \ +__ch (__bin_args_eq (vector unsigned int, (a1), vector unsigned int, (a2)), \ + ((vector unsigned int) __builtin_altivec_vsubcuw ((vector signed int) (a1), (vector signed int) (a2))), \ +__altivec_link_error_invalid_argument ()) #define vec_subs(a1, a2) \ __ch (__bin_args_eq (vector signed char, (a1), vector unsigned char, (a2)), \ @@ -7381,7 +8061,7 @@ __altivec_link_error_invalid_argument ()) #define vec_unpackh(a1) \ __ch (__un_args_eq (vector signed char, (a1)), \ ((vector signed short) __builtin_altivec_vupkhsb ((vector signed char) (a1))), \ -__ch (__un_args_eq (vector signed short, (a1)), \ +__ch (__un_args_eq (vector unsigned short, (a1)), \ ((vector unsigned int) __builtin_altivec_vupkhpx ((vector signed short) (a1))), \ __ch (__un_args_eq (vector signed short, (a1)), \ ((vector signed int) __builtin_altivec_vupkhsh ((vector signed short) (a1))), \ @@ -7393,7 +8073,7 @@ __ch (__un_args_eq (vector signed short, (a1)), \ __altivec_link_error_invalid_argument ()) #define vec_vupkhpx(a1) \ -__ch (__un_args_eq (vector signed short, (a1)), \ +__ch (__un_args_eq (vector unsigned short, (a1)), \ ((vector unsigned int) __builtin_altivec_vupkhpx ((vector signed short) (a1))), \ __altivec_link_error_invalid_argument ()) @@ -7405,7 +8085,7 @@ __altivec_link_error_invalid_argument ()) #define vec_unpackl(a1) \ __ch (__un_args_eq (vector signed char, (a1)), \ ((vector signed short) __builtin_altivec_vupklsb ((vector signed char) (a1))), \ -__ch (__un_args_eq (vector signed short, (a1)), \ +__ch (__un_args_eq (vector unsigned short, (a1)), \ ((vector unsigned int) __builtin_altivec_vupklpx ((vector signed short) (a1))), \ __ch (__un_args_eq (vector signed short, (a1)), \ ((vector signed int) __builtin_altivec_vupklsh ((vector signed short) (a1))), \ @@ -7417,7 +8097,7 @@ __ch (__un_args_eq (vector signed short, (a1)), \ __altivec_link_error_invalid_argument ()) #define vec_vupklpx(a1) \ -__ch (__un_args_eq (vector signed short, (a1)), \ +__ch (__un_args_eq (vector unsigned short, (a1)), \ ((vector unsigned int) __builtin_altivec_vupklpx ((vector signed short) (a1))), \ __altivec_link_error_invalid_argument ()) @@ -7433,10 +8113,12 @@ __ch (__bin_args_eq (vector float, ((a1)), vector unsigned int, ((a2))), \ ((vector float) __builtin_altivec_vxor ((vector signed int) ((a1)), (vector signed int) ((a2)))), \ __ch (__bin_args_eq (vector unsigned int, ((a1)), vector float, ((a2))), \ ((vector float) __builtin_altivec_vxor ((vector signed int) ((a1)), (vector signed int) ((a2)))), \ +__ch (__bin_args_eq (vector signed int, ((a1)), vector float, ((a2))), \ + ((vector float) __builtin_altivec_vxor ((vector signed int) ((a1)), (vector signed int) ((a2)))), \ +__ch (__bin_args_eq (vector float, ((a1)), vector signed int, ((a2))), \ + ((vector float) __builtin_altivec_vxor ((vector signed int) ((a1)), (vector signed int) ((a2)))), \ __ch (__bin_args_eq (vector signed int, ((a1)), vector signed int, ((a2))), \ ((vector signed int) __builtin_altivec_vxor ((vector signed int) ((a1)), (vector signed int) ((a2)))), \ -__ch (__bin_args_eq (vector unsigned int, ((a1)), vector unsigned int, ((a2))), \ - ((vector unsigned int) __builtin_altivec_vxor ((vector signed int) ((a1)), (vector signed int) ((a2)))), \ __ch (__bin_args_eq (vector signed int, ((a1)), vector unsigned int, ((a2))), \ ((vector unsigned int) __builtin_altivec_vxor ((vector signed int) ((a1)), (vector signed int) ((a2)))), \ __ch (__bin_args_eq (vector unsigned int, ((a1)), vector signed int, ((a2))), \ @@ -7446,9 +8128,9 @@ __ch (__bin_args_eq (vector unsigned int, ((a1)), vector unsigned int, ((a2))), __ch (__bin_args_eq (vector unsigned short, ((a1)), vector unsigned short, ((a2))), \ ((vector unsigned short) __builtin_altivec_vxor ((vector signed int) ((a1)), (vector signed int) ((a2)))), \ __ch (__bin_args_eq (vector signed short, ((a1)), vector unsigned short, ((a2))), \ - ((vector signed short) __builtin_altivec_vxor ((vector signed int) ((a1)), (vector signed int) ((a2)))), \ + ((vector unsigned short) __builtin_altivec_vxor ((vector signed int) ((a1)), (vector signed int) ((a2)))), \ __ch (__bin_args_eq (vector unsigned short, ((a1)), vector signed short, ((a2))), \ - ((vector signed short) __builtin_altivec_vxor ((vector signed int) ((a1)), (vector signed int) ((a2)))), \ + ((vector unsigned short) __builtin_altivec_vxor ((vector signed int) ((a1)), (vector signed int) ((a2)))), \ __ch (__bin_args_eq (vector unsigned short, ((a1)), vector unsigned short, ((a2))), \ ((vector signed short) __builtin_altivec_vxor ((vector signed int) ((a1)), (vector signed int) ((a2)))), \ __ch (__bin_args_eq (vector signed short, ((a1)), vector signed short, ((a2))), \ @@ -7470,8 +8152,8 @@ __ch (__bin_args_eq (vector unsigned char, ((a1)), vector unsigned char, ((a2))) __ch (__bin_args_eq (vector signed char, ((a1)), vector unsigned char, ((a2))), \ ((vector signed char) __builtin_altivec_vxor ((vector signed int) ((a1)), (vector signed int) ((a2)))), \ __ch (__bin_args_eq (vector unsigned char, ((a1)), vector signed char, ((a2))), \ - ((vector signed char) __builtin_altivec_vxor ((vector signed int) ((a1)), (vector signed int) ((a2)))), \ - __altivec_link_error_invalid_argument ())))))))))))))))))))))) + ((vector unsigned char) __builtin_altivec_vxor ((vector signed int) ((a1)), (vector signed int) ((a2)))), \ + __altivec_link_error_invalid_argument ()))))))))))))))))))))))) /* Predicates. */ @@ -7530,7 +8212,7 @@ __ch (__bin_args_eq (vector unsigned int, (a1), vector unsigned int, (a2)), \ __ch (__bin_args_eq (vector signed int, (a1), vector signed int, (a2)), \ __builtin_altivec_vcmpgtsw_p (__CR6_EQ, (vector signed int) (a2), (vector signed int) (a1)), \ __ch (__bin_args_eq (vector float, (a1), vector float, (a2)), \ - __builtin_altivec_vcmpgefp_p (__CR6_EQ, (vector float) (a1), (vector float) (a2)), \ + __builtin_altivec_vcmpgefp_p (__CR6_LT, (vector float) (a1), (vector float) (a2)), \ __altivec_link_error_invalid_argument ()))))))))))))) #define vec_all_gt(a1, a2) \ diff --git a/contrib/gcc/config/rs6000/linux64.h b/contrib/gcc/config/rs6000/linux64.h index 40b64dc..f84e1e3 100644 --- a/contrib/gcc/config/rs6000/linux64.h +++ b/contrib/gcc/config/rs6000/linux64.h @@ -308,3 +308,22 @@ do { \ || (GET_MODE_CLASS (GET_MODE (X)) == MODE_FLOAT \ && ! TARGET_NO_FP_IN_TOC))))) +/* This is the same as the dbxelf.h version, except that we need to + use the function code label, not the function descriptor. */ +#undef ASM_OUTPUT_SOURCE_LINE +#define ASM_OUTPUT_SOURCE_LINE(FILE, LINE) \ +do \ + { \ + static int sym_lineno = 1; \ + char temp[256]; \ + ASM_GENERATE_INTERNAL_LABEL (temp, "LM", sym_lineno); \ + fprintf (FILE, "\t.stabn 68,0,%d,", LINE); \ + assemble_name (FILE, temp); \ + fputs ("-.", FILE); \ + assemble_name (FILE, \ + XSTR (XEXP (DECL_RTL (current_function_decl), 0), 0));\ + putc ('\n', FILE); \ + ASM_OUTPUT_INTERNAL_LABEL (FILE, "LM", sym_lineno); \ + sym_lineno += 1; \ + } \ +while (0) diff --git a/contrib/gcc/config/rs6000/netbsd.h b/contrib/gcc/config/rs6000/netbsd.h index 95f6542..d41e576 100644 --- a/contrib/gcc/config/rs6000/netbsd.h +++ b/contrib/gcc/config/rs6000/netbsd.h @@ -60,11 +60,6 @@ Boston, MA 02111-1307, USA. */ #undef TARGET_VERSION #define TARGET_VERSION fprintf (stderr, " (PowerPC NetBSD/ELF)"); -/* For backward compatibility, we must continue to use the AIX - structure return convention. */ -#undef DRAFT_V4_STRUCT_RET -#define DRAFT_V4_STRUCT_RET 1 - /* Use STABS debugging information by default. DWARF2 makes a mess of the 1.5.2 linker. */ #undef PREFERRED_DEBUGGING_TYPE diff --git a/contrib/gcc/config/rs6000/rs6000.c b/contrib/gcc/config/rs6000/rs6000.c index 45d6fdf..92b1d64 100644 --- a/contrib/gcc/config/rs6000/rs6000.c +++ b/contrib/gcc/config/rs6000/rs6000.c @@ -9735,23 +9735,22 @@ output_mi_thunk (file, thunk_fndecl, delta, function) fprintf (file, "\taddi %s,%s,%d\n", this_reg, this_reg, delta); } + /* 64-bit constants. If "int" is 32 bits, we'll never hit this abort. */ + else if (TARGET_64BIT && (delta < -2147483647 - 1 || delta > 2147483647)) + abort (); + /* Large constants that can be done by one addis instruction. */ - else if ((delta & 0xffff) == 0 && num_insns_constant_wide (delta) == 1) + else if ((delta & 0xffff) == 0) asm_fprintf (file, "\t{cau|addis} %s,%s,%d\n", this_reg, this_reg, delta >> 16); /* 32-bit constants that can be done by an add and addis instruction. */ - else if (TARGET_32BIT || num_insns_constant_wide (delta) == 1) + else { /* Break into two pieces, propagating the sign bit from the low word to the upper word. */ - int delta_high = delta >> 16; - int delta_low = delta & 0xffff; - if ((delta_low & 0x8000) != 0) - { - delta_high++; - delta_low = (delta_low ^ 0x8000) - 0x8000; /* sign extend */ - } + int delta_low = ((delta & 0xffff) ^ 0x8000) - 0x8000; + int delta_high = (delta - delta_low) >> 16; asm_fprintf (file, "\t{cau|addis} %s,%s,%d\n", this_reg, this_reg, delta_high); @@ -9762,10 +9761,6 @@ output_mi_thunk (file, thunk_fndecl, delta, function) fprintf (file, "\taddi %s,%s,%d\n", this_reg, this_reg, delta_low); } - /* 64-bit constants, fixme */ - else - abort (); - /* Get the prefix in front of the names. */ switch (DEFAULT_ABI) { @@ -9821,7 +9816,10 @@ output_mi_thunk (file, thunk_fndecl, delta, function) } assemble_name (file, fname); putc ('\n', file); - text_section (); + if (TARGET_ELF) + function_section (current_function_decl); + else + text_section (); if (TARGET_MINIMAL_TOC) asm_fprintf (file, (TARGET_32BIT) ? "\t{l|lwz} %s,%s(%s)\n" : "\tld %s,%s(%s)\n", r12, @@ -10157,8 +10155,10 @@ output_toc (file, x, labelno, mode) if (TARGET_MINIMAL_TOC) fputs (DOUBLE_INT_ASM_OP, file); else - fprintf (file, "\t.tc FD_%lx_%lx[TC],", k[0], k[1]); - fprintf (file, "0x%lx%08lx\n", k[0], k[1]); + fprintf (file, "\t.tc FD_%lx_%lx[TC],", + k[0] & 0xffffffff, k[1] & 0xffffffff); + fprintf (file, "0x%lx%08lx\n", + k[0] & 0xffffffff, k[1] & 0xffffffff); return; } else @@ -10166,8 +10166,10 @@ output_toc (file, x, labelno, mode) if (TARGET_MINIMAL_TOC) fputs ("\t.long ", file); else - fprintf (file, "\t.tc FD_%lx_%lx[TC],", k[0], k[1]); - fprintf (file, "0x%lx,0x%lx\n", k[0], k[1]); + fprintf (file, "\t.tc FD_%lx_%lx[TC],", + k[0] & 0xffffffff, k[1] & 0xffffffff); + fprintf (file, "0x%lx,0x%lx\n", + k[0] & 0xffffffff, k[1] & 0xffffffff); return; } } @@ -10184,8 +10186,8 @@ output_toc (file, x, labelno, mode) if (TARGET_MINIMAL_TOC) fputs (DOUBLE_INT_ASM_OP, file); else - fprintf (file, "\t.tc FS_%lx[TC],", l); - fprintf (file, "0x%lx00000000\n", l); + fprintf (file, "\t.tc FS_%lx[TC],", l & 0xffffffff); + fprintf (file, "0x%lx00000000\n", l & 0xffffffff); return; } else @@ -10193,8 +10195,8 @@ output_toc (file, x, labelno, mode) if (TARGET_MINIMAL_TOC) fputs ("\t.long ", file); else - fprintf (file, "\t.tc FS_%lx[TC],", l); - fprintf (file, "0x%lx\n", l); + fprintf (file, "\t.tc FS_%lx[TC],", l & 0xffffffff); + fprintf (file, "0x%lx\n", l & 0xffffffff); return; } } @@ -10244,8 +10246,10 @@ output_toc (file, x, labelno, mode) if (TARGET_MINIMAL_TOC) fputs (DOUBLE_INT_ASM_OP, file); else - fprintf (file, "\t.tc ID_%lx_%lx[TC],", (long) high, (long) low); - fprintf (file, "0x%lx%08lx\n", (long) high, (long) low); + fprintf (file, "\t.tc ID_%lx_%lx[TC],", + (long) high & 0xffffffff, (long) low & 0xffffffff); + fprintf (file, "0x%lx%08lx\n", + (long) high & 0xffffffff, (long) low & 0xffffffff); return; } else @@ -10256,16 +10260,17 @@ output_toc (file, x, labelno, mode) fputs ("\t.long ", file); else fprintf (file, "\t.tc ID_%lx_%lx[TC],", - (long) high, (long) low); - fprintf (file, "0x%lx,0x%lx\n", (long) high, (long) low); + (long) high & 0xffffffff, (long) low & 0xffffffff); + fprintf (file, "0x%lx,0x%lx\n", + (long) high & 0xffffffff, (long) low & 0xffffffff); } else { if (TARGET_MINIMAL_TOC) fputs ("\t.long ", file); else - fprintf (file, "\t.tc IS_%lx[TC],", (long) low); - fprintf (file, "0x%lx\n", (long) low); + fprintf (file, "\t.tc IS_%lx[TC],", (long) low & 0xffffffff); + fprintf (file, "0x%lx\n", (long) low & 0xffffffff); } return; } @@ -10879,18 +10884,19 @@ rs6000_select_section (decl, reloc) if (TREE_CODE (decl) == STRING_CST) readonly = ! flag_writable_strings; else if (TREE_CODE (decl) == VAR_DECL) - readonly = (! (flag_pic && reloc) + readonly = (! ((flag_pic || DEFAULT_ABI == ABI_AIX) && reloc) && TREE_READONLY (decl) && ! TREE_SIDE_EFFECTS (decl) && DECL_INITIAL (decl) && DECL_INITIAL (decl) != error_mark_node && TREE_CONSTANT (DECL_INITIAL (decl))); else if (TREE_CODE (decl) == CONSTRUCTOR) - readonly = (! (flag_pic && reloc) + readonly = (! ((flag_pic || DEFAULT_ABI == ABI_AIX) && reloc) && ! TREE_SIDE_EFFECTS (decl) && TREE_CONSTANT (decl)); else - readonly = 1; + readonly = ! ((flag_pic || DEFAULT_ABI == ABI_AIX) && reloc); + if (needs_sdata && rs6000_sdata != SDATA_EABI) readonly = 0; @@ -10935,14 +10941,15 @@ rs6000_unique_section (decl, reloc) int needs_sdata; int size; - readonly = 1; if (TREE_CODE (decl) == STRING_CST) readonly = ! flag_writable_strings; else if (TREE_CODE (decl) == VAR_DECL) - readonly = (! (flag_pic && reloc) + readonly = (! ((flag_pic || DEFAULT_ABI == ABI_AIX) && reloc) && TREE_READONLY (decl) && ! TREE_SIDE_EFFECTS (decl) && TREE_CONSTANT (DECL_INITIAL (decl))); + else + readonly = ! ((flag_pic || DEFAULT_ABI == ABI_AIX) && reloc); size = int_size_in_bytes (TREE_TYPE (decl)); needs_sdata = (size > 0 diff --git a/contrib/gcc/config/rs6000/rs6000.h b/contrib/gcc/config/rs6000/rs6000.h index 3e4c5f2..8c77dd5 100644 --- a/contrib/gcc/config/rs6000/rs6000.h +++ b/contrib/gcc/config/rs6000/rs6000.h @@ -105,8 +105,8 @@ Boston, MA 02111-1307, USA. */ %{mcpu=rsc: -mpwr} \ %{mcpu=rsc1: -mpwr} \ %{mcpu=401: -mppc} \ -%{mcpu=403: -mppc} \ -%{mcpu=405: -mppc} \ +%{mcpu=403: -m403} \ +%{mcpu=405: -m405} \ %{mcpu=505: -mppc} \ %{mcpu=601: -m601} \ %{mcpu=602: -mppc} \ @@ -2439,12 +2439,14 @@ extern int toc_initialized; do \ { \ fputs ("\t.weak\t", (FILE)); \ - assemble_name ((FILE), (NAME)); \ + RS6000_OUTPUT_BASENAME ((FILE), (NAME)); \ if ((DECL) && TREE_CODE (DECL) == FUNCTION_DECL \ && DEFAULT_ABI == ABI_AIX) \ { \ + if (TARGET_XCOFF) \ + fputs ("[DS]", (FILE)); \ fputs ("\n\t.weak\t.", (FILE)); \ - assemble_name ((FILE), (NAME)); \ + RS6000_OUTPUT_BASENAME ((FILE), (NAME)); \ } \ fputc ('\n', (FILE)); \ if (VAL) \ @@ -2454,9 +2456,9 @@ extern int toc_initialized; && DEFAULT_ABI == ABI_AIX) \ { \ fputs ("\t.set\t.", (FILE)); \ - assemble_name ((FILE), (NAME)); \ + RS6000_OUTPUT_BASENAME ((FILE), (NAME)); \ fputs (",.", (FILE)); \ - assemble_name ((FILE), (VAL)); \ + RS6000_OUTPUT_BASENAME ((FILE), (VAL)); \ fputc ('\n', (FILE)); \ } \ } \ @@ -2479,20 +2481,20 @@ extern int toc_initialized; if (!RS6000_WEAK || !DECL_WEAK (DECL)) \ { \ fputs ("\t.globl\t.", FILE); \ - assemble_name (FILE, alias); \ + RS6000_OUTPUT_BASENAME (FILE, alias); \ putc ('\n', FILE); \ } \ } \ else if (TARGET_XCOFF) \ { \ fputs ("\t.lglobl\t.", FILE); \ - assemble_name (FILE, alias); \ + RS6000_OUTPUT_BASENAME (FILE, alias); \ putc ('\n', FILE); \ } \ fputs ("\t.set\t.", FILE); \ - assemble_name (FILE, alias); \ + RS6000_OUTPUT_BASENAME (FILE, alias); \ fputs (",.", FILE); \ - assemble_name (FILE, name); \ + RS6000_OUTPUT_BASENAME (FILE, name); \ fputc ('\n', FILE); \ } \ ASM_OUTPUT_DEF (FILE, alias, name); \ diff --git a/contrib/gcc/config/rs6000/rs6000.md b/contrib/gcc/config/rs6000/rs6000.md index 93c6fc3..5188ce5 100644 --- a/contrib/gcc/config/rs6000/rs6000.md +++ b/contrib/gcc/config/rs6000/rs6000.md @@ -5271,9 +5271,18 @@ (clobber (match_dup 4)) (clobber (match_dup 5)) (clobber (match_dup 6))])] - "! TARGET_POWERPC64 && TARGET_HARD_FLOAT" + "TARGET_HARD_FLOAT" " { + if (TARGET_POWERPC64) + { + rtx mem = assign_stack_temp (DImode, GET_MODE_SIZE (DImode), 0); + rtx t1 = gen_reg_rtx (DImode); + rtx t2 = gen_reg_rtx (DImode); + emit_insn (gen_floatsidf_ppc64 (operands[0], operands[1], mem, t1, t2)); + DONE; + } + operands[2] = force_reg (SImode, GEN_INT (0x43300000)); operands[3] = force_reg (DFmode, rs6000_float_const (\"4503601774854144\", DFmode)); operands[4] = assign_stack_temp (DFmode, GET_MODE_SIZE (DFmode), 0); @@ -5338,9 +5347,19 @@ (use (match_dup 3)) (clobber (match_dup 4)) (clobber (match_dup 5))])] - "! TARGET_POWERPC64 && TARGET_HARD_FLOAT" + "TARGET_HARD_FLOAT" " { + if (TARGET_POWERPC64) + { + rtx mem = assign_stack_temp (DImode, GET_MODE_SIZE (DImode), 0); + rtx t1 = gen_reg_rtx (DImode); + rtx t2 = gen_reg_rtx (DImode); + emit_insn (gen_floatunssidf_ppc64 (operands[0], operands[1], mem, + t1, t2)); + DONE; + } + operands[2] = force_reg (SImode, GEN_INT (0x43300000)); operands[3] = force_reg (DFmode, rs6000_float_const (\"4503599627370496\", DFmode)); operands[4] = assign_stack_temp (DFmode, GET_MODE_SIZE (DFmode), 0); @@ -5407,7 +5426,7 @@ (define_insn "*fix_truncdfsi2_internal" [(set (match_operand:SI 0 "gpc_reg_operand" "=r") (fix:SI (match_operand:DF 1 "gpc_reg_operand" "f"))) - (clobber (match_operand:DI 2 "gpc_reg_operand" "=f")) + (clobber (match_operand:DI 2 "gpc_reg_operand" "=*f")) (clobber (match_operand:DI 3 "memory_operand" "=o"))] "(TARGET_POWER2 || TARGET_POWERPC) && TARGET_HARD_FLOAT" "#" @@ -5443,7 +5462,7 @@ ; because the first makes it clear that operand 0 is not live ; before the instruction. (define_insn "fctiwz" - [(set (match_operand:DI 0 "gpc_reg_operand" "=f") + [(set (match_operand:DI 0 "gpc_reg_operand" "=*f") (unspec:DI [(fix:SI (match_operand:DF 1 "gpc_reg_operand" "f"))] 10))] "(TARGET_POWER2 || TARGET_POWERPC) && TARGET_HARD_FLOAT" "{fcirz|fctiwz} %0,%1" @@ -5451,13 +5470,43 @@ (define_insn "floatdidf2" [(set (match_operand:DF 0 "gpc_reg_operand" "=f") - (float:DF (match_operand:DI 1 "gpc_reg_operand" "f")))] + (float:DF (match_operand:DI 1 "gpc_reg_operand" "*f")))] "TARGET_POWERPC64 && TARGET_HARD_FLOAT" "fcfid %0,%1" [(set_attr "type" "fp")]) +(define_insn_and_split "floatsidf_ppc64" + [(set (match_operand:DF 0 "gpc_reg_operand" "=f") + (float:DF (match_operand:SI 1 "gpc_reg_operand" "r"))) + (clobber (match_operand:DI 2 "memory_operand" "=o")) + (clobber (match_operand:DI 3 "gpc_reg_operand" "=r")) + (clobber (match_operand:DI 4 "gpc_reg_operand" "=f"))] + "TARGET_POWERPC64 && TARGET_HARD_FLOAT" + "#" + "" + [(set (match_dup 3) (sign_extend:DI (match_dup 1))) + (set (match_dup 2) (match_dup 3)) + (set (match_dup 4) (match_dup 2)) + (set (match_dup 0) (float:DF (match_dup 4)))] + "") + +(define_insn_and_split "floatunssidf_ppc64" + [(set (match_operand:DF 0 "gpc_reg_operand" "=f") + (unsigned_float:DF (match_operand:SI 1 "gpc_reg_operand" "r"))) + (clobber (match_operand:DI 2 "memory_operand" "=o")) + (clobber (match_operand:DI 3 "gpc_reg_operand" "=r")) + (clobber (match_operand:DI 4 "gpc_reg_operand" "=f"))] + "TARGET_POWERPC64 && TARGET_HARD_FLOAT" + "#" + "" + [(set (match_dup 3) (zero_extend:DI (match_dup 1))) + (set (match_dup 2) (match_dup 3)) + (set (match_dup 4) (match_dup 2)) + (set (match_dup 0) (float:DF (match_dup 4)))] + "") + (define_insn "fix_truncdfdi2" - [(set (match_operand:DI 0 "gpc_reg_operand" "=f") + [(set (match_operand:DI 0 "gpc_reg_operand" "=*f") (fix:DI (match_operand:DF 1 "gpc_reg_operand" "f")))] "TARGET_POWERPC64 && TARGET_HARD_FLOAT" "fctidz %0,%1" @@ -13255,15 +13304,15 @@ (define_insn "*ctrdi_internal1" [(set (pc) - (if_then_else (ne (match_operand:DI 1 "register_operand" "c,*r,*r,!*f") + (if_then_else (ne (match_operand:DI 1 "register_operand" "c,*r,*r") (const_int 1)) (label_ref (match_operand 0 "" "")) (pc))) - (set (match_operand:DI 2 "register_operand" "=1,*r,m*c*l,!*f") + (set (match_operand:DI 2 "register_operand" "=1,*r,m*c*l") (plus:DI (match_dup 1) (const_int -1))) - (clobber (match_scratch:CC 3 "=X,&x,&x,&x")) - (clobber (match_scratch:DI 4 "=X,X,r,r"))] + (clobber (match_scratch:CC 3 "=X,&x,&x")) + (clobber (match_scratch:DI 4 "=X,X,r"))] "TARGET_POWERPC64" "* { @@ -13275,19 +13324,19 @@ return \"bdz $+8\;b %l0\"; }" [(set_attr "type" "branch") - (set_attr "length" "*,12,16,24")]) + (set_attr "length" "*,12,16")]) (define_insn "*ctrdi_internal2" [(set (pc) - (if_then_else (ne (match_operand:DI 1 "register_operand" "c,*r,*r,!*f") + (if_then_else (ne (match_operand:DI 1 "register_operand" "c,*r,*r") (const_int 1)) (pc) (label_ref (match_operand 0 "" "")))) - (set (match_operand:DI 2 "register_operand" "=1,*r,m*c*l,!*f") + (set (match_operand:DI 2 "register_operand" "=1,*r,m*c*l") (plus:DI (match_dup 1) (const_int -1))) - (clobber (match_scratch:CC 3 "=X,&x,&x,&x")) - (clobber (match_scratch:DI 4 "=X,X,r,r"))] + (clobber (match_scratch:CC 3 "=X,&x,&x")) + (clobber (match_scratch:DI 4 "=X,X,r"))] "TARGET_POWERPC64" "* { @@ -13299,7 +13348,7 @@ return \"{bdn|bdnz} $+8\;b %l0\"; }" [(set_attr "type" "branch") - (set_attr "length" "*,12,16,24")]) + (set_attr "length" "*,12,16")]) ;; Similar, but we can use GE since we have a REG_NONNEG. @@ -13353,15 +13402,15 @@ (define_insn "*ctrdi_internal3" [(set (pc) - (if_then_else (ge (match_operand:DI 1 "register_operand" "c,*r,*r,!*f") + (if_then_else (ge (match_operand:DI 1 "register_operand" "c,*r,*r") (const_int 0)) (label_ref (match_operand 0 "" "")) (pc))) - (set (match_operand:DI 2 "register_operand" "=1,*r,m*c*l,!*f") + (set (match_operand:DI 2 "register_operand" "=1,*r,m*c*l") (plus:DI (match_dup 1) (const_int -1))) - (clobber (match_scratch:CC 3 "=X,&x,&x,&x")) - (clobber (match_scratch:DI 4 "=X,X,r,r"))] + (clobber (match_scratch:CC 3 "=X,&x,&x")) + (clobber (match_scratch:DI 4 "=X,X,r"))] "TARGET_POWERPC64 && find_reg_note (insn, REG_NONNEG, 0)" "* { @@ -13373,19 +13422,19 @@ return \"bdz $+8\;b %l0\"; }" [(set_attr "type" "branch") - (set_attr "length" "*,12,16,24")]) + (set_attr "length" "*,12,16")]) (define_insn "*ctrdi_internal4" [(set (pc) - (if_then_else (ge (match_operand:DI 1 "register_operand" "c,*r,*r,!*f") + (if_then_else (ge (match_operand:DI 1 "register_operand" "c,*r,*r") (const_int 0)) (pc) (label_ref (match_operand 0 "" "")))) - (set (match_operand:DI 2 "register_operand" "=1,*r,m*c*l,!*f") + (set (match_operand:DI 2 "register_operand" "=1,*r,m*c*l") (plus:DI (match_dup 1) (const_int -1))) - (clobber (match_scratch:CC 3 "=X,&x,&x,&x")) - (clobber (match_scratch:DI 4 "=X,X,r,r"))] + (clobber (match_scratch:CC 3 "=X,&x,&x")) + (clobber (match_scratch:DI 4 "=X,X,r"))] "TARGET_POWERPC64 && find_reg_note (insn, REG_NONNEG, 0)" "* { @@ -13397,7 +13446,7 @@ return \"{bdn|bdnz} $+8\;b %l0\"; }" [(set_attr "type" "branch") - (set_attr "length" "*,12,16,24")]) + (set_attr "length" "*,12,16")]) ;; Similar but use EQ @@ -13451,15 +13500,15 @@ (define_insn "*ctrdi_internal5" [(set (pc) - (if_then_else (eq (match_operand:DI 1 "register_operand" "c,*r,*r,!*f") + (if_then_else (eq (match_operand:DI 1 "register_operand" "c,*r,*r") (const_int 1)) (label_ref (match_operand 0 "" "")) (pc))) - (set (match_operand:DI 2 "register_operand" "=1,*r,m*c*l,!*f") + (set (match_operand:DI 2 "register_operand" "=1,*r,m*c*l") (plus:DI (match_dup 1) (const_int -1))) - (clobber (match_scratch:CC 3 "=X,&x,&x,&x")) - (clobber (match_scratch:DI 4 "=X,X,r,r"))] + (clobber (match_scratch:CC 3 "=X,&x,&x")) + (clobber (match_scratch:DI 4 "=X,X,r"))] "TARGET_POWERPC64" "* { @@ -13471,19 +13520,19 @@ return \"{bdn|bdnz} $+8\;b %l0\"; }" [(set_attr "type" "branch") - (set_attr "length" "*,12,16,24")]) + (set_attr "length" "*,12,16")]) (define_insn "*ctrdi_internal6" [(set (pc) - (if_then_else (eq (match_operand:DI 1 "register_operand" "c,*r,*r,!*f") + (if_then_else (eq (match_operand:DI 1 "register_operand" "c,*r,*r") (const_int 1)) (pc) (label_ref (match_operand 0 "" "")))) - (set (match_operand:DI 2 "register_operand" "=1,*r,m*c*l,!*f") + (set (match_operand:DI 2 "register_operand" "=1,*r,m*c*l") (plus:DI (match_dup 1) (const_int -1))) - (clobber (match_scratch:CC 3 "=X,&x,&x,&x")) - (clobber (match_scratch:DI 4 "=X,X,r,r"))] + (clobber (match_scratch:CC 3 "=X,&x,&x")) + (clobber (match_scratch:DI 4 "=X,X,r"))] "TARGET_POWERPC64" "* { @@ -13495,7 +13544,7 @@ return \"bdz $+8\;b %l0\"; }" [(set_attr "type" "branch") - (set_attr "length" "*,12,16,24")]) + (set_attr "length" "*,12,16")]) ;; Now the splitters if we could not allocate the CTR register @@ -13566,7 +13615,7 @@ (const_int -1))) (clobber (match_scratch:CC 3 "")) (clobber (match_scratch:DI 4 ""))] - "TARGET_POWERPC64 && reload_completed && INT_REGNO_P (REGNO (operands[0]))" + "TARGET_POWERPC64 && reload_completed" [(parallel [(set (match_dup 3) (compare:CC (plus:DI (match_dup 1) (const_int -1)) @@ -13610,44 +13659,6 @@ { operands[7] = gen_rtx (GET_CODE (operands[2]), VOIDmode, operands[3], const0_rtx); }") -(define_split - [(set (pc) - (if_then_else (match_operator 2 "comparison_operator" - [(match_operand:DI 1 "gpc_reg_operand" "") - (const_int 1)]) - (match_operand 5 "" "") - (match_operand 6 "" ""))) - (set (match_operand:DI 0 "gpc_reg_operand" "") - (plus:DI (match_dup 1) - (const_int -1))) - (clobber (match_scratch:CC 3 "")) - (clobber (match_scratch:DI 4 ""))] - "TARGET_POWERPC64 && reload_completed && FP_REGNO_P (REGNO (operands[0]))" - [(set (match_dup 8) - (match_dup 1)) - (set (match_dup 4) - (match_dup 8)) - (parallel [(set (match_dup 3) - (compare:CC (plus:DI (match_dup 4) - (const_int -1)) - (const_int 0))) - (set (match_dup 4) - (plus:DI (match_dup 4) - (const_int -1)))]) - (set (match_dup 8) - (match_dup 4)) - (set (match_dup 0) - (match_dup 8)) - (set (pc) (if_then_else (match_dup 7) - (match_dup 5) - (match_dup 6)))] - " -{ - operands[7] = gen_rtx (GET_CODE (operands[2]), VOIDmode, operands[3], - const0_rtx); - operands[8] = assign_stack_temp (DImode, GET_MODE_SIZE (DImode), 0); -}") - (define_insn "trap" [(trap_if (const_int 1) (const_int 0))] diff --git a/contrib/gcc/config/rs6000/sysv4.h b/contrib/gcc/config/rs6000/sysv4.h index b807bb7..9274d8f 100644 --- a/contrib/gcc/config/rs6000/sysv4.h +++ b/contrib/gcc/config/rs6000/sysv4.h @@ -403,7 +403,6 @@ do { \ : MAX (COMPUTED, SPECIFIED)) #undef BIGGEST_FIELD_ALIGNMENT -#undef ADJUST_FIELD_ALIGN /* Use ELF style section commands. */ diff --git a/contrib/gcc/config/rs6000/xcoff.h b/contrib/gcc/config/rs6000/xcoff.h index 4a51b04..a61061a 100644 --- a/contrib/gcc/config/rs6000/xcoff.h +++ b/contrib/gcc/config/rs6000/xcoff.h @@ -457,6 +457,15 @@ toc_section () \ /* This is how we tell the assembler that two symbols have the same value. */ #define SET_ASM_OP "\t.set " +/* This is how we tell the assembler to equate two values. */ +#define ASM_OUTPUT_DEF(FILE,LABEL1,LABEL2) \ + do { fprintf ((FILE), "%s", SET_ASM_OP); \ + RS6000_OUTPUT_BASENAME (FILE, LABEL1); \ + fprintf (FILE, ","); \ + RS6000_OUTPUT_BASENAME (FILE, LABEL2); \ + fprintf (FILE, "\n"); \ + } while (0) + /* Used by rs6000_assemble_integer, among others. */ #define DOUBLE_INT_ASM_OP "\t.llong\t" |