www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - -nofloat flag => should we destroy it?

reply "Andrej Mitrovic" <andrej.mitrovich gmail.com> writes:
See: https://issues.dlang.org/show_bug.cgi?id=8196

Are there any D platforms where -nofloat is useful? If we're not 
getting rid of it then it needs to be documented (the above 
issue).
Apr 22 2014
parent reply "Mike" <none none.com> writes:
On Tuesday, 22 April 2014 at 23:57:49 UTC, Andrej Mitrovic wrote:
 See: https://issues.dlang.org/show_bug.cgi?id=8196

 Are there any D platforms where -nofloat is useful? If we're 
 not getting rid of it then it needs to be documented (the above 
 issue).
Well, I couldn't find any documentation on what this means, so I can't really say. Does it disable floating point usage completely, or does it force software emulation? There are a couple people in this community interested in bringing D to 32-bit microcontrollers. Most of the 32-bit ARM Cortex microcontrollers don't have an FPU. For the few that do, here are the attributes in GCC (http://gcc.gnu.org/onlinedocs/gcc/ARM-Options.html) needed to specify the configuration. -mfloat-abi=name -mfpu=name -mfp16-format=name But, these are target specific. Since DMD doesn't support any ARM platform, I suspect this is irrelevant, but there, you have it anyway. Mike
Apr 22 2014
parent reply Adam Sakareassen via Digitalmars-d <digitalmars-d puremagic.com> writes:
No float is probably important for OS kernel and device driver developers.

The kernel of an operating system will usually not save the floating 
point registers during a context switch (to the kernel).  For this 
reason its important the compiler can guarantee never to use floating 
point numbers or the registers.

Removing such a flag may prevent the compiler being used to write things 
like Linux device drivers.  I know this is usually done in C, but there 
might be an OS in D one day.


On 23/04/2014 10:22 AM, Mike via Digitalmars-d wrote:
 On Tuesday, 22 April 2014 at 23:57:49 UTC, Andrej Mitrovic wrote:
 See: https://issues.dlang.org/show_bug.cgi?id=8196

 Are there any D platforms where -nofloat is useful? If we're not
 getting rid of it then it needs to be documented (the above issue).
Well, I couldn't find any documentation on what this means, so I can't really say. Does it disable floating point usage completely, or does it force software emulation? There are a couple people in this community interested in bringing D to 32-bit microcontrollers. Most of the 32-bit ARM Cortex microcontrollers don't have an FPU. For the few that do, here are the attributes in GCC (http://gcc.gnu.org/onlinedocs/gcc/ARM-Options.html) needed to specify the configuration. -mfloat-abi=name -mfpu=name -mfp16-format=name But, these are target specific. Since DMD doesn't support any ARM platform, I suspect this is irrelevant, but there, you have it anyway. Mike
May 09 2014
parent reply "Daniel Murphy" <yebbliesnospam gmail.com> writes:
"Adam Sakareassen via Digitalmars-d"  wrote in message 
news:mailman.510.1399697057.2907.digitalmars-d puremagic.com...

 No float is probably important for OS kernel and device driver developers.

 The kernel of an operating system will usually not save the floating point 
 registers during a context switch (to the kernel).  For this reason its 
 important the compiler can guarantee never to use floating point numbers 
 or the registers.

 Removing such a flag may prevent the compiler being used to write things 
 like Linux device drivers.  I know this is usually done in C, but there 
 might be an OS in D one day.
DMD will likely never be used for that anyway, and I seriously doubt -nofloat works correctly these days.
May 09 2014
parent "Qox" <robertw89 googlemail.com> writes:
if you say so... (and god spoke "there will be light"...and there 
was light)

I just mean, if you restrict users to some subset of 
possibilities they will never be easily able to explore the wider 
space of the set/superset...
May 28 2014