This is the mail archive of the
newlib@sourceware.org
mailing list for the newlib project.
Re: [PATCH] make spu-elf target build with gcc-fsf
- From: Kazunori Asayama <asayama at sm dot sony dot co dot jp>
- To: lu_zero at gentoo dot org
- Cc: newlib at sourceware dot org
- Date: Wed, 29 Nov 2006 16:59:59 +0900 (LMT)
- Subject: Re: [PATCH] make spu-elf target build with gcc-fsf
- References: <4562F2F9.9000708@gentoo.org>
Luca Barbato <lu_zero@gentoo.org> wrote:
> Issues addressed:
>
> - size_t has no implicit cast to an allowed tipe for spu
>
> - apple-cast is forbidden
>
> - vector is defined in spu_intrinsics.h
This your patch causes another build broken with the BSC version of
spu-gcc. Attached is a patch to fix the problem.
2006-11-29 Kazunori Asayama <asayama@sm.sony.co.jp>
* libc/machine/spu/memset.c: Fix type of explicit cast.
* libc/machine/spu/strncmp.c: Add explicit cast.
* libc/machine/spu/strrchr.c: Ditto.
* libc/machine/spu/strspn.c: Ditto.
----
Index: newlib/newlib/libc/machine/spu/memset.c
===================================================================
--- newlib.orig/newlib/libc/machine/spu/memset.c
+++ newlib/newlib/libc/machine/spu/memset.c
@@ -40,7 +40,7 @@ void * memset(void *s, int c, size_t n)
{
int skip, cnt, i;
vec_uchar16 *vs;
- vec_uchar16 vc, mask, one = spu_splats((unsigned int)-1);
+ vec_uchar16 vc, mask, one = spu_splats((unsigned char)-1);
vs = (vec_uchar16 *)(s);
vc = spu_splats((unsigned char)c);
Index: newlib/newlib/libc/machine/spu/strncmp.c
===================================================================
--- newlib.orig/newlib/libc/machine/spu/strncmp.c
+++ newlib/newlib/libc/machine/spu/strncmp.c
@@ -50,7 +50,7 @@ int strncmp(const char *s1, const char *
vec_uchar16 data1A, data1B, data1, data2A, data2B, data2;
vec_uchar16 *ptr1, *ptr2;
- data1 = data2 = spu_splats(0);
+ data1 = data2 = spu_splats((unsigned char)0);
ptr1 = (vec_uchar16 *)s1;
ptr2 = (vec_uchar16 *)s2;
Index: newlib/newlib/libc/machine/spu/strrchr.c
===================================================================
--- newlib.orig/newlib/libc/machine/spu/strrchr.c
+++ newlib/newlib/libc/machine/spu/strrchr.c
@@ -62,8 +62,8 @@ char * strrchr(const char *s, int c)
cmp_c = spu_and(spu_gather(spu_cmpeq(data, vc)), mask);
cmp_0 = spu_and(spu_gather(spu_cmpeq(data, 0)), mask);
- res_ptr = spu_splats(0);
- res_cmp = spu_splats(0);
+ res_ptr = spu_splats(0U);
+ res_cmp = spu_splats(0U);
while (spu_extract(cmp_0, 0) == 0) {
cmp = spu_cmpeq(cmp_c, 0);
Index: newlib/newlib/libc/machine/spu/strspn.c
===================================================================
--- newlib.orig/newlib/libc/machine/spu/strspn.c
+++ newlib/newlib/libc/machine/spu/strspn.c
@@ -63,7 +63,7 @@ size_t strspn(const char *s1, const char
do {
data1 = spu_shuffle(dataA, dataB, shuffle);
- match = spu_splats(0);
+ match = spu_splats((unsigned char)0);
ptr2 = (vec_uchar16 *)s2;
data2 = *ptr2;