ed at modk.it
2015-Jul-15 16:08 UTC
[LLVMdev] [Clang] Reasons for lack of -fsingle-precision-constant support? Alternatives?
Thanks for the response. If we add the support would you accept the patch? Seems like a pretty straightforward flag since it maps directly to NumericLiteralParser::NumericLiteralParser within LiteralSupport.cpp. I understand the maintenance concern with flags that affect multiple points in code though. Still trying to get the bottom of why we're crashing with double floating point literal. It seems the fpu in question (fpv4-sp-d16) only supports 32 bit operations so this is somehow getting passed to a software wrapper and crashing there. But to be fair this was crashing in gcc too which is why we added the -fsingle-precision-constant flag since we didn't care about the precision of the constants and we're using floats everywhere anyway for performance. -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20150715/099d16c2/attachment.html>
Rick Mann
2015-Jul-15 16:27 UTC
[LLVMdev] [Clang] Reasons for lack of -fsingle-precision-constant support? Alternatives?
> On Jul 15, 2015, at 09:08 , ed at modk.it wrote: > > Thanks for the response. If we add the support would you accept the patch? Seems like a pretty straightforward flag since it maps directly to NumericLiteralParser::NumericLiteralParser within LiteralSupport.cpp. I understand the maintenance concern with flags that affect multiple points in code though. > > Still trying to get the bottom of why we're crashing with double floating point literal. It seems the fpu in question (fpv4-sp-d16) only supports 32 bit operations so this is somehow getting passed to a software wrapper and crashing there. But to be fair this was crashing in gcc too which is why we added the -fsingle-precision-constant flag since we didn't care about the precision of the constants and we're using floats everywhere anyway for performance.Shouldn't the code generator know to make the constants 32-bit if that's all the target supports? Or does it emulate 64-bit in software? -- Rick Mann rmann at latencyzero.com
ed at modk.it
2015-Jul-15 16:32 UTC
[LLVMdev] [Clang] Reasons for lack of -fsingle-precision-constant support? Alternatives?
> > > Still trying to get the bottom of why we're crashing with double > floating point literal. It seems the fpu in question (fpv4-sp-d16) only > supports 32 bit operations so this is somehow getting passed to a software > wrapper and crashing there. But to be fair this was crashing in gcc too > which is why we added the -fsingle-precision-constant flag since we didn't > care about the precision of the constants and we're using floats everywhere > anyway for performance. > > Shouldn't the code generator know to make the constants 32-bit if that's > all the target supports? Or does it emulate 64-bit in software?Yes I believe it is (trying to) emulate in software. There's no requirement to have an FPU at all so this is the expected behavior. -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20150715/d572db6f/attachment.html>