[LLVMdev] More careful treatment of floating point exceptions
sdmitrouk at accesssoftek.com
Fri Sep 19 08:12:41 PDT 2014
I'd like to make code emitted by LLVM that includes floating point
operations which raise FP exceptions behave closer to what is defined by
IEEE754 standard. I'm not going to "fix everything", just incorrect
behaviour I faced so far.
Most of troubles regarding FP exceptions are caused by optimizations, so
there should be a flag to disable/block them if one wants to get better
code in a sense of its IEEE754 conformance. I couldn't find an existing
flag for this and would like to introduce one. I guess it should be
added to llvm::TargetOptions (e.g. "IEEE754FPE"), then -std=c99 or
separate option could enable it from front-end (Clang in this case).
I'm doing this for ARM platform and the flag should be reachable from
all these places in LLVM:
- lib/Target/ARM/ARMInstrVFP.td (through predicates)
- lib/Target/ARM/ARMRegisterInfo.td (through predicates)
and in Clang:
Did I get it right and there is no such flag so far? Does what I'm
suggesting sounds reasonable?
More information about the llvm-dev