Skip to content

Commit

Permalink
Remove special case powexp optimisation
Browse files Browse the repository at this point in the history
  • Loading branch information
Iain Buclaw committed Dec 25, 2013
1 parent e454136 commit 9692553
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 11 deletions.
10 changes: 0 additions & 10 deletions src/constfold.c
Expand Up @@ -536,16 +536,6 @@ Expression *Pow(Type *type, Expression *e1, Expression *e2)
{
e = new RealExp(loc, Port::ldbl_nan, type);
}
else if (e2->toReal() == 0.5)
{
// Special case: call sqrt directly.
Expressions args;
args.setDim(1);
args[0] = e1;
e = eval_builtin(loc, BUILTINsqrt, &args);
if (!e)
e = EXP_CANT_INTERPRET;
}
else
e = EXP_CANT_INTERPRET;
}
Expand Down
2 changes: 1 addition & 1 deletion test/runnable/constfold.d
Expand Up @@ -3,7 +3,7 @@
static assert(__LINE__ == 3); // fails as __LINE__ is 2

import std.stdio;
import std.math : signbit;
import std.math : signbit, sqrt;


/************************************/
Expand Down

0 comments on commit 9692553

Please sign in to comment.