Skip to content

Commit

Permalink
Merge pull request #2133 from jpf91/mingw
Browse files Browse the repository at this point in the history
std.math: Check if dmd-style inline asm is available
  • Loading branch information
ibuclaw committed Jul 12, 2014
2 parents ec51209 + f0704ef commit 1e9c457
Showing 1 changed file with 15 additions and 6 deletions.
21 changes: 15 additions & 6 deletions std/math.d
Expand Up @@ -61,6 +61,12 @@
*/
module std.math;

version (Win64)
{
version (D_InlineAsm_X86_64)
version = Win64_DMD_InlineAsm;
}

import core.stdc.math;
import std.traits;

Expand Down Expand Up @@ -2273,7 +2279,7 @@ unittest
*/
int ilogb(real x) @trusted nothrow @nogc
{
version (Win64)
version (Win64_DMD_InlineAsm)
{
asm
{
Expand Down Expand Up @@ -2823,7 +2829,7 @@ unittest
*/
real logb(real x) @trusted nothrow @nogc
{
version (Win64)
version (Win64_DMD_InlineAsm)
{
asm
{
Expand Down Expand Up @@ -2947,7 +2953,10 @@ real cbrt(real x) @trusted nothrow @nogc
{
version (Win64)
{
return copysign(exp2(yl2x(fabs(x), 1.0L/3.0L)), x);
version (INLINE_YL2X)
return copysign(exp2(yl2x(fabs(x), 1.0L/3.0L)), x);
else
return core.stdc.math.cbrtl(x);
}
else
return core.stdc.math.cbrtl(x);
Expand Down Expand Up @@ -3077,7 +3086,7 @@ unittest
*/
real ceil(real x) @trusted pure nothrow @nogc
{
version (Win64)
version (Win64_DMD_InlineAsm)
{
asm
{
Expand Down Expand Up @@ -3186,7 +3195,7 @@ unittest
*/
real floor(real x) @trusted pure nothrow @nogc
{
version (Win64)
version (Win64_DMD_InlineAsm)
{
asm
{
Expand Down Expand Up @@ -3512,7 +3521,7 @@ version(Posix)
*/
real trunc(real x) @trusted nothrow @nogc
{
version (Win64)
version (Win64_DMD_InlineAsm)
{
asm
{
Expand Down

0 comments on commit 1e9c457

Please sign in to comment.