Index: /trunk/include/iprt/cdefs.h
===================================================================
--- /trunk/include/iprt/cdefs.h	(revision 96156)
+++ /trunk/include/iprt/cdefs.h	(revision 96157)
@@ -1122,5 +1122,5 @@
  * IEEE quadruple precision floating (128-bit).
  * @note Currently not able to detect this, so must be explicitly defined. */
-#if 0
+#if defined(RT_ARCH_SPARC) || defined(RT_ARCH_SPARC64)
 # define RT_COMPILER_WITH_128BIT_LONG_DOUBLE
 #endif
Index: /trunk/include/iprt/types.h
===================================================================
--- /trunk/include/iprt/types.h	(revision 96156)
+++ /trunk/include/iprt/types.h	(revision 96157)
@@ -1551,5 +1551,5 @@
 #ifdef RT_COMPILER_WITH_128BIT_LONG_DOUBLE
     /** Long double view. */
-    long double lrd;
+    long double lrd, r;
 #endif
     /** 128-bit view. */
@@ -1578,4 +1578,23 @@
 #define RTFLOAT128U_INIT_C(a_fSign, a_uFractionHi, a_uFractionLo, a_uExponent) \
     RTFLOAT128U_INIT((a_fSign), UINT64_C(a_uFractionHi), UINT64_C(a_uFractionLo), (a_uExponent))
+
+#define RTFLOAT128U_INIT_ZERO(a_fSign)               RTFLOAT128U_INIT((a_fSign), UINT64_C(0), UINT64_C(0), 0)
+#define RTFLOAT128U_INIT_INF(a_fSign)                RTFLOAT128U_INIT((a_fSign), UINT64_C(0), UINT64_C(0), RTFLOAT128U_EXP_MAX)
+#define RTFLOAT128U_INIT_SNAN(a_fSign)               RTFLOAT128U_INIT((a_fSign), UINT64_C(0), UINT64_C(1), RTFLOAT128U_EXP_MAX)
+#define RTFLOAT128U_INIT_SNAN_EX(a_fSign, a_uValHi, a_uValLo) \
+    RTFLOAT128U_INIT((a_fSign), (a_uValHi), (a_uValHi) || (a_uValLo) ? (a_uValLo) : UINT64_C(1), RTFLOAT128U_EXP_MAX)
+#define RTFLOAT128U_INIT_SIGNALLING_NAN(a_fSign)     RTFLOAT128U_INIT_SNAN(a_fSign)
+#define RTFLOAT128U_INIT_QNAN(a_fSign) \
+    RTFLOAT128U_INIT((a_fSign), RT_BIT_64(RTFLOAT128U_FRACTION_BITS - 1 - 64), UINT64_C(1), RTFLOAT128U_EXP_MAX)
+#define RTFLOAT128U_INIT_QNAN_EX(a_fSign, a_uValHi, a_uValLo) \
+    RTFLOAT128U_INIT((a_fSign), RT_BIT_64(RTFLOAT128U_FRACTION_BITS - 1 - 64) | (a_uValHi), \
+                     (a_uValLo) || (a_uValHi) ? (a_uValLo) : UINT64_C(1), RTFLOAT128U_EXP_MAX)
+#define RTFLOAT128U_INIT_QUIET_NAN(a_fSign)          RTFLOAT128U_INIT_QNAN(a_fSign)
+#define RTFLOAT128U_INIT_NAN_EX(a_fQuiet, a_fSign, a_uValHi, a_uValLo) \
+    RTFLOAT128U_INIT((a_fSign), \
+                     ((a_fQuiet) ? RT_BIT_64(RTFLOAT128U_FRACTION_BITS - 1 - 64) : 0) | (a_uValHi), \
+                     (a_uValLo) || (a_uValHi) || (a_fQuiet) /*?*/ ? (a_uValLo) : UINT64_C(1), \
+                     RTFLOAT128U_EXP_MAX)
+
 /** The exponent bias for the RTFLOAT128U format. */
 #define RTFLOAT128U_EXP_BIAS                    (16383)
Index: /trunk/src/VBox/Runtime/Makefile.kmk
===================================================================
--- /trunk/src/VBox/Runtime/Makefile.kmk	(revision 96156)
+++ /trunk/src/VBox/Runtime/Makefile.kmk	(revision 96157)
@@ -2613,5 +2613,5 @@
 endif
 VBoxRT_SDKS                   += VBOX_OPENSSL
-if1of ($(KBUILD_TARGET), $(VBOX_SUPPORTED_HOST_ARCHS))
+if1of ($(KBUILD_TARGET_ARCH), $(VBOX_SUPPORTED_HOST_ARCHS))
 VBoxRT_SDKS                   += VBOX_SOFTFLOAT
 endif
Index: /trunk/src/VBox/Runtime/common/string/strtofloat.cpp
===================================================================
--- /trunk/src/VBox/Runtime/common/string/strtofloat.cpp	(revision 96156)
+++ /trunk/src/VBox/Runtime/common/string/strtofloat.cpp	(revision 96157)
@@ -43,5 +43,5 @@
 #endif
 
-#if defined(SOFTFLOAT_FAST_INT64) /** @todo better softfloat indicator? */
+#if defined(SOFTFLOAT_FAST_INT64) && !defined(RT_COMPILER_WITH_128BIT_LONG_DOUBLE) /** @todo better softfloat indicator? */
 # define USE_SOFTFLOAT /* for scaling by power of 10 */
 #endif
@@ -56,5 +56,9 @@
 typedef struct FLOATUNION
 {
+#ifdef RT_COMPILER_WITH_128BIT_LONG_DOUBLE
+    RTFLOAT128U lrd;
+#elif defined(RT_COMPILER_WITH_80BIT_LONG_DOUBLE)
     RTFLOAT80U2 lrd;
+#endif
     RTFLOAT64U  rd;
     RTFLOAT32U  r;
@@ -65,8 +69,16 @@
 #define RET_TYPE_LONG_DOUBLE  2
 
-#ifdef RT_COMPILER_WITH_80BIT_LONG_DOUBLE
+#ifdef RT_COMPILER_WITH_128BIT_LONG_DOUBLE
+typedef RTFLOAT128U LONG_DOUBLE_U_T;
+typedef __uint128_t UINT_MANTISSA_T;
+# define UINT_MANTISSA_T_BITS   128
+#elif defined(RT_COMPILER_WITH_80BIT_LONG_DOUBLE)
 typedef RTFLOAT80U2 LONG_DOUBLE_U_T;
+typedef uint64_t    UINT_MANTISSA_T;
+# define UINT_MANTISSA_T_BITS   64
 #else
 typedef RTFLOAT64U  LONG_DOUBLE_U_T;
+typedef uint64_t    UINT_MANTISSA_T;
+# define UINT_MANTISSA_T_BITS   64
 #endif
 
@@ -89,5 +101,7 @@
     RTFLOAT32U_EXP_MAX - 1 - RTFLOAT32U_EXP_BIAS,
     RTFLOAT64U_EXP_MAX - 1 - RTFLOAT64U_EXP_BIAS,
-#ifdef RT_COMPILER_WITH_80BIT_LONG_DOUBLE
+#if defined(RT_COMPILER_WITH_128BIT_LONG_DOUBLE)
+    RTFLOAT128U_EXP_MAX - 1 - RTFLOAT128U_EXP_BIAS,
+#elif defined(RT_COMPILER_WITH_80BIT_LONG_DOUBLE)
     RTFLOAT80U_EXP_MAX - 1 - RTFLOAT80U_EXP_BIAS,
 #else
@@ -101,5 +115,7 @@
     1 - RTFLOAT32U_EXP_BIAS,
     1 - RTFLOAT64U_EXP_BIAS,
-#ifdef RT_COMPILER_WITH_80BIT_LONG_DOUBLE
+#if defined(RT_COMPILER_WITH_128BIT_LONG_DOUBLE)
+    1 - RTFLOAT128U_EXP_BIAS,
+#elif defined(RT_COMPILER_WITH_80BIT_LONG_DOUBLE)
     1 - RTFLOAT80U_EXP_BIAS,
 #else
@@ -112,8 +128,10 @@
 static uint64_t const g_fNanMasks[3] =
 {
-    RT_BIT_64(RTFLOAT32U_FRACTION_BITS - 1) - 1,    /* 22=quiet(1) / silent(0) */
-    RT_BIT_64(RTFLOAT64U_FRACTION_BITS - 1) - 1,    /* 51=quiet(1) / silent(0) */
-#ifdef RT_COMPILER_WITH_80BIT_LONG_DOUBLE
-    RT_BIT_64(RTFLOAT80U_FRACTION_BITS - 1) - 1,    /* bit 63=NaN; bit 62=quiet(1) / silent(0) */
+    RT_BIT_64(RTFLOAT32U_FRACTION_BITS - 1) - 1,        /* 22=quiet(1) / silent(0) */
+    RT_BIT_64(RTFLOAT64U_FRACTION_BITS - 1) - 1,        /* 51=quiet(1) / silent(0) */
+#if defined(RT_COMPILER_WITH_128BIT_LONG_DOUBLE)
+    RT_BIT_64(RTFLOAT128U_FRACTION_BITS - 1 - 64) - 1,  /* 111=quiet(1) / silent(0) */
+#elif defined(RT_COMPILER_WITH_80BIT_LONG_DOUBLE)
+    RT_BIT_64(RTFLOAT80U_FRACTION_BITS - 1) - 1,        /* bit 63=NaN; bit 62=quiet(1) / silent(0) */
 #else
     RT_BIT_64(RTFLOAT64U_FRACTION_BITS - 1) - 1,
@@ -122,11 +140,11 @@
 
 #if 0 /* unused */
-#ifdef RT_COMPILER_WITH_80BIT_LONG_DOUBLE
+# if defined(RT_COMPILER_WITH_80BIT_LONG_DOUBLE) || defined(RT_COMPILER_WITH_128BIT_LONG_DOUBLE)
 static const long double g_lrdPowerMin10 = 1e4931L;
 static const long double g_lrdPowerMax10 = 1e4932L;
-#else
+# else
 static const long double g_lrdPowerMin10 = 1e307L;
 static const long double g_lrdPowerMax10 = 1e308L;
-#endif
+# endif
 #endif
 
@@ -230,5 +248,5 @@
     1e128L,
     1e256L,
-# ifdef RT_COMPILER_WITH_80BIT_LONG_DOUBLE
+# if defined(RT_COMPILER_WITH_80BIT_LONG_DOUBLE) || defined(RT_COMPILER_WITH_128BIT_LONG_DOUBLE)
     1e512L,
     1e1024L,
@@ -297,11 +315,11 @@
     softfloat_state_t   SoftState = SOFTFLOAT_STATE_INIT_DEFAULTS();
     float128_t          Val;
-#ifdef RT_COMPILER_WITH_80BIT_LONG_DOUBLE
+# ifdef RT_COMPILER_WITH_80BIT_LONG_DOUBLE
     extFloat80M         Tmp = EXTFLOAT80M_INIT(pVal->s2.uSignAndExponent, pVal->s2.uMantissa);
     extF80M_to_f128M(&Tmp, &Val, &SoftState);
-#else
+# else
     float64_t           Tmp = { pVal->u };
     f64_to_f128M(Tmp, &Val, &SoftState);
-#endif
+# endif
 
     /*
@@ -355,12 +373,12 @@
         f128M_div(&Val, &Factor, &Val, &SoftState);
 
-#ifdef RT_COMPILER_WITH_80BIT_LONG_DOUBLE
+# ifdef RT_COMPILER_WITH_80BIT_LONG_DOUBLE
     f128M_to_extF80M(&Val, &Tmp, &SoftState);
     pVal->s2.uSignAndExponent = Tmp.signExp;
     pVal->s2.uMantissa        = Tmp.signif;
-#else
+# else
     Tmp = f128M_to_f64(&Val, &SoftState);
     pVal->u = Tmp.v;
-#endif
+# endif
 
     /*
@@ -371,12 +389,9 @@
         rc = VINF_SUCCESS;
     else if (SoftState.exceptionFlags & softfloat_flag_underflow)
-    {
-RTAssertMsg2("VERR_FLOAT_UNDERFLOW r128=%.16Rhxs r64=%.8Rhxs\n", &Val, &Tmp);
         rc = VERR_FLOAT_UNDERFLOW;
-    }
     else
         rc = VERR_FLOAT_OVERFLOW;
 
-#else
+#else  /* !USE_SOFTFLOAT */
 # if 0
     /*
@@ -453,5 +468,5 @@
 # endif
 
-#endif
+#endif /* !USE_SOFTFLOAT */
     return rc;
 }
@@ -535,7 +550,11 @@
 
         case RET_TYPE_LONG_DOUBLE:
-#ifdef RT_COMPILER_WITH_80BIT_LONG_DOUBLE
-        {
+#if defined(RT_COMPILER_WITH_80BIT_LONG_DOUBLE) || defined(RT_COMPILER_WITH_128BIT_LONG_DOUBLE)
+        {
+# if defined(RT_COMPILER_WITH_80BIT_LONG_DOUBLE)
             RTFLOAT80U2 const uRet = RTFLOAT80U_INIT_INF(!fPositive);
+# else
+            RTFLOAT128U const uRet = RTFLOAT128U_INIT_INF(!fPositive);
+# endif
             pRet->lrd.lrd = uRet.lrd;
             break;
@@ -574,6 +593,7 @@
  * @param   cchTag  The length of the tag string value.
  * @param   pfQuiet Where to return the type of NaN.  Default is quiet.
+ * @param   puHiNum Where to rturn the high 64-bits of the tag.
  */
-static uint64_t rtStrParseNanTag(const char *pchTag, size_t cchTag, bool *pfQuiet)
+static uint64_t rtStrParseNanTag(const char *pchTag, size_t cchTag, bool *pfQuiet, uint64_t *puHiNum)
 {
     *pfQuiet = true;
@@ -591,5 +611,7 @@
      * Parse the number, ignoring overflows and stopping on non-xdigit.
      */
+    *puHiNum = 0;
     uint64_t uRet = 0;
+    unsigned iXDigit = 0;
     while (cchTag > 0)
     {
@@ -598,6 +620,9 @@
         if (uchDigit >= 16)
             break;
-        uRet *= 16;
-        uRet += uchDigit;
+        iXDigit++;
+        if (iXDigit >= 16)
+            *puHiNum = (*puHiNum << 4) | (uRet >> 60);
+        uRet <<= 4;
+        uRet  += uchDigit;
         pchTag++;
         cchTag--;
@@ -642,4 +667,5 @@
     bool     fQuiet = true;
     uint64_t uNum   = 1;
+    uint64_t uHiNum = 0;
     if (cchMax >= 2 && *psz == '(')
     {
@@ -650,12 +676,23 @@
         if (ch == ')')
         {
-            uNum = rtStrParseNanTag(psz + 1, cch - 1, &fQuiet);
+            uNum = rtStrParseNanTag(psz + 1, cch - 1, &fQuiet, &uHiNum);
             psz    += cch + 1;
             cchMax -= cch + 1;
 
             Assert(iRetType < RT_ELEMENTS(g_fNanMasks));
-            uNum &= g_fNanMasks[iRetType];
-            if (!uNum)
-                uNum = 1; /* must not be zero, or it'll turn into an infinity */
+#if defined(RT_COMPILER_WITH_128BIT_LONG_DOUBLE)
+            if (iRetType == RET_TYPE_LONG_DOUBLE)
+            {
+                uHiNum &= g_fNanMasks[RET_TYPE_LONG_DOUBLE];
+                if (!uNum && !uHiNum)
+                    uNum = 1; /* must not be zero, or it'll turn into an infinity */
+            }
+            else
+#endif
+            {
+                uNum &= g_fNanMasks[iRetType];
+                if (!uNum)
+                    uNum = 1; /* must not be zero, or it'll turn into an infinity */
+            }
         }
     }
@@ -674,7 +711,11 @@
 
         case RET_TYPE_LONG_DOUBLE:
-#ifdef RT_COMPILER_WITH_80BIT_LONG_DOUBLE
-        {
+#if defined(RT_COMPILER_WITH_80BIT_LONG_DOUBLE) || defined(RT_COMPILER_WITH_128BIT_LONG_DOUBLE)
+        {
+# if defined(RT_COMPILER_WITH_80BIT_LONG_DOUBLE)
             RTFLOAT80U2 const uRet = RTFLOAT80U_INIT_NAN_EX(fQuiet, !fPositive, uNum);
+# else
+            RTFLOAT128U const uRet = RTFLOAT128U_INIT_NAN_EX(fQuiet, !fPositive, uHiNum, uNum);
+# endif
             pRet->lrd = uRet;
             break;
@@ -719,5 +760,5 @@
 
         case RET_TYPE_LONG_DOUBLE:
-#ifdef RT_COMPILER_WITH_80BIT_LONG_DOUBLE
+#if defined(RT_COMPILER_WITH_80BIT_LONG_DOUBLE) || defined(RT_COMPILER_WITH_128BIT_LONG_DOUBLE)
             pRet->lrd.lrd = fPositive ? +0.0L : -0.0L;
             break;
@@ -765,5 +806,5 @@
                                             unsigned iRetType, FLOATUNION *pRet)
 {
-#ifdef RT_COMPILER_WITH_80BIT_LONG_DOUBLE
+#if defined(RT_COMPILER_WITH_80BIT_LONG_DOUBLE) || defined(RT_COMPILER_WITH_128BIT_LONG_DOUBLE)
     Assert(iRetType == RET_TYPE_LONG_DOUBLE);
     pRet->lrd = *pVal;
@@ -782,5 +823,5 @@
  */
 static int rtStrToLongDoubleReturnValue(const char *psz, char **ppszNext, size_t cchMax,
-                                        bool fPositive, uint64_t uMantissa, int32_t iExponent,
+                                        bool fPositive, UINT_MANTISSA_T uMantissa, int32_t iExponent,
                                         unsigned iRetType, FLOATUNION *pRet)
 {
@@ -794,5 +835,5 @@
                 /* Produce a subnormal value if it's within range, otherwise return zero. */
                 if (iExponent < -RTFLOAT32U_FRACTION_BITS)
-                    return rtStrToLongDoubleReturnZero(psz, ppszNext, cchMax, fPositive, VWRN_FLOAT_UNDERFLOW, iRetType, pRet);
+                    return rtStrToLongDoubleReturnZero(psz, ppszNext, cchMax, fPositive, VERR_FLOAT_UNDERFLOW, iRetType, pRet);
                 rc = VWRN_FLOAT_UNDERFLOW;
                 uMantissa >>= -iExponent + 1;
@@ -800,7 +841,8 @@
             }
             else if (iExponent >= RTFLOAT32U_EXP_MAX)
-                return rtStrToLongDoubleReturnInf(psz, ppszNext, cchMax, fPositive, VWRN_FLOAT_OVERFLOW, iRetType, pRet);
-
-            pRet->r.s.uFraction = (uMantissa >> (63 - RTFLOAT32U_FRACTION_BITS)) & (RT_BIT_64(RTFLOAT32U_FRACTION_BITS) - 1);
+                return rtStrToLongDoubleReturnInf(psz, ppszNext, cchMax, fPositive, VERR_FLOAT_OVERFLOW, iRetType, pRet);
+
+            pRet->r.s.uFraction = (uMantissa >> (UINT_MANTISSA_T_BITS - 1 - RTFLOAT32U_FRACTION_BITS))
+                                & (RT_BIT_32(RTFLOAT32U_FRACTION_BITS) - 1);
             pRet->r.s.uExponent = iExponent;
             pRet->r.s.fSign     = !fPositive;
@@ -809,4 +851,7 @@
         case RET_TYPE_LONG_DOUBLE:
 #ifdef RT_COMPILER_WITH_80BIT_LONG_DOUBLE
+# if UINT_MANTISSA_T_BITS != 64
+#  error Unsupported UINT_MANTISSA_T_BITS count.
+# endif
             iExponent += RTFLOAT80U_EXP_BIAS;
             if (iExponent <= 0)
@@ -814,5 +859,5 @@
                 /* Produce a subnormal value if it's within range, otherwise return zero. */
                 if (iExponent < -RTFLOAT80U_FRACTION_BITS)
-                    return rtStrToLongDoubleReturnZero(psz, ppszNext, cchMax, fPositive, VWRN_FLOAT_UNDERFLOW, iRetType, pRet);
+                    return rtStrToLongDoubleReturnZero(psz, ppszNext, cchMax, fPositive, VERR_FLOAT_UNDERFLOW, iRetType, pRet);
                 rc = VWRN_FLOAT_UNDERFLOW;
                 uMantissa >>= -iExponent + 1;
@@ -820,9 +865,28 @@
             }
             else if (iExponent >= RTFLOAT80U_EXP_MAX)
-                return rtStrToLongDoubleReturnInf(psz, ppszNext, cchMax, fPositive, VWRN_FLOAT_OVERFLOW, iRetType, pRet);
+                return rtStrToLongDoubleReturnInf(psz, ppszNext, cchMax, fPositive, VERR_FLOAT_OVERFLOW, iRetType, pRet);
 
             pRet->lrd.s.uMantissa = uMantissa;
             pRet->lrd.s.uExponent = iExponent;
             pRet->lrd.s.fSign     = !fPositive;
+            break;
+#elif defined(RT_COMPILER_WITH_128BIT_LONG_DOUBLE)
+            iExponent += RTFLOAT128U_EXP_BIAS;
+            uMantissa >>= 128 - RTFLOAT128U_FRACTION_BITS;
+            if (iExponent <= 0)
+            {
+                /* Produce a subnormal value if it's within range, otherwise return zero. */
+                if (iExponent < -RTFLOAT128U_FRACTION_BITS)
+                    return rtStrToLongDoubleReturnZero(psz, ppszNext, cchMax, fPositive, VERR_FLOAT_UNDERFLOW, iRetType, pRet);
+                rc = VWRN_FLOAT_UNDERFLOW;
+                uMantissa >>= -iExponent + 1;
+                iExponent   = 0;
+            }
+            else if (iExponent >= RTFLOAT80U_EXP_MAX)
+                return rtStrToLongDoubleReturnInf(psz, ppszNext, cchMax, fPositive, VERR_FLOAT_OVERFLOW, iRetType, pRet);
+            pRet->lrd.s64.uFractionHi = (uint64_t)(uMantissa >> 64) & (RT_BIT_64(RTFLOAT128U_FRACTION_BITS - 64) - 1);
+            pRet->lrd.s64.uFractionLo = (uint64_t)uMantissa;
+            pRet->lrd.s64.uExponent   = iExponent;
+            pRet->lrd.s64.fSign       = !fPositive;
             break;
 #else
@@ -836,5 +900,5 @@
                 /* Produce a subnormal value if it's within range, otherwise return zero. */
                 if (iExponent < -RTFLOAT64U_FRACTION_BITS)
-                    return rtStrToLongDoubleReturnZero(psz, ppszNext, cchMax, fPositive, VWRN_FLOAT_UNDERFLOW, iRetType, pRet);
+                    return rtStrToLongDoubleReturnZero(psz, ppszNext, cchMax, fPositive, VERR_FLOAT_UNDERFLOW, iRetType, pRet);
                 rc = VWRN_FLOAT_UNDERFLOW;
                 uMantissa >>= -iExponent + 1;
@@ -842,7 +906,8 @@
             }
             else if (iExponent >= RTFLOAT64U_EXP_MAX)
-                return rtStrToLongDoubleReturnInf(psz, ppszNext, cchMax, fPositive, VWRN_FLOAT_OVERFLOW, iRetType, pRet);
-
-            pRet->rd.s64.uFraction = (uMantissa >> (63 - RTFLOAT64U_FRACTION_BITS)) & (RT_BIT_64(RTFLOAT64U_FRACTION_BITS) - 1);
+                return rtStrToLongDoubleReturnInf(psz, ppszNext, cchMax, fPositive, VERR_FLOAT_OVERFLOW, iRetType, pRet);
+
+            pRet->rd.s64.uFraction = (uMantissa >> (UINT_MANTISSA_T_BITS - 1 - RTFLOAT64U_FRACTION_BITS))
+                                   & (RT_BIT_64(RTFLOAT64U_FRACTION_BITS) - 1);
             pRet->rd.s64.uExponent = iExponent;
             pRet->rd.s64.fSign     = !fPositive;
@@ -917,5 +982,7 @@
      * Check for hex prefix.
      */
-#ifdef RT_COMPILER_WITH_80BIT_LONG_DOUBLE
+#ifdef RT_COMPILER_WITH_128BIT_LONG_DOUBLE
+    unsigned cMaxDigits      = 33;
+#elif defined(RT_COMPILER_WITH_80BIT_LONG_DOUBLE)
     unsigned cMaxDigits      = 19;
 #else
@@ -936,5 +1003,9 @@
      * Now, parse the mantissa.
      */
+#ifdef RT_COMPILER_WITH_128BIT_LONG_DOUBLE
+    uint8_t     abDigits[36];
+#else
     uint8_t     abDigits[20];
+#endif
     unsigned    cDigits           = 0;
     unsigned    cFractionDigits   = 0;
@@ -1050,8 +1121,8 @@
     if (uBase == 16)
     {
-        uint64_t uMantissa = 0;
+        UINT_MANTISSA_T uMantissa = 0;
         for (unsigned iDigit = 0; iDigit < cDigits; iDigit++)
         {
-            uMantissa |= (uint64_t)abDigits[iDigit] << (64 - 4 - iDigit * 4);
+            uMantissa |= (UINT_MANTISSA_T)abDigits[iDigit] << (UINT_MANTISSA_T_BITS - 4 - iDigit * 4);
             iExponent += 4;
         }
@@ -1059,10 +1130,18 @@
 
         /* Shift to the left till the most significant bit is 1. */
-        if (!(uMantissa & RT_BIT_64(63)))
-        {
+        if (!((uMantissa >> (UINT_MANTISSA_T_BITS - 1)) & 1))
+        {
+#if UINT_MANTISSA_T_BITS == 64
             unsigned cShift = 64 - ASMBitLastSetU64(uMantissa);
             uMantissa <<= cShift;
             iExponent  -= cShift;
             Assert(uMantissa & RT_BIT_64(63));
+#else
+            do
+            {
+                uMantissa <<= 1;
+                iExponent  -= 1;
+            } while (!((uMantissa >> (UINT_MANTISSA_T_BITS - 1)) & 1));
+#endif
         }
 
@@ -1080,5 +1159,5 @@
      * the compiler/CPU for the mantissa.
      */
-    uint64_t uMantissa = 0;
+    UINT_MANTISSA_T uMantissa = 0;
     for (unsigned iDigit = 0; iDigit < cDigits; iDigit++)
     {
@@ -1101,4 +1180,6 @@
 #ifdef RT_COMPILER_WITH_80BIT_LONG_DOUBLE
         if (!RTFLOAT80U_IS_NORMAL(&uTmp))
+#elif defined(RT_COMPILER_WITH_128BIT_LONG_DOUBLE)
+        if (!RTFLOAT128U_IS_NORMAL(&uTmp))
 #else
         if (!RTFLOAT64U_IS_NORMAL(&uTmp))
@@ -1107,4 +1188,6 @@
 #ifdef RT_COMPILER_WITH_80BIT_LONG_DOUBLE
             if (RTFLOAT80U_IS_DENORMAL(&uTmp) && iRetType == RET_TYPE_LONG_DOUBLE)
+#elif defined(RT_COMPILER_WITH_128BIT_LONG_DOUBLE)
+            if (RTFLOAT128U_IS_SUBNORMAL(&uTmp) && iRetType == RET_TYPE_LONG_DOUBLE)
 #else
             if (RTFLOAT64U_IS_SUBNORMAL(&uTmp) && iRetType != RET_TYPE_FLOAT)
@@ -1129,4 +1212,19 @@
     iExponent = uTmp.s.uExponent - RTFLOAT80U_EXP_BIAS;
     uMantissa = uTmp.s.uMantissa;
+# if UINT_MANTISSA_T_BITS > 64
+    uMantissa <<= UINT_MANTISSA_T_BITS - 64;
+# endif
+#elif defined(RT_COMPILER_WITH_128BIT_LONG_DOUBLE)
+    Assert(RTFLOAT128U_IS_NORMAL(&uTmp));
+    if (iRetType == RET_TYPE_LONG_DOUBLE)
+    {
+        pRet->lrd = uTmp;
+        return rtStrToLongDoubleReturnChecks(psz, ppszNext, cchMax, VINF_SUCCESS);
+    }
+    fPositive  = uTmp.s64.fSign;
+    iExponent  = uTmp.s64.uExponent - RTFLOAT128U_EXP_BIAS;
+    uMantissa  = (UINT_MANTISSA_T)uTmp.s64.uFractionHi << (UINT_MANTISSA_T_BITS - RTFLOAT128U_FRACTION_BITS - 1 + 64);
+    uMantissa |= (UINT_MANTISSA_T)uTmp.s64.uFractionLo << (UINT_MANTISSA_T_BITS - RTFLOAT128U_FRACTION_BITS - 1);
+    uMantissa |= (UINT_MANTISSA_T)1 << (UINT_MANTISSA_T_BITS - 1);
 #else
     Assert(RTFLOAT64U_IS_NORMAL(&uTmp));
@@ -1140,4 +1238,7 @@
     iExponent = uTmp.s64.uExponent - RTFLOAT64U_EXP_BIAS;
     uMantissa = uTmp.s64.uFraction | RT_BIT_64(RTFLOAT64U_FRACTION_BITS);
+# if UINT_MANTISSA_T_BITS > 64
+    uMantissa <<= UINT_MANTISSA_T_BITS - 64;
+# endif
 #endif
     return rtStrToLongDoubleReturnValue(psz, ppszNext, cchMax, fPositive, uMantissa, iExponent, iRetType, pRet);
