Index: trunk/src/libs/softfloat-3e/source/extF80_sincos.c
===================================================================
--- trunk/src/libs/softfloat-3e/source/extF80_sincos.c	(revision 96965)
+++ trunk/src/libs/softfloat-3e/source/extF80_sincos.c	(revision 97160)
@@ -1,5 +1,5 @@
 /* $Id$ */
 /** @file
- * SoftFloat - VBox Extension - extF80_sin, extF80_cos, extF80_sincos.
+ * SoftFloat - VBox Extension - extF80_sin, extF80_cos, extF80_sincos, extF80_atan2.
  */
 
@@ -86,4 +86,46 @@
 }
 
+static float128_t cordic_atan2( float128_t y, float128_t x SOFTFLOAT_STATE_DECL_COMMA )
+{
+    float128_t v1 = { { 0, 0 } }; /* MSC thinks it can be used uninitialized */
+    float128_t v2 = { { 0, 0 } }; /* MSC thinks it can be used uninitialized */
+    /** @todo TBD: CORDIC kernel should be easily implemented in assembly *   */
+
+    float128_t x1 = x, x2 = y;
+    float128_t z = ui32_to_f128(0, pState);
+    float128_t zero = ui32_to_f128(0, pState);
+    float128_t p2m = ui32_to_f128(1, pState);
+    float128_t two = ui32_to_f128(2, pState);
+
+    for (unsigned k = 0; k < RT_ELEMENTS(g_ar128FsincosCORDICConsts); k++)
+    {
+        float128_t atg   = *(float128_t *)&g_ar128FsincosCORDICConsts[k];
+        float128_t scale = *(float128_t *)&g_ar128FsincosCORDICConsts2[k];
+
+        float128_t px1 = f128_mul(x1, p2m, pState);
+        float128_t px2 = f128_mul(x2, p2m, pState);
+
+        if (f128_le(x2, zero, pState))
+        {
+            x1 = f128_sub(x1, px2, pState);
+            x2 = f128_add(x2, px1, pState);
+            z = f128_sub(z, atg, pState);
+        }
+        else
+        {
+            x1 = f128_add(x1, px2, pState);
+            x2 = f128_sub(x2, px1, pState);
+            z = f128_add(z, atg, pState);
+        }
+
+        p2m = f128_div(p2m, two, pState);
+
+        v1 = f128_mul(x1, scale, pState);
+        v2 = f128_mul(x2, scale, pState);
+    }
+
+    return z;
+}
+
 extFloat80_t extF80_sin( extFloat80_t x SOFTFLOAT_STATE_DECL_COMMA )
 {
@@ -242,2 +284,40 @@
     *pSin = f128_to_extF80(vSin, pState);
 }
+
+extFloat80_t extF80_atan2( extFloat80_t f80y, extFloat80_t f80x SOFTFLOAT_STATE_DECL_COMMA )
+{
+    float128_t v;
+    int32_t fSignX = 0, fSignY = 0;
+    float128_t f128zero = ui32_to_f128(0, pState);
+    float128_t y = extF80_to_f128(f80y, pState);
+    float128_t x = extF80_to_f128(f80x, pState);
+
+    if (f128_le(x, f128zero, pState))
+    {
+        x = f128_sub(f128zero, x, pState);
+        fSignX = 1;
+    }
+
+    if (f128_le(y, f128zero, pState))
+    {
+        y = f128_sub(f128zero, y, pState);
+        fSignY = 1;
+    }
+
+    v = cordic_atan2(y, x, pState);
+
+    if (fSignX)
+    {
+        if (fSignY)
+            v = f128_sub(v, *(float128_t const *)&g_r128pi, pState);
+        else
+            v = f128_sub(*(float128_t const *)&g_r128pi, v, pState);
+    }
+    else
+    {
+        if (fSignY)
+            v = f128_sub(f128zero, v, pState);
+    }
+
+    return f128_to_extF80(v, pState);
+}
Index: trunk/src/libs/softfloat-3e/source/extF80_sincos.h
===================================================================
--- trunk/src/libs/softfloat-3e/source/extF80_sincos.h	(revision 96965)
+++ trunk/src/libs/softfloat-3e/source/extF80_sincos.h	(revision 97160)
@@ -31,4 +31,10 @@
 # pragma once
 #endif
+
+/** The pi constant as 128-bit floating point value.
+ * base-10: 3.14159265358979323846264338327950279
+ * base-16: 3.243f6a8885a308d313198a2e0370
+ * base-2 : 1.1001001000011111101101010100010001000010110100011000010001101001100010011000110011000101000101110000000110111000e1 */
+const RTFLOAT128U g_r128pi = RTFLOAT128U_INIT_C(0, 0x921fb54442d1, 0x8469898cc51701b8, 0x4000);
 
 /** The pi/2 constant as 128-bit floating point value.
Index: trunk/src/libs/softfloat-3e/source/include/softfloat.h
===================================================================
--- trunk/src/libs/softfloat-3e/source/include/softfloat.h	(revision 96965)
+++ trunk/src/libs/softfloat-3e/source/include/softfloat.h	(revision 97160)
@@ -303,4 +303,5 @@
 extFloat80_t extF80_cos( extFloat80_t SOFTFLOAT_STATE_DECL_COMMA );
 void extF80_sincos( extFloat80_t, extFloat80_t*, extFloat80_t* SOFTFLOAT_STATE_DECL_COMMA );
+extFloat80_t extF80_atan2( extFloat80_t y, extFloat80_t x SOFTFLOAT_STATE_DECL_COMMA );
 extFloat80_t extF80_ylog2x( extFloat80_t, extFloat80_t SOFTFLOAT_STATE_DECL_COMMA );
 extFloat80_t extF80_ylog2xp1( extFloat80_t, extFloat80_t SOFTFLOAT_STATE_DECL_COMMA );
