VirtualBox

Changeset 96192 in vbox for trunk/include


Ignore:
Timestamp:
Aug 13, 2022 2:58:37 PM (2 years ago)
Author:
vboxsync
Message:

iprt/cdefs.h,types.h: Added a RT_COMPILER_WITH_64BIT_LONG_DOUBLE and a RT_COMPILER_LONG_DOUBLE_BITS define. Added lrd member to RTFLOAT64U on targets using it for long double. bugref:10261

Location:
trunk/include/iprt
Files:
2 edited

Legend:

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

    r96157 r96192  
    11111111#endif
    11121112
     1113/** @def RT_COMPILER_LONG_DOUBLE_BITS
     1114 * Number of relevant bits in the long double type: 64, 80 or 128  */
     1115/** @def RT_COMPILER_WITH_64BIT_LONG_DOUBLE
     1116 * Macro that is defined if the compiler implements long double as the
     1117 * IEEE precision floating. */
    11131118/** @def RT_COMPILER_WITH_80BIT_LONG_DOUBLE
    11141119 * Macro that is defined if the compiler implements long double as the
    11151120 * IEEE extended precision floating. */
    1116 #if (defined(RT_ARCH_AMD64) || defined(RT_ARCH_X86)) && !defined(RT_OS_WINDOWS)
     1121/** @def RT_COMPILER_WITH_128BIT_LONG_DOUBLE
     1122* Macro that is defined if the compiler implements long double as the
     1123* IEEE quadruple precision floating (128-bit).
     1124* @note Currently not able to detect this, so must be explicitly defined. */
     1125#if defined(RT_OS_WINDOWS) || defined(RT_ARCH_ARM64) || defined(RT_ARCH_ARM32) /* the M1 arm64 at least */
     1126# define RT_COMPILER_LONG_DOUBLE_BITS       64
     1127# define RT_COMPILER_WITH_64BIT_LONG_DOUBLE
     1128# undef  RT_COMPILER_WITH_80BIT_LONG_DOUBLE
     1129# undef  RT_COMPILER_WITH_128BIT_LONG_DOUBLE
     1130#elif defined(RT_ARCH_AMD64) || defined(RT_ARCH_X86)
     1131# define RT_COMPILER_LONG_DOUBLE_BITS       80
     1132# undef  RT_COMPILER_WITH_64BIT_LONG_DOUBLE
    11171133# define RT_COMPILER_WITH_80BIT_LONG_DOUBLE
    1118 #endif
    1119 
    1120 /** @def RT_COMPILER_WITH_128BIT_LONG_DOUBLE
    1121  * Macro that is defined if the compiler implements long double as the
    1122  * IEEE quadruple precision floating (128-bit).
    1123  * @note Currently not able to detect this, so must be explicitly defined. */
    1124 #if defined(RT_ARCH_SPARC) || defined(RT_ARCH_SPARC64)
     1134# undef  RT_COMPILER_WITH_128BIT_LONG_DOUBLE
     1135#elif defined(RT_ARCH_SPARC) || defined(RT_ARCH_SPARC64)
     1136# define RT_COMPILER_LONG_DOUBLE_BITS       128
     1137# undef  RT_COMPILER_WITH_64BIT_LONG_DOUBLE
     1138# undef  RT_COMPILER_WITH_80BIT_LONG_DOUBLE
    11251139# define RT_COMPILER_WITH_128BIT_LONG_DOUBLE
     1140#else
     1141# error "Port me!"
    11261142#endif
    11271143
  • trunk/include/iprt/types.h

    r96157 r96192  
    10841084    /** Double view. */
    10851085    double      rd, r;
     1086#endif
     1087#ifdef RT_COMPILER_WITH_64BIT_LONG_DOUBLE
     1088    /** Long double view. */
     1089    long double lrd;
    10861090#endif
    10871091    /** Unsigned integer view. */
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