Index: /trunk/src/VBox/Runtime/Makefile.kmk
===================================================================
--- /trunk/src/VBox/Runtime/Makefile.kmk	(revision 96107)
+++ /trunk/src/VBox/Runtime/Makefile.kmk	(revision 96108)
@@ -2556,5 +2556,15 @@
 RuntimeGuestR3Shared_EXTENDS            := RuntimeGuestR3
 RuntimeGuestR3Shared_INST                = $(INST_ADDITIONS_LIB)
-
+ifdef VBOX_WITH_NOCRT_STATIC
+ if1of ($(KBUILD_TARGET), win)
+  RuntimeGuestR3Shared_SDKS              = $(RuntimeGuestR3_SDKS) VBOX_SOFTFLOATGUESTR3SHARED
+  RuntimeGuestR3Shared_SOURCES           = $(RuntimeGuestR3_SOURCES) \
+  	common/math/fma.cpp \
+  	common/math/fma-asm.asm \
+  	common/math/fmaf.cpp \
+  	common/math/fmaf-asm.asm \
+
+ endif
+endif
 
 #
Index: /trunk/src/VBox/Runtime/common/math/fma-asm.asm
===================================================================
--- /trunk/src/VBox/Runtime/common/math/fma-asm.asm	(revision 96108)
+++ /trunk/src/VBox/Runtime/common/math/fma-asm.asm	(revision 96108)
@@ -0,0 +1,94 @@
+; $Id$
+;; @file
+; IPRT - No-CRT fma alternatives - AMD64 & X86.
+;
+
+;
+; Copyright (C) 2006-2022 Oracle Corporation
+;
+; This file is part of VirtualBox Open Source Edition (OSE), as
+; available from http://www.virtualbox.org. This file is free software;
+; you can redistribute it and/or modify it under the terms of the GNU
+; General Public License (GPL) as published by the Free Software
+; Foundation, in version 2 as it comes in the "COPYING" file of the
+; VirtualBox OSE distribution. VirtualBox OSE is distributed in the
+; hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
+;
+; The contents of this file may alternatively be used under the terms
+; of the Common Development and Distribution License Version 1.0
+; (CDDL) only, as it comes in the "COPYING.CDDL" file of the
+; VirtualBox OSE distribution, in which case the provisions of the
+; CDDL are applicable instead of those of the GPL.
+;
+; You may elect to license modified versions of this file under the
+; terms and conditions of either the GPL or the CDDL or both.
+;
+
+%define RT_ASM_WITH_SEH64
+%include "iprt/asmdefs.mac"
+
+BEGINCODE
+
+;;
+; Fused multiplication and add, intel version.
+;
+; @returns  st(0) / xmm0
+; @param    rdFactor1      [rbp + 08h] / xmm0
+; @param    rdFactor2      [rbp + 10h] / xmm1
+; @param    rdAddend       [rbp + 18h] / xmm2
+BEGINPROC rtNoCrtMathFma3
+        push    xBP
+        SEH64_PUSH_xBP
+        mov     xBP, xSP
+        SEH64_SET_FRAME_xBP 0
+        SEH64_END_PROLOGUE
+
+%ifdef RT_ARCH_X86
+        movsd   xmm0, qword [xBP + xCB*2 + 00h]
+        movsd   xmm1, qword [xBP + xCB*2 + 08h]
+        movsd   xmm2, qword [xBP + xCB*2 + 10h]
+%endif
+
+        vfmadd132sd xmm0, xmm2, xmm1    ; xmm0 = xmm0 * xmm1 + xmm2  (132 = multiply op1 with op3 and add op2)
+
+%ifdef RT_ARCH_X86
+        sub     xSP, 10h
+        movsd   [xSP], xmm0
+        fld     qword [xSP]
+%endif
+        leave
+        ret
+ENDPROC   rtNoCrtMathFma3
+
+
+;;
+; Fused multiplication and add, amd version.
+;
+; @returns  st(0) / xmm0
+; @param    rdFactor1      [rbp + 08h] / xmm0
+; @param    rdFactor2      [rbp + 10h] / xmm1
+; @param    rdAddend       [rbp + 18h] / xmm2
+BEGINPROC rtNoCrtMathFma4
+        push    xBP
+        SEH64_PUSH_xBP
+        mov     xBP, xSP
+        SEH64_SET_FRAME_xBP 0
+        SEH64_END_PROLOGUE
+
+%ifdef RT_ARCH_X86
+        movsd   xmm0, qword [xBP + xCB*2 + 00h]
+        movsd   xmm1, qword [xBP + xCB*2 + 08h]
+        movsd   xmm2, qword [xBP + xCB*2 + 10h]
+%endif
+
+        vfmaddsd xmm0, xmm0, xmm1, xmm2    ; xmm0 = xmm0 * xmm1 + xmm2
+
+%ifdef RT_ARCH_X86
+        sub     xSP, 10h
+        movsd   [xSP], xmm0
+        fld     qword [xSP]
+%endif
+        leave
+        ret
+ENDPROC   rtNoCrtMathFma4
+
Index: /trunk/src/VBox/Runtime/common/math/fma.cpp
===================================================================
--- /trunk/src/VBox/Runtime/common/math/fma.cpp	(revision 96108)
+++ /trunk/src/VBox/Runtime/common/math/fma.cpp	(revision 96108)
@@ -0,0 +1,90 @@
+/* $Id$ */
+/** @file
+ * IPRT - No-CRT - fma().
+ */
+
+/*
+ * Copyright (C) 2022 Oracle Corporation
+ *
+ * This file is part of VirtualBox Open Source Edition (OSE), as
+ * available from http://www.virtualbox.org. This file is free software;
+ * you can redistribute it and/or modify it under the terms of the GNU
+ * General Public License (GPL) as published by the Free Software
+ * Foundation, in version 2 as it comes in the "COPYING" file of the
+ * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
+ * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
+ *
+ * The contents of this file may alternatively be used under the terms
+ * of the Common Development and Distribution License Version 1.0
+ * (CDDL) only, as it comes in the "COPYING.CDDL" file of the
+ * VirtualBox OSE distribution, in which case the provisions of the
+ * CDDL are applicable instead of those of the GPL.
+ *
+ * You may elect to license modified versions of this file under the
+ * terms and conditions of either the GPL or the CDDL or both.
+ */
+
+
+/*********************************************************************************************************************************
+*   Header Files                                                                                                                 *
+*********************************************************************************************************************************/
+#define IPRT_NO_CRT_FOR_3RD_PARTY
+#include "internal/nocrt.h"
+#include <iprt/nocrt/math.h>
+#include <iprt/assertcompile.h>
+#if defined(RT_ARCH_AMD64) || defined(RT_ARCH_X86)
+# include <iprt/asm-amd64-x86.h>
+# include <iprt/x86.h>
+#endif
+#include <softfloat.h>
+
+
+/*********************************************************************************************************************************
+*   External Symbols                                                                                                             *
+*********************************************************************************************************************************/
+DECLASM(double) rtNoCrtMathFma3(double rdFactor1, double rdFactor2, double rdAddend);
+DECLASM(double) rtNoCrtMathFma4(double rdFactor1, double rdFactor2, double rdAddend);
+
+
+#undef fma
+double RT_NOCRT(fma)(double rdFactor1, double rdFactor2, double rdAddend)
+{
+    /*
+     * We prefer using native FMA instructions when available.
+     */
+#if defined(RT_ARCH_AMD64) || defined(RT_ARCH_X86)
+    typedef enum { kCpuDetect = 0, kCpuWithFma3, kCpuWithFma4, kCpuWithoutFma } CPUFMASUPPORT;
+    static CPUFMASUPPORT volatile s_enmSup = kCpuDetect;
+    CPUFMASUPPORT enmSup = s_enmSup;
+    if (enmSup != kCpuDetect)
+    { }
+    else
+    {
+        if (ASMCpuId_ECX(1) & X86_CPUID_FEATURE_ECX_FMA)
+            enmSup = kCpuWithFma3;
+        else if (ASMCpuId_ECX(UINT32_C(0x80000001)) & X86_CPUID_AMD_FEATURE_ECX_FMA4)
+            enmSup = kCpuWithFma4;
+        else
+            enmSup = kCpuWithoutFma;
+        s_enmSup = enmSup;
+    }
+    if (enmSup == kCpuWithFma3)
+        return rtNoCrtMathFma3(rdFactor1, rdFactor2, rdAddend);
+    if (enmSup == kCpuWithFma4)
+        return rtNoCrtMathFma4(rdFactor1, rdFactor2, rdAddend);
+#endif
+
+    /*
+     * Fall back on SoftFloat.
+     */
+    AssertCompile(sizeof(rdFactor1) == sizeof(RTFLOAT64U));
+    softfloat_state_t State = SOFTFLOAT_STATE_INIT_DEFAULTS(); /** @todo init from MXCSR/FCW */
+    union { RTFLOAT64U Iprt; float64_t SoftFloat; } uFactor1, uFactor2, uAddend, uResult;
+    uFactor1.Iprt.rd = rdFactor1;
+    uFactor2.Iprt.rd = rdFactor2;
+    uAddend.Iprt.rd  = rdAddend;
+    uResult.SoftFloat = f64_mulAdd(uFactor1.SoftFloat, uFactor2.SoftFloat, uAddend.SoftFloat, &State);
+    return uResult.Iprt.rd;
+}
+RT_ALIAS_AND_EXPORT_NOCRT_SYMBOL(fma);
+
Index: /trunk/src/VBox/Runtime/common/math/fmaf-asm.asm
===================================================================
--- /trunk/src/VBox/Runtime/common/math/fmaf-asm.asm	(revision 96108)
+++ /trunk/src/VBox/Runtime/common/math/fmaf-asm.asm	(revision 96108)
@@ -0,0 +1,94 @@
+; $Id$
+;; @file
+; IPRT - No-CRT fmaf alternatives - AMD64 & X86.
+;
+
+;
+; Copyright (C) 2006-2022 Oracle Corporation
+;
+; This file is part of VirtualBox Open Source Edition (OSE), as
+; available from http://www.virtualbox.org. This file is free software;
+; you can redistribute it and/or modify it under the terms of the GNU
+; General Public License (GPL) as published by the Free Software
+; Foundation, in version 2 as it comes in the "COPYING" file of the
+; VirtualBox OSE distribution. VirtualBox OSE is distributed in the
+; hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
+;
+; The contents of this file may alternatively be used under the terms
+; of the Common Development and Distribution License Version 1.0
+; (CDDL) only, as it comes in the "COPYING.CDDL" file of the
+; VirtualBox OSE distribution, in which case the provisions of the
+; CDDL are applicable instead of those of the GPL.
+;
+; You may elect to license modified versions of this file under the
+; terms and conditions of either the GPL or the CDDL or both.
+;
+
+%define RT_ASM_WITH_SEH64
+%include "iprt/asmdefs.mac"
+
+BEGINCODE
+
+;;
+; Fused multiplication and add, intel version.
+;
+; @returns  st(0) / xmm0
+; @param    r32Factor1      [rbp + 08h] / xmm0
+; @param    r32Factor2      [rbp + 0ch] / xmm1
+; @param    r32Addend       [rbp + 10h] / xmm2
+BEGINPROC rtNoCrtMathFma3f
+        push    xBP
+        SEH64_PUSH_xBP
+        mov     xBP, xSP
+        SEH64_SET_FRAME_xBP 0
+        SEH64_END_PROLOGUE
+
+%ifdef RT_ARCH_X86
+        movss   xmm0, dword [xBP + xCB*2 + 00h]
+        movss   xmm1, dword [xBP + xCB*2 + 04h]
+        movss   xmm2, dword [xBP + xCB*2 + 08h]
+%endif
+
+        vfmadd132ss xmm0, xmm2, xmm1    ; xmm0 = xmm0 * xmm1 + xmm2  (132 = multiply op1 with op3 and add op2)
+
+%ifdef RT_ARCH_X86
+        sub     xSP, 10h
+        movss   [xSP], xmm0
+        fld     dword [xSP]
+%endif
+        leave
+        ret
+ENDPROC   rtNoCrtMathFma3f
+
+
+;;
+; Fused multiplication and add, amd version.
+;
+; @returns  st(0) / xmm0
+; @param    r32Factor1      [rbp + 08h] / xmm0
+; @param    r32Factor2      [rbp + 10h] / xmm1
+; @param    r32Addend       [rbp + 18h] / xmm2
+BEGINPROC rtNoCrtMathFma4f
+        push    xBP
+        SEH64_PUSH_xBP
+        mov     xBP, xSP
+        SEH64_SET_FRAME_xBP 0
+        SEH64_END_PROLOGUE
+
+%ifdef RT_ARCH_X86
+        movss   xmm0, dword [xBP + xCB*2 + 00h]
+        movss   xmm1, dword [xBP + xCB*2 + 04h]
+        movss   xmm2, dword [xBP + xCB*2 + 08h]
+%endif
+
+        vfmaddss xmm0, xmm0, xmm1, xmm2    ; xmm0 = xmm0 * xmm1 + xmm2
+
+%ifdef RT_ARCH_X86
+        sub     xSP, 10h
+        movss   [xSP], xmm0
+        fld     dword [xSP]
+%endif
+        leave
+        ret
+ENDPROC   rtNoCrtMathFma4f
+
Index: /trunk/src/VBox/Runtime/common/math/fmaf.cpp
===================================================================
--- /trunk/src/VBox/Runtime/common/math/fmaf.cpp	(revision 96108)
+++ /trunk/src/VBox/Runtime/common/math/fmaf.cpp	(revision 96108)
@@ -0,0 +1,91 @@
+/* $Id$ */
+/** @file
+ * IPRT - No-CRT - fmaf().
+ */
+
+/*
+ * Copyright (C) 2022 Oracle Corporation
+ *
+ * This file is part of VirtualBox Open Source Edition (OSE), as
+ * available from http://www.virtualbox.org. This file is free software;
+ * you can redistribute it and/or modify it under the terms of the GNU
+ * General Public License (GPL) as published by the Free Software
+ * Foundation, in version 2 as it comes in the "COPYING" file of the
+ * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
+ * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
+ *
+ * The contents of this file may alternatively be used under the terms
+ * of the Common Development and Distribution License Version 1.0
+ * (CDDL) only, as it comes in the "COPYING.CDDL" file of the
+ * VirtualBox OSE distribution, in which case the provisions of the
+ * CDDL are applicable instead of those of the GPL.
+ *
+ * You may elect to license modified versions of this file under the
+ * terms and conditions of either the GPL or the CDDL or both.
+ */
+
+
+/*********************************************************************************************************************************
+*   Header Files                                                                                                                 *
+*********************************************************************************************************************************/
+#define IPRT_NO_CRT_FOR_3RD_PARTY
+#include "internal/nocrt.h"
+#include <iprt/nocrt/math.h>
+#include <iprt/assertcompile.h>
+#if defined(RT_ARCH_AMD64) || defined(RT_ARCH_X86)
+# include <iprt/asm-amd64-x86.h>
+# include <iprt/x86.h>
+#endif
+#include <softfloat.h>
+
+
+/*********************************************************************************************************************************
+*   External Symbols                                                                                                             *
+*********************************************************************************************************************************/
+DECLASM(float) rtNoCrtMathFma3f(float r32Factor1, float r32Factor2, float r32Addend);
+DECLASM(float) rtNoCrtMathFma4f(float r32Factor1, float r32Factor2, float r32Addend);
+
+
+#undef fmaf
+float RT_NOCRT(fmaf)(float r32Factor1, float r32Factor2, float r32Addend)
+{
+    /*
+     * We prefer using native FMA instructions when available.
+     */
+#if defined(RT_ARCH_AMD64) || defined(RT_ARCH_X86)
+    typedef enum { kCpuDetect = 0, kCpuWithFma3, kCpuWithFma4, kCpuWithoutFma } CPUFMASUPPORT;
+    static CPUFMASUPPORT volatile s_enmSup = kCpuDetect;
+    CPUFMASUPPORT enmSup = s_enmSup;
+    if (enmSup != kCpuDetect)
+    { }
+    else
+    {
+        if (ASMCpuId_ECX(1) & X86_CPUID_FEATURE_ECX_FMA)
+            enmSup = kCpuWithFma3;
+        else if (ASMCpuId_ECX(UINT32_C(0x80000001)) & X86_CPUID_AMD_FEATURE_ECX_FMA4)
+            enmSup = kCpuWithFma4;
+        else
+            enmSup = kCpuWithoutFma;
+        s_enmSup = enmSup;
+    }
+    if (enmSup == kCpuWithFma3)
+        return rtNoCrtMathFma3f(r32Factor1, r32Factor2, r32Addend);
+    if (enmSup == kCpuWithFma4)
+        return rtNoCrtMathFma4f(r32Factor1, r32Factor2, r32Addend);
+#endif
+
+    /*
+     * Fall back on SoftFloat.
+     */
+    /** @todo couldn't we just use double as a fallback here? */
+    AssertCompile(sizeof(r32Factor1) == sizeof(RTFLOAT32U));
+    softfloat_state_t State = SOFTFLOAT_STATE_INIT_DEFAULTS(); /** @todo init from MXCSR/FCW */
+    union { RTFLOAT32U Iprt; float32_t SoftFloat; } uFactor1, uFactor2, uAddend, uResult;
+    uFactor1.Iprt.r = r32Factor1;
+    uFactor2.Iprt.r = r32Factor2;
+    uAddend.Iprt.r  = r32Addend;
+    uResult.SoftFloat = f32_mulAdd(uFactor1.SoftFloat, uFactor2.SoftFloat, uAddend.SoftFloat, &State);
+    return uResult.Iprt.r;
+}
+RT_ALIAS_AND_EXPORT_NOCRT_SYMBOL(fmaf);
+
