port longdouble.* to D to allow building dmd with LDC on Windows#7339
port longdouble.* to D to allow building dmd with LDC on Windows#7339dlang-bot merged 1 commit intodlang:masterfrom
Conversation
|
Thanks for your pull request, @rainers! Bugzilla referencesYour PR doesn't reference any Bugzilla issue. If your PR contains non-trivial changes, please reference a Bugzilla issue or create a manual changelog. Testing this PR locallyIf you don't have a local development environment setup, you can use Digger to test this PR: dub fetch digger
dub run digger -- build "master + dmd#7339" |
|
Interesting work; it also paves the way for LDC on MSVC hosts to use 80-bit compile-time reals, which would be required for proper cross-compilation to other x86(_64) targets with 80-bit reals (although probably more work is needed to support all CTFE builtins).
Also very interesting. |
|
I'd hate to say told you so, when I argued why aliasing longdouble to real is an implementation regression. |
I don't remember all the details ;-) Would you consider this PR a step in the right direction? It removes explicit usage of |
#5237 (comment) :-)
I am doing something similar (or the same thing) in gdc port D-Programming-GDC/gdc#550 Implementation here: |
Now I remember :)
Yeah, this looks very similar. Casts to float/double seems to use integers, though, but you might not need it in GDC? It's only used by e2ir.d and iasm.d in dmd. |
Correct, there's no floating point types used in gdc, and most of gcc too. |
64b4ead to
6a18c3b
Compare
|
@rainers Seems to be abandoned ? Then better close. |
|
Native floating point should be killed and banned from the frontend compiler internals. |
6a18c3b to
77230e6
Compare
|
Rebased. Unfortunately, released LDC versions crash on the current dmd source (as all dmd versions prior to 2.078). |
77230e6 to
747df08
Compare
|
Verified with LDC master. |
|
Tests're ok |
|
No merge so far ? |
|
It bothers me that we have |
|
This PR needs to use all three, as it modifies the definitions of |
|
Thanks @klickverbot for clarifying. Should I add something similar as a comment to longdouble.*? I have rebased and retested with LDC 1.7.0, no issues. Should we add a test to the Appveyor build? That could be some work, but seems reasonable to replace dmd as the host compiler when building through VS. BTW: with longdouble implemented in D we could get rid of the ASM file and use inline assembly on all targets instead. |
|
Yes, thanks for the clarification. This explanation needs to be where the aliases are in the code. |
Yeah that would be really cool. Especially given that ideally the "official" release archives/binaries/installer should be built with LDC for better performance too. |
LDC for MSVC uses 64-bit reals similar to the C runtime, so using the longdouble struct is necessary to compile to 80-bit reals (already used when building the backend with VC).
Building the frontend with LDC (v1.6.0-beta1) has noticable effect on build times, for example the druntime/phobos unittests build about 20% faster (64-bit version with the backend built with VC for both).
Slightly OT: while building the debug version of the dmd frontend with LDC takes almost twice as much time as with DMD, the release is faster with LDC than DMD (1min05 vs. 1min34).