VirtualBox

Changeset 94755 in vbox for trunk/src/libs/softfloat-3e


Ignore:
Timestamp:
Apr 29, 2022 8:32:59 AM (3 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
151137
Message:

libs/softfloat: softfloat_countLeadingZeros16/32/64 onto ASMBitLastSetU16/32/64 when not on GCC or similar. bugref:9898

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/libs/softfloat-3e/build/vbox/platform.h

    r94753 r94755  
    5151#endif
    5252
     53/* Generic IPRT asm.h based optimizations: */
     54#if !defined(__GNUC__)
     55# include <iprt/asm.h>
     56# define softfloat_countLeadingZeros16 softfloat_iprt_countLeadingZeros16
     57DECLINLINE(uint_fast8_t) softfloat_iprt_countLeadingZeros16(uint16_t uVal)
     58{
     59    return 16 - ASMBitLastSetU16(uVal);
     60}
     61# define softfloat_countLeadingZeros32 softfloat_iprt_countLeadingZeros32
     62DECLINLINE(uint_fast8_t) softfloat_iprt_countLeadingZeros32(uint32_t uVal)
     63{
     64    return 32 - ASMBitLastSetU32(uVal);
     65}
     66# define softfloat_countLeadingZeros64 softfloat_iprt_countLeadingZeros64
     67DECLINLINE(uint_fast8_t) softfloat_iprt_countLeadingZeros64(uint64_t uVal)
     68{
     69    return 64 - ASMBitLastSetU64(uVal);
     70}
     71#endif
     72
    5373/* Include GCC optimizations: */
    5474#ifdef __GNUC__
    55 # define SOFTFLOAT_BUILTIN_CLZ          1
     75# ifndef softfloat_countLeadingZeros16
     76#  define SOFTFLOAT_BUILTIN_CLZ         1
     77# endif
    5678# if ARCH_BITS > 32
    5779#  define SOFTFLOAT_INTRINSIC_INT128    1
     
    5981# include "opts-GCC.h"
    6082#endif
    61 /** @todo do Visual C++ optimization / generic IPRT based ones. */
    6283
    6384/* We've eliminated the global variables and need no TLS variable tricks. */
Note: See TracChangeset for help on using the changeset viewer.

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