VirtualBox

Changeset 6385 in vbox


Ignore:
Timestamp:
Jan 18, 2008 9:40:08 PM (17 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
27331
Message:

small optimization

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/iprt/asm.h

    r6334 r6385  
    24902490# if RT_INLINE_ASM_USES_INTRIN
    24912491    u32 = _InterlockedIncrement((long *)pu32);
     2492    return u32;
    24922493
    24932494# elif RT_INLINE_ASM_GNU_STYLE
    24942495    __asm__ __volatile__("lock; xaddl %0, %1\n\t"
    2495                          "incl %0\n\t"
    24962496                         : "=r" (u32),
    24972497                           "=m" (*pu32)
    24982498                         : "0" (1)
    24992499                         : "memory");
     2500    return u32+1;
    25002501# else
    25012502    __asm
     
    25092510        lock xadd [edx], eax
    25102511#  endif
    2511         inc     eax
    25122512        mov     u32, eax
    25132513    }
    2514 # endif
    2515     return u32;
     2514    return u32+1;
     2515# endif
    25162516}
    25172517#endif
     
    25442544# if RT_INLINE_ASM_USES_INTRIN
    25452545    u32 = _InterlockedDecrement((long *)pu32);
     2546    return u32;
    25462547
    25472548# elif RT_INLINE_ASM_GNU_STYLE
    25482549    __asm__ __volatile__("lock; xaddl %0, %1\n\t"
    2549                          "decl %0\n\t"
    25502550                         : "=r" (u32),
    25512551                           "=m" (*pu32)
    25522552                         : "0" (-1)
    25532553                         : "memory");
     2554    return u32-1;
    25542555# else
    25552556    __asm
     
    25632564        lock xadd [edx], eax
    25642565#  endif
    2565         dec     eax
    25662566        mov     u32, eax
    25672567    }
    2568 # endif
    2569     return u32;
     2568    return u32-1;
     2569# endif
    25702570}
    25712571#endif
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette