Why is it that no one writes with portability in mind in druntime?

IgorStepanov wazar at mail.ru
Mon Nov 25 13:44:49 PST 2013


On Sunday, 24 November 2013 at 11:38:27 UTC, Iain Buclaw wrote:
> https://github.com/D-Programming-Language/druntime/pull/663

This code is not portable only on CTFE part. (All those float 
manipulations run at compile time)
I see three unportable aspects:
1. This code supports only 80bit real. What other formats we need 
to support? Can  the compiler support operations on those (or 
more precise) formats? AFAIK dmd frontend perform all float 
operations in 80 bit real and supports only x86.
2. This code don't considers a float byte order. But compiler 
don't inform user code about float BO. There are 
LittleEndian/BigEndian versions for integers, but not for floats. 
You can add this versions on compiler and I'll fix this aspect in 
druntime code.
3. FloatTraits. Yes, thay works only with x86. Please, get link 
to other supported float formats and I'll extend FloatTraits to 
those formats.

P.S. This PR expected pull during month. You could write you 
portability suggestion in the discussion.
P.P.S. This is experemental CTFE float->ubyte[] code. It can be 
fixed later and don't break any existing code.


More information about the Digitalmars-d mailing list