[M3devel] extended
Jay K
jay.krell at cornell.edu
Sun May 31 03:52:41 CEST 2015
Half seriously: Do we need FLOAT32, FLOAT64, FLOAT80, FLOAT128?
And some way to indicate what is available?
On many/most/but-not-all modern 32bit x86 systems, "long double" is the
same as "double". Modula-3 is in agreement with many/most/but-not-all C systems.
m3cc might be using x87 instructions on some platforms, at least sometimes.
But that doesn't change in-memory extended to other than 64 bits.
Just temporary in-register values might be 80 bits.
- Jay
Date: Sun, 31 May 2015 09:06:26 +1000
From: peter.mckinna at gmail.com
To: m3devel at elegosoft.com
Subject: [M3devel] extended
Hi
While we are on the subject of integer types can we diverge slightly to floating point types. I wonder if anyone can explain why the extended type is treated exactly the same as longreal in the frontend? They have the same sizes and ranges and precisions. As for backends, at the moment m3cc is generating 8 byte sse instructions for both types. The llvm is generating 10 byte float instructions as per its x86fp80 type which are a fair bit slower at the expense of greater range and precision. However they are not interoperable with legacy libraries and we should probably change the type to agree with m3cc and the frontend. It seems that the 8087 80 bit float is being phased out see http://csapp.cs.cmu.edu/2e/waside/waside-x87.pdfso maybe the m3 implementors saw the writing on the wall and and decided to wait for hardware to catch up. Anyway I wonder if its worth considering making extended one of the 128 bit floating point types which although emulated in software would at least give us a different type and one which would give some applications a huge precision (and range ~10^4090) boost.
Peter
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://m3lists.elegosoft.com/pipermail/m3devel/attachments/20150531/64f02a62/attachment-0002.html>
More information about the M3devel
mailing list