This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


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