yl2x is a DigitalMars-specific builtin#4671
Conversation
|
The y2lx instruction is x86 specific, not Digital Mars specific. |
|
Is |
No. Just provide a yl2x function in the GDC port. |
I'd rather not. There is no way to map it to any architecture (even x86) on my side. |
|
Why wouldn't inline assembler work? |
|
It goes against convention - and will be a red flag for any reviewers in upstream GCC. It's difficult enough fixing the front-end so it doesn't care about what target it is generating code for, let alone what host we will be running on. |
|
This change means that ddmd built with gdc won't be able to evaluate the yl2x intrinsics at compile time, while dmd built with gcc can? Does gcc/gdc really not provide this builtin in some way? |
|
Sorry, hit wrong button. |
You're lucky I'll be absent next week, or you will have something to be sorry about... :-)
There's log2l, but it will produce wildly different results from |
You're not coming this year?
Hmm ok. Do we have a ctfeable implementation in core.math? If so, can we just completely remove ctfe builtin support? It seems like much too obscure a thing to have compiler code dedicated to it. I don't want a compiler built by dmd and a compiler built by gdc to have different capabilities, I'm sure you can agree. |
No.
This is what I said in the original PR for CTFE-yl2x! You still merged it in despite my warnings.
On that note, |
Oh yeah, it doesn't need to be ctfeable. Just present. Does GDC druntime not provide this either?
I didn't merge it.
What's so problematic about But yeah, we should probably avoid adding ctfe intrinsics that depend on the host compiler/runtime. |
It's a weird half/half. DMD recognises it as a CTFE-able builtin, but runtime it uses inline assembler. For simplicity on my part, I only implement body-less functions in std.math/core.math as intrinsics. |
|
And... I found a case where the implied use of yl2x broke gdc, along with every non-x86 target. dlang/phobos#3309 Sigh - We should put a stop to this by removing uses of yl2x from std.math. They might have been useful in the beginning. But not anymore. |
|
Or by implementing a portable version somewhere. |
It's caled |
yl2x is a DigitalMars-specific builtin
Fix linker errors building with gdc, much more to come... :-)