implement ctfe yl2x and yl2xp1#4012
Conversation
|
@ibuclaw Please, check my *nix inline assebler code. Is it ok? |
31f0e0a to
65d847c
Compare
You can implement x64 asm for VC in vcbuild/ldfpu.asm. |
|
Ok |
65d847c to
6fe4b48
Compare
There was a problem hiding this comment.
Why float64 instead of float80?
There was a problem hiding this comment.
I don't know. I did it similar examples like eval_sqrt
Expression *eval_sqrt(Loc loc, FuncDeclaration *fd, Expressions *arguments)
{
Expression *arg0 = (*arguments)[0];
assert(arg0->op == TOKfloat64);
return new RealExp(loc, Port::sqrt(arg0->toReal()), arg0->type);
}
Maybe CTFE stores all floating numbers with op == TOKfloat64
There was a problem hiding this comment.
Hmm, you're right, the others do it too.
|
GDC can't use this, but this is not touching any shared code anyway. |
test/fail_compilation/fail11332.d
Outdated
There was a problem hiding this comment.
Actually, rndtol may be CTFE-able in GDC - I'll have to check this in detail.
There was a problem hiding this comment.
> cat test.d
import std.math : rndtol;
static x = rndtol(1.2);
pragma(msg, rndtol(1.2));
> gdc test.d -S
1L
There was a problem hiding this comment.
Maybe I should remove this test?
There was a problem hiding this comment.
I've removed it.
|
@ibuclaw Please comment the next code: Is it ok? It works, but I'm scared by unused assembler syntax. Do I need to add additional instructions like |
|
Added solaris support: tested with |
|
@IgorStepanov you don't need fwait with modern CPUs, and finit is only needed at program startup. |
|
Auto-merge toggled on |
implement ctfe yl2x and yl2xp1
|
Thanks!
It was needed only when x87 was implemented as separate chip?
I thinked, finit should be called after using xmm indtructions. |
|
This broke building DMD x64 with MSVC 2010. |
|
If I change
Does it work for you? |
|
Fixed it, the functions were not declared as |
There was a problem hiding this comment.
Should I create PR, which fix it? I'll do it after 3-5 hours.
|
Created #4052 Is it ok? |
This PR intriduces builtin compile-time yl2x and yl2xp1 for some platforms.
Supported platforms: DMC, VS (x86, x86_64), MinGW (x86 and x86_64), GCC (x86, x86_64), SunC(x86, x86_64).
If platform doesn't support this builtin, "cannot evaluate unimplemented builtin..." error will be raised as it was early.