[Info-vax] Ada x86 (was Rdb/x86)

John Reagan xyzzy1959 at gmail.com
Tue Dec 1 11:03:58 EST 2020


On Tuesday, December 1, 2020 at 10:33:26 AM UTC-5, Arne Vajhøj wrote:
> On 12/1/2020 8:07 AM, Simon Clubley wrote: 
> > On 2020-11-30, John Dallman <j... at cix.co.uk> wrote: 
> >> Bringing back the GCC toolchain might be a good idea anyway. I've 
> >> remembered an LLVM feature that caused me trouble a few years back, which 
> >> may surprise people used to the DEC compilers. 
> >> 
> >> With GCC, and AFAIK with the DEC compilers, one can enable floating-point 
> >> traps, and get sensible results, trapping when you divide by zero, 
> >> overflow or try an invalid operation, such as sqrt(-1.0). 
> >> 
> >> GCC is well aware that floating-point operations may cause traps, and its 
> >> optimiser limits the rearrangement of code so that you don't get spurious 
> >> ones. For example if you have: 
> >> 
> >> double a, b; 
> >> ... 
> >> if ( b < really-small-number) 
> >> a = 0.0; 
> >> else 
> >> a = 1.0 / b; 
> >> 
> >> GCC won't move the divide out from under the test that guards against 
> >> divide-by-zero. 
> > 
> > Would declaring the variables volatile have avoided this reordering ? 
> > 
> > And talking of volatile, I wonder if John has encountered any cases 
> > with LLVM where variables now need to be declared volatile where they 
> > did not need to be with the DEC compilers.
> I am not a memory model expert, but everybody is saying that 
> the x86-64 memory model is easier to work with than the 
> Alpha and Itanium memory models. 
> 
> Arne
This is more a compiler issue with regards to legal code optimizations.  Compiling -O0 /NOOPT will keep the error in the "right" stop.  

As far as the hardware memory ordering, yes, the x86 is more like VAX.  Alpha is the most, uh, "flexible" that needs MB and IMB instructions to serialize memory ordering.



More information about the Info-vax mailing list