On 10/08/09 03:41, Alessandro Rubini wrote:
> For memcpy all is well, for memset I have this problem:
> if (sizeof(long) > 4)
> cl |= cl << 32;
> string.c:416: warning: left shift count >= width of type
>
> (obviously there is no such shift in the generated co
Dear Joakim Tjernlund,
In message
you
wrote:
>
> So my question is: Did you check all gcc versions and
> arches?
Of course not :-)
Best regards,
Wolfgang Denk
--
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenze
Wolfgang Denk wrote on 08/10/2009 14:49:15:
>
> Dear Joakim Tjernlund,
>
> In message 0031e...@transmode.se> you wrote:
> >
> > > How about:
> > >
> > > cl = 0;
> > > for (i=0; i > > cl <<= 8;
> > > cl |= c & 0xff;
> > > }
> > >
> > > GCC optimization will do t
Dear Joakim Tjernlund,
In message
you
wrote:
>
> > How about:
> >
> > cl = 0;
> > for (i=0; i > cl <<= 8;
> > cl |= c & 0xff;
> > }
> >
> > GCC optimization will do the rest...
>
> If you want gcc to optimise well, make it easy to do so.
> Changing the for l
>
> Dear Alessandro Rubini,
>
> In message <20091008074114.ga30...@mail.gnudd.com> you wrote:
> >
> > Since int is 32 also on 64bit systems, I used unsigned long.
>
> Note that this is not guaranteed, though. It could be 64 bit as well.
>
>
> >/* do it one word at a time (32 bits or 64 bits
Dear Alessandro Rubini,
In message <20091008074114.ga30...@mail.gnudd.com> you wrote:
>
> Since int is 32 also on 64bit systems, I used unsigned long.
Note that this is not guaranteed, though. It could be 64 bit as well.
> /* do it one word at a time (32 bits or 64 bits) if possible */
>
I was making my v2, and I found a problem wrt:
> while 64bit isnt in today, might as well avoid unclean code from the start
> when possible. in other words, used "unsigned int" rather than "u32" and cast
> to "unsigned long" rather than "int".
Since int is 32 also on 64bit systems, I used unsign
On Thursday 08 October 2009 01:23:05 Chris Moore wrote:
> Alessandro Rubini a écrit :
> > --- a/lib_generic/string.c
> > +++ b/lib_generic/string.c
> > @@ -449,7 +449,16 @@ char * bcopy(const char * src, char * dest, int
> > count) void * memcpy(void * dest,const void *src,size_t count)
> > {
> >
Alessandro Rubini a écrit :
> From: Alessandro Rubini
>
> Signed-off-by: Alessandro Rubini
> Acked-by: Andrea Gallo
> ---
> lib_generic/string.c | 11 ++-
> 1 files changed, 10 insertions(+), 1 deletions(-)
>
> diff --git a/lib_generic/string.c b/lib_generic/string.c
> index 181eda6..
On Wednesday 07 October 2009 10:35:19 Peter Tyser wrote:
> > --- a/lib_generic/string.c
> > +++ b/lib_generic/string.c
> > @@ -449,7 +449,16 @@ char * bcopy(const char * src, char * dest, int
> > count) void * memcpy(void * dest,const void *src,size_t count)
> > {
> > char *tmp = (char *) dest
Hi Alessandro,
> --- a/lib_generic/string.c
> +++ b/lib_generic/string.c
> @@ -449,7 +449,16 @@ char * bcopy(const char * src, char * dest, int count)
> void * memcpy(void * dest,const void *src,size_t count)
> {
> char *tmp = (char *) dest, *s = (char *) src;
> + u32 *d32 = (u32 *)des
Dear Mike Frysinger,
In message <200910070452.02225.vap...@gentoo.org> you wrote:
>
> > --- a/lib_generic/string.c
> > +++ b/lib_generic/string.c
> > @@ -449,7 +449,16 @@ char * bcopy(const char * src, char * dest, int count)
> > void * memcpy(void * dest,const void *src,size_t count)
> > {
> >
> while 64bit isnt in today, might as well avoid unclean code from the
> start when possible. in other words, used "unsigned int" rather
> than "u32" and cast to "unsigned long" rather than "int".
You are right. Will do.
>> +count /= 4;
> count >>= 2 ? although gcc probably optimi
On Wednesday 07 October 2009 04:44:26 Alessandro Rubini wrote:
> --- a/lib_generic/string.c
> +++ b/lib_generic/string.c
> @@ -449,7 +449,16 @@ char * bcopy(const char * src, char * dest, int count)
> void * memcpy(void * dest,const void *src,size_t count)
> {
> char *tmp = (char *) dest, *
From: Alessandro Rubini
Signed-off-by: Alessandro Rubini
Acked-by: Andrea Gallo
---
lib_generic/string.c | 11 ++-
1 files changed, 10 insertions(+), 1 deletions(-)
diff --git a/lib_generic/string.c b/lib_generic/string.c
index 181eda6..fdccab6 100644
--- a/lib_generic/string.c
+++
15 matches
Mail list logo