mirror of
https://github.com/xomboverlord/ldc.git
synced 2026-01-25 09:03:14 +01:00
Updated tango patch. tango.math.Math was incorrect.
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
Index: object.di
|
||||
===================================================================
|
||||
--- object.di (revision 3819)
|
||||
--- object.di (revision 3831)
|
||||
+++ object.di (working copy)
|
||||
@@ -150,6 +150,9 @@
|
||||
void function() dtor;
|
||||
@@ -14,7 +14,7 @@ Index: object.di
|
||||
|
||||
Index: lib/common/tango/core/BitManip.d
|
||||
===================================================================
|
||||
--- lib/common/tango/core/BitManip.d (revision 3819)
|
||||
--- lib/common/tango/core/BitManip.d (revision 3831)
|
||||
+++ lib/common/tango/core/BitManip.d (working copy)
|
||||
@@ -171,6 +171,10 @@
|
||||
*/
|
||||
@@ -29,7 +29,7 @@ Index: lib/common/tango/core/BitManip.d
|
||||
public import std.intrinsic;
|
||||
Index: lib/common/tango/core/Thread.d
|
||||
===================================================================
|
||||
--- lib/common/tango/core/Thread.d (revision 3819)
|
||||
--- lib/common/tango/core/Thread.d (revision 3831)
|
||||
+++ lib/common/tango/core/Thread.d (working copy)
|
||||
@@ -244,10 +244,33 @@
|
||||
}
|
||||
@@ -96,7 +96,7 @@ Index: lib/common/tango/core/Thread.d
|
||||
|
||||
Index: lib/gc/basic/gcx.d
|
||||
===================================================================
|
||||
--- lib/gc/basic/gcx.d (revision 3819)
|
||||
--- lib/gc/basic/gcx.d (revision 3831)
|
||||
+++ lib/gc/basic/gcx.d (working copy)
|
||||
@@ -2178,6 +2178,28 @@
|
||||
__builtin_unwind_init();
|
||||
@@ -140,7 +140,7 @@ Index: lib/gc/basic/gcx.d
|
||||
asm
|
||||
Index: lib/gc/basic/gcbits.d
|
||||
===================================================================
|
||||
--- lib/gc/basic/gcbits.d (revision 3819)
|
||||
--- lib/gc/basic/gcbits.d (revision 3831)
|
||||
+++ lib/gc/basic/gcbits.d (working copy)
|
||||
@@ -39,6 +39,10 @@
|
||||
{
|
||||
@@ -155,7 +155,7 @@ Index: lib/gc/basic/gcbits.d
|
||||
version = Asm86;
|
||||
Index: tango/text/convert/Layout.d
|
||||
===================================================================
|
||||
--- tango/text/convert/Layout.d (revision 3819)
|
||||
--- tango/text/convert/Layout.d (revision 3831)
|
||||
+++ tango/text/convert/Layout.d (working copy)
|
||||
@@ -47,6 +47,12 @@
|
||||
alias void* Arg;
|
||||
@@ -192,7 +192,7 @@ Index: tango/text/convert/Layout.d
|
||||
long[64] longargs = void;
|
||||
Index: tango/core/Vararg.d
|
||||
===================================================================
|
||||
--- tango/core/Vararg.d (revision 3819)
|
||||
--- tango/core/Vararg.d (revision 3831)
|
||||
+++ tango/core/Vararg.d (working copy)
|
||||
@@ -15,6 +15,10 @@
|
||||
{
|
||||
@@ -207,7 +207,7 @@ Index: tango/core/Vararg.d
|
||||
/**
|
||||
Index: tango/math/Math.d
|
||||
===================================================================
|
||||
--- tango/math/Math.d (revision 3819)
|
||||
--- tango/math/Math.d (revision 3831)
|
||||
+++ tango/math/Math.d (working copy)
|
||||
@@ -76,7 +76,77 @@
|
||||
version = DigitalMars_D_InlineAsm_X86;
|
||||
@@ -218,10 +218,10 @@ Index: tango/math/Math.d
|
||||
+ private
|
||||
+ {
|
||||
|
||||
+ pragma(LLVM_internal, "intrinsic", "llvm.sqrt.f32")
|
||||
+ float llvm_sqrt(float);
|
||||
+ pragma(LLVM_internal, "intrinsic", "llvm.sqrt.f64")
|
||||
+ double llvm_sqrt(double);
|
||||
+ pragma(intrinsic, "llvm.sqrt.f32")
|
||||
+ float sqrt(float);
|
||||
+ pragma(intrinsic, "llvm.sqrt.f64")
|
||||
+ double sqrt(double);
|
||||
+
|
||||
+ version(LLVM_X86_FP80)
|
||||
+ {
|
||||
@@ -235,7 +235,7 @@ Index: tango/math/Math.d
|
||||
+ alias tango.stdc.math.tanhl llvm_tanh;
|
||||
+ alias tango.stdc.math.cbrtl llvm_cbrt;
|
||||
+ alias tango.stdc.math.expl llvm_exp;
|
||||
+ alias tango.stdc.math.exp1ml llvm_exp1m;
|
||||
+ alias tango.stdc.math.expm1l llvm_expm1;
|
||||
+ alias tango.stdc.math.exp2l llvm_exp2;
|
||||
+ alias tango.stdc.math.logl llvm_log;
|
||||
+ alias tango.stdc.math.log1pl llvm_log1p;
|
||||
@@ -245,12 +245,12 @@ Index: tango/math/Math.d
|
||||
+ alias tango.stdc.math.lrintl llvm_lrint;
|
||||
+ alias tango.stdc.math.llrintl llvm_llrint;
|
||||
+
|
||||
+ pragma(LLVM_internal, "intrinsic", "llvm.cos.f80")
|
||||
+ real llvm_cos(real);
|
||||
+ pragma(LLVM_internal, "intrinsic", "llvm.sin.f80")
|
||||
+ real llvm_sin(real);
|
||||
+ pragma(LLVM_internal, "intrinsic", "llvm.sqrt.f80")
|
||||
+ real llvm_sqrt(real);
|
||||
+ pragma(intrinsic, "llvm.cos.f80")
|
||||
+ real cos(real);
|
||||
+ pragma(intrinsic, "llvm.sin.f80")
|
||||
+ real sin(real);
|
||||
+ pragma(intrinsic, "llvm.sqrt.f80")
|
||||
+ real sqrt(real);
|
||||
+ }
|
||||
+ else
|
||||
+ {
|
||||
@@ -264,7 +264,7 @@ Index: tango/math/Math.d
|
||||
+ alias tango.stdc.math.tanh llvm_tanh;
|
||||
+ alias tango.stdc.math.cbrt llvm_cbrt;
|
||||
+ alias tango.stdc.math.exp llvm_exp;
|
||||
+ alias tango.stdc.math.exp1m llvm_exp1m;
|
||||
+ alias tango.stdc.math.expm1 llvm_expm1;
|
||||
+ alias tango.stdc.math.exp2 llvm_exp2;
|
||||
+ alias tango.stdc.math.log llvm_log;
|
||||
+ alias tango.stdc.math.log1p llvm_log1p;
|
||||
@@ -274,12 +274,12 @@ Index: tango/math/Math.d
|
||||
+ alias tango.stdc.math.lrint llvm_lrint;
|
||||
+ alias tango.stdc.math.llrint llvm_llrint;
|
||||
+
|
||||
+ pragma(LLVM_internal, "intrinsic", "llvm.cos.f64")
|
||||
+ real llvm_cos(real);
|
||||
+ pragma(LLVM_internal, "intrinsic", "llvm.sin.f64")
|
||||
+ real llvm_sin(real);
|
||||
+ pragma(LLVM_internal, "intrinsic", "llvm.sqrt.f64")
|
||||
+ real llvm_sqrt(real);
|
||||
+ pragma(intrinsic, "llvm.cos.f64")
|
||||
+ real cos(real);
|
||||
+ pragma(intrinsic, "llvm.sin.f64")
|
||||
+ real sin(real);
|
||||
+ pragma(intrinsic, "llvm.sqrt.f64")
|
||||
+ real sqrt(real);
|
||||
+ }
|
||||
+ }
|
||||
+}
|
||||
@@ -287,29 +287,45 @@ Index: tango/math/Math.d
|
||||
/*
|
||||
* Constants
|
||||
*/
|
||||
@@ -300,6 +370,10 @@
|
||||
@@ -298,6 +368,10 @@
|
||||
* Bugs:
|
||||
* Results are undefined if |x| >= $(POWER 2,64).
|
||||
*/
|
||||
+version(LLVMDC)
|
||||
+{}
|
||||
+else
|
||||
+{
|
||||
real cos(real x) /* intrinsic */
|
||||
{
|
||||
+ version(LLVMDC)
|
||||
+ {
|
||||
+ return llvm_cos(x);
|
||||
+ }
|
||||
version(D_InlineAsm_X86)
|
||||
{
|
||||
asm
|
||||
@@ -335,6 +409,10 @@
|
||||
@@ -313,6 +387,7 @@
|
||||
return tango.stdc.math.cosl(x);
|
||||
}
|
||||
}
|
||||
+}
|
||||
|
||||
debug(UnitTest) {
|
||||
unittest {
|
||||
@@ -333,6 +408,10 @@
|
||||
* Bugs:
|
||||
* Results are undefined if |x| >= $(POWER 2,64).
|
||||
*/
|
||||
+version(LLVMDC)
|
||||
+{}
|
||||
+else
|
||||
+{
|
||||
real sin(real x) /* intrinsic */
|
||||
{
|
||||
+ version(LLVMDC)
|
||||
+ {
|
||||
+ return llvm_sin(x);
|
||||
+ }
|
||||
version(D_InlineAsm_X86)
|
||||
{
|
||||
asm
|
||||
@@ -374,6 +452,9 @@
|
||||
@@ -348,6 +427,7 @@
|
||||
return tango.stdc.math.sinl(x);
|
||||
}
|
||||
}
|
||||
+}
|
||||
|
||||
debug(UnitTest) {
|
||||
unittest {
|
||||
@@ -374,6 +454,9 @@
|
||||
{
|
||||
version (GNU) {
|
||||
return tanl(x);
|
||||
@@ -319,7 +335,7 @@ Index: tango/math/Math.d
|
||||
} else {
|
||||
asm
|
||||
{
|
||||
@@ -576,7 +657,14 @@
|
||||
@@ -576,7 +659,14 @@
|
||||
*/
|
||||
real acos(real x)
|
||||
{
|
||||
@@ -335,7 +351,7 @@ Index: tango/math/Math.d
|
||||
}
|
||||
|
||||
debug(UnitTest) {
|
||||
@@ -599,7 +687,14 @@
|
||||
@@ -599,7 +689,14 @@
|
||||
*/
|
||||
real asin(real x)
|
||||
{
|
||||
@@ -351,7 +367,7 @@ Index: tango/math/Math.d
|
||||
}
|
||||
|
||||
debug(UnitTest) {
|
||||
@@ -621,7 +716,14 @@
|
||||
@@ -621,7 +718,14 @@
|
||||
*/
|
||||
real atan(real x)
|
||||
{
|
||||
@@ -367,23 +383,23 @@ Index: tango/math/Math.d
|
||||
}
|
||||
|
||||
debug(UnitTest) {
|
||||
@@ -658,7 +760,14 @@
|
||||
@@ -658,7 +762,14 @@
|
||||
*/
|
||||
real atan2(real y, real x)
|
||||
{
|
||||
- return tango.stdc.math.atan2l(y,x);
|
||||
+ version(LLVMDC)
|
||||
+ {
|
||||
+ return llvm_atan2(x);
|
||||
+ return llvm_atan2(y,x);
|
||||
+ }
|
||||
+ else
|
||||
+ {
|
||||
+ return tango.stdc.math.atan2l(x);
|
||||
+ return tango.stdc.math.atan2l(y,x);
|
||||
+ }
|
||||
}
|
||||
|
||||
debug(UnitTest) {
|
||||
@@ -707,7 +816,14 @@
|
||||
@@ -707,7 +818,14 @@
|
||||
*/
|
||||
real cosh(real x)
|
||||
{
|
||||
@@ -399,7 +415,7 @@ Index: tango/math/Math.d
|
||||
}
|
||||
|
||||
debug(UnitTest) {
|
||||
@@ -728,7 +844,14 @@
|
||||
@@ -728,7 +846,14 @@
|
||||
*/
|
||||
real sinh(real x)
|
||||
{
|
||||
@@ -415,7 +431,7 @@ Index: tango/math/Math.d
|
||||
}
|
||||
|
||||
debug(UnitTest) {
|
||||
@@ -749,7 +872,14 @@
|
||||
@@ -749,7 +874,14 @@
|
||||
*/
|
||||
real tanh(real x)
|
||||
{
|
||||
@@ -431,49 +447,26 @@ Index: tango/math/Math.d
|
||||
}
|
||||
|
||||
debug(UnitTest) {
|
||||
@@ -949,8 +1079,12 @@
|
||||
@@ -947,6 +1079,10 @@
|
||||
* <tr> <td> +∞ <td> +∞ <td> no
|
||||
* )
|
||||
*/
|
||||
+version(LLVMDC)
|
||||
+{}
|
||||
+else
|
||||
+{
|
||||
float sqrt(float x) /* intrinsic */
|
||||
{
|
||||
- version(D_InlineAsm_X86)
|
||||
+ version(LLVMDC)
|
||||
{
|
||||
+ return llvm_sqrt_f32(x);
|
||||
+ }
|
||||
+ else version(D_InlineAsm_X86)
|
||||
+ {
|
||||
asm
|
||||
{
|
||||
fld x;
|
||||
@@ -965,8 +1099,12 @@
|
||||
version(D_InlineAsm_X86)
|
||||
@@ -994,6 +1130,7 @@
|
||||
return tango.stdc.math.sqrtl(x);
|
||||
}
|
||||
}
|
||||
+}
|
||||
|
||||
double sqrt(double x) /* intrinsic */ /// ditto
|
||||
{
|
||||
- version(D_InlineAsm_X86)
|
||||
+ version(LLVMDC)
|
||||
{
|
||||
+ return llvm_sqrt_f64(x);
|
||||
+ }
|
||||
+ else version(D_InlineAsm_X86)
|
||||
+ {
|
||||
asm
|
||||
{
|
||||
fld x;
|
||||
@@ -981,8 +1119,12 @@
|
||||
|
||||
real sqrt(real x) /* intrinsic */ /// ditto
|
||||
{
|
||||
- version(D_InlineAsm_X86)
|
||||
+ version(LLVMDC)
|
||||
{
|
||||
+ return llvm_sqrt_f80(x);
|
||||
+ }
|
||||
+ else version(D_InlineAsm_X86)
|
||||
+ {
|
||||
asm
|
||||
{
|
||||
fld x;
|
||||
@@ -1045,7 +1187,14 @@
|
||||
/** ditto */
|
||||
creal sqrt(creal z)
|
||||
@@ -1045,7 +1182,14 @@
|
||||
*/
|
||||
real cbrt(real x)
|
||||
{
|
||||
@@ -489,7 +482,7 @@ Index: tango/math/Math.d
|
||||
}
|
||||
|
||||
|
||||
@@ -1067,7 +1216,14 @@
|
||||
@@ -1067,7 +1211,14 @@
|
||||
*/
|
||||
real exp(real x)
|
||||
{
|
||||
@@ -505,7 +498,7 @@ Index: tango/math/Math.d
|
||||
}
|
||||
|
||||
debug(UnitTest) {
|
||||
@@ -1093,7 +1249,14 @@
|
||||
@@ -1093,7 +1244,14 @@
|
||||
*/
|
||||
real expm1(real x)
|
||||
{
|
||||
@@ -521,7 +514,7 @@ Index: tango/math/Math.d
|
||||
}
|
||||
|
||||
debug(UnitTest) {
|
||||
@@ -1115,7 +1278,14 @@
|
||||
@@ -1115,7 +1273,14 @@
|
||||
*/
|
||||
real exp2(real x)
|
||||
{
|
||||
@@ -537,7 +530,7 @@ Index: tango/math/Math.d
|
||||
}
|
||||
|
||||
debug(UnitTest) {
|
||||
@@ -1141,7 +1311,14 @@
|
||||
@@ -1141,7 +1306,14 @@
|
||||
*/
|
||||
real log(real x)
|
||||
{
|
||||
@@ -553,7 +546,7 @@ Index: tango/math/Math.d
|
||||
}
|
||||
|
||||
debug(UnitTest) {
|
||||
@@ -1167,7 +1344,14 @@
|
||||
@@ -1167,7 +1339,14 @@
|
||||
*/
|
||||
real log1p(real x)
|
||||
{
|
||||
@@ -569,7 +562,7 @@ Index: tango/math/Math.d
|
||||
}
|
||||
|
||||
debug(UnitTest) {
|
||||
@@ -1190,7 +1374,14 @@
|
||||
@@ -1190,7 +1369,14 @@
|
||||
*/
|
||||
real log2(real x)
|
||||
{
|
||||
@@ -585,7 +578,7 @@ Index: tango/math/Math.d
|
||||
}
|
||||
|
||||
debug(UnitTest) {
|
||||
@@ -1212,7 +1403,14 @@
|
||||
@@ -1212,7 +1398,14 @@
|
||||
*/
|
||||
real log10(real x)
|
||||
{
|
||||
@@ -601,7 +594,7 @@ Index: tango/math/Math.d
|
||||
}
|
||||
|
||||
debug(UnitTest) {
|
||||
@@ -1477,7 +1675,14 @@
|
||||
@@ -1477,7 +1670,14 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -617,7 +610,7 @@ Index: tango/math/Math.d
|
||||
}
|
||||
|
||||
debug(UnitTest) {
|
||||
@@ -1823,6 +2028,10 @@
|
||||
@@ -1823,6 +2023,10 @@
|
||||
}
|
||||
return n;
|
||||
}
|
||||
@@ -628,7 +621,7 @@ Index: tango/math/Math.d
|
||||
else
|
||||
{
|
||||
return tango.stdc.math.lrintl(x);
|
||||
@@ -1842,6 +2051,10 @@
|
||||
@@ -1842,6 +2046,10 @@
|
||||
}
|
||||
return n;
|
||||
}
|
||||
@@ -641,7 +634,7 @@ Index: tango/math/Math.d
|
||||
return tango.stdc.math.llrintl(x);
|
||||
Index: tango/stdc/stdlib.d
|
||||
===================================================================
|
||||
--- tango/stdc/stdlib.d (revision 3819)
|
||||
--- tango/stdc/stdlib.d (revision 3831)
|
||||
+++ tango/stdc/stdlib.d (working copy)
|
||||
@@ -94,6 +94,11 @@
|
||||
{
|
||||
@@ -657,7 +650,7 @@ Index: tango/stdc/stdlib.d
|
||||
private import gcc.builtins;
|
||||
Index: tango/stdc/stdarg.d
|
||||
===================================================================
|
||||
--- tango/stdc/stdarg.d (revision 3819)
|
||||
--- tango/stdc/stdarg.d (revision 3831)
|
||||
+++ tango/stdc/stdarg.d (working copy)
|
||||
@@ -13,6 +13,10 @@
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user