[Issue 3749] cannot evaluate yl2x (log) and exp functions at compile time

d-bugmail at puremagic.com d-bugmail at puremagic.com
Wed Jan 8 17:07:33 PST 2014


https://d.puremagic.com/issues/show_bug.cgi?id=3749



--- Comment #15 from Martin Nowak <code at dawg.eu> 2014-01-08 17:07:23 PST ---
(In reply to comment #13)

> We don't implement y2lx in GDC, so it uses the !INLINE_Y2LX implemenatation. :)

At runtime? I'm quite surprised to hear that, isn't the performance a bummer
compared to the X87 instruction? On other platforms this might not an argument
though.

(In reply to comment #14)
> > > Something like exponent(float), signbit(float), mantissa(float)?
> 
> Something like this was suggested and discarded IIRC.  I'm not sure how I would
> be able to do this from within GCC's infrastructure - or at least return
> meaningful / usable data in the case of exponent and mantissa bits. :)

Well the parse(Float)(Float f) function only uses normal CTFE floating point
computations to determine these values.
https://github.com/D-Programming-Language/druntime/blob/a977a65ac7df366c002033c43e11cd05925a25fb/src/core/internal/convert.d#L91
It's quite complex, so you can see how desperate we are to get CT hashing.
Although we might disable CT hashing for floats if this gets out of hand.

-- 
Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list