std.math performance (SSE vs. real)

Russel Winder via Digitalmars-d digitalmars-d at puremagic.com
Sun Jun 29 11:21:32 PDT 2014


On Sat, 2014-06-28 at 17:40 -0700, Walter Bright via Digitalmars-d
wrote:
> On 6/28/2014 3:33 AM, Russel Winder via Digitalmars-d wrote:
> > By being focused on Intel chips, D has failed to get floating point
> > correct in avery analogous way to C failing to get floating point types
> > right by focusing on PDP.
> 
> Sorry, I do not follow the reasoning here.

By being focused on specific hardware, you create names for types that
do not port to other hardware. C and C++ really do not work well on IBM
hardware because the PDP heritage of the type names does not port from
PDP to IBM hardware.

> > Yes using 80-bit on Intel is good, but no-one
> > else has this. Floating point sizes should be 32-, 64-, 128-, 256-bit,
> > etc. D needs to be able to handle this. So does C, C++, Java, etc. Go
> > will be able to handle it when it is ported to appropriate hardware as
> > they use float32, float64, etc. as their types. None of this float,
> > double, long double, double double rubbish.
> >
> > So D should perhaps make a breaking change and have types int32, int64,
> > float32, float64, float80, and get away from the vagaries of bizarre
> > type relationships with hardware?
> 
> D's spec says that the 'real' type is the max size supported by the FP hardware. 
> How is this wrong?

Because when reading the code you haven't got a f####### clue how
accurate the floating point number is until you ask and answer the
question "and which processor are you running this code on".

In many ways this is a trivial issue given C and C++ heritage, on the
other hand Go and other languages are changing the game such that C and
C++ thinking is being left behind.


-- 
Russel.
=============================================================================
Dr Russel Winder      t: +44 20 7585 2200   voip: sip:russel.winder at ekiga.net
41 Buckmaster Road    m: +44 7770 465 077   xmpp: russel at winder.org.uk
London SW11 1EN, UK   w: www.russel.org.uk  skype: russel_winder



More information about the Digitalmars-d mailing list