Skip to content

Commit

Permalink
std.math: Check if dmd-style inline asm is available
Browse files Browse the repository at this point in the history
  • Loading branch information
jpf91 committed Apr 28, 2014
1 parent 86c8314 commit f0704ef
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 @@ -2187,7 +2193,7 @@ unittest
*/
int ilogb(real x) @trusted nothrow
{
version (Win64)
version (Win64_DMD_InlineAsm)
{
asm
{
Expand Down Expand Up @@ -2737,7 +2743,7 @@ unittest
*/
real logb(real x) @trusted nothrow
{
version (Win64)
version (Win64_DMD_InlineAsm)
{
asm
{
Expand Down Expand Up @@ -2861,7 +2867,10 @@ real cbrt(real x) @trusted nothrow
{
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 @@ -2991,7 +3000,7 @@ unittest
*/
real ceil(real x) @trusted pure nothrow
{
version (Win64)
version (Win64_DMD_InlineAsm)
{
asm
{
Expand Down Expand Up @@ -3044,7 +3053,7 @@ unittest
*/
real floor(real x) @trusted pure nothrow
{
version (Win64)
version (Win64_DMD_InlineAsm)
{
asm
{
Expand Down Expand Up @@ -3394,7 +3403,7 @@ version(Posix)
*/
real trunc(real x) @trusted nothrow
{
version (Win64)
version (Win64_DMD_InlineAsm)
{
asm
{
Expand Down

0 comments on commit f0704ef

Please sign in to comment.