lkml.org 
[lkml]   [2009]   [Apr]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [PATCH] X86-32: Let gcc decide whether to inline memcpy was Re: New x86 warning
    > > It's a very attractive patch because it removes a lot of code:
    >
    > I think this patch is great. Perhaps this would be a good time to also
    > clean out memset for x86_32? (If needed, I can start a new email

    Yes looks reasonable. You can add

    Reviewed-by: Andi Kleen <ak@linux.intel.com>

    if you fix the comment below.

    In fact it should be synced to do the same as on 64bit which already
    does all that and was originally written for gcc 3.1/3.2 ...

    -Andi
    > +void *__memset(void *s, char c, size_t count)
    > +{
    > + int d0, d1;
    > + asm volatile("rep\n\t"
    > + "stosb"
    > + : "=&c" (d0), "=&D" (d1)
    > + : "a" (c), "1" (s), "0" (count)
    > + : "memory");
    > + return s;
    > +}
    > +EXPORT_SYMBOL(__memset);

    I suspect _memset is not needed anymore, just memset() alone
    should be enough. So remove the wrapper below.

    > +
    > void *memset(void *s, int c, size_t count)
    > {
    > return __memset(s, c, count);
    > --
    > 1.6.2
    >

    --
    ak@linux.intel.com -- Speaking for myself only.


    \
     
     \ /
      Last update: 2009-04-23 08:09    [W:0.021 / U:155.036 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site