Why don't we switch to C like floating pointed arithmetic instead of automatic expansion to reals?

David Nadlinger via Digitalmars-d digitalmars-d at puremagic.com
Sat Aug 6 13:12:10 PDT 2016


On Saturday, 6 August 2016 at 10:02:25 UTC, Iain Buclaw wrote:
> No pragmas tied to a specific architecture should be allowed in 
> the language spec, please.

I wholeheartedly agree. However, it's not like FP optimisation 
pragmas would be specific to any particular architecture. They 
just describe classes of transformations that are allowed on top 
of the standard semantics.

For example, whether transforming `a + (b * c)` into a single 
operation is allowed is not a question of the target architecture 
at all, but rather whether the implicit rounding after evaluating 
(b * c) can be skipped or not. While this in turn of course 
enables the compiler to use FMA instructions on x86/AVX, 
ARM/NEON, PPC, …, it is not architecture-specific at all on a 
conceptual level.

  — David


More information about the Digitalmars-d mailing list