This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Fix gcc.target/powerpc/altivec-consts.c
- From: Alan Modra <amodra at bigpond dot net dot au>
- To: gcc-patches at gcc dot gnu dot org
- Date: Wed, 23 Nov 2005 12:57:05 +1030
- Subject: Fix gcc.target/powerpc/altivec-consts.c
Applying as obvious. If we use "char val" then val >> 7 might use an
unsigned shift.
* gcc.target/powerpc/altivec-consts.c (vspltisb): Use int val.
(vspltish, vspltisw): Likewise.
Index: gcc/testsuite/gcc.target/powerpc/altivec-consts.c
===================================================================
--- gcc/testsuite/gcc.target/powerpc/altivec-consts.c (revision 107379)
+++ gcc/testsuite/gcc.target/powerpc/altivec-consts.c (working copy)
@@ -17,21 +17,21 @@ char w[16] __attribute__((aligned(16)));
/* Emulate the vspltis? instructions on a 16-byte array of chars. */
-void vspltisb (char *v, char val)
+void vspltisb (char *v, int val)
{
int i;
for (i = 0; i < 16; i++)
v[i] = val;
}
-void vspltish (char *v, char val)
+void vspltish (char *v, int val)
{
int i;
for (i = 0; i < 16; i += 2)
v[i] = val >> 7, v[i + 1] = val;
}
-void vspltisw (char *v, char val)
+void vspltisw (char *v, int val)
{
int i;
for (i = 0; i < 16; i += 4)
--
Alan Modra
IBM OzLabs - Linux Technology Centre