Chris Lattner
2006-Apr-19 23:21 UTC
[LLVMdev] floating point exception and SSE2 instructions
On Thu, 20 Apr 2006, Simon Burton wrote:>>> From what I remember, this is a bug in debian libc: >> some floating point flags are set incorrectly causing SIGFPE. >> Can't find the bug report ATM. > > Oh, it just showed up on numpy-discussion: > http://sources.redhat.com/bugzilla/show_bug.cgi?id=10 > > """ > #include <fenv.h> > void feclearexcept(int ex) > > This function should clear the specified exception status bits in the > FPU status register. For CPUs with SSE support it should also clear the > MXCSR status register bits. > > The problem is that feclearexcept() clears the status control bits also, > causing future floating-point errors to generate interrupts which will > lead to a SIGFPE signal which terminates the program (unless caught by a > SIGFPE handler). > """I don't see what this has to do with anything, but...> Is there a way I can disable SSE instruction generation in LLVM ?Yes. Pass -mattr=-sse1,-sse2,-sse3 to lli or llc. If you've linked the JIT into your app, you can specify this by calling cl::ParseCommandLineOptions on an static array, something like: int argc; char *Args[] = { "", "-mattr=-sse1,-sse2,-sse3", 0 }; cl::ParseCommandLineOptions(argc, Args, 0); -Chris -- http://nondot.org/sabre/ http://llvm.org/
Simon Burton
2006-Apr-19 23:49 UTC
[LLVMdev] floating point exception and SSE2 instructions
On Wed, 19 Apr 2006 18:21:32 -0500 (CDT) Chris Lattner <sabre at nondot.org> wrote:> > > I don't see what this has to do with anything, but...Me neither.> > > Is there a way I can disable SSE instruction generation in LLVM ? > > Yes. Pass -mattr=-sse1,-sse2,-sse3 to lli or llc.Right, that fixed it. BTW: from the --help: -mattr=<a1,+a2,-a3,...> - Target specific attributes (-mattr=help for details) -mcpu=<cpu-name> - Target a specific cpu type (-mcpu=help for details) but -mattr=help doesn't do anything. Simon. -- Simon Burton, B.Sc. Licensed PO Box 8066 ANU Canberra 2601 Australia Ph. 61 02 6249 6940 http://arrowtheory.com
Chris Lattner
2006-Apr-20 02:34 UTC
[LLVMdev] floating point exception and SSE2 instructions
On Thu, 20 Apr 2006, Simon Burton wrote:> from the --help: > -mattr=<a1,+a2,-a3,...> - Target specific attributes (-mattr=help for details) > -mcpu=<cpu-name> - Target a specific cpu type (-mcpu=help for details) > > but -mattr=help doesn't do anything.Annoyingly you have to specify a .bc file. Try: % llvm-as /dev/null -o dummy.bc % llc -mattr=help dummy.bc -Chris -- http://nondot.org/sabre/ http://llvm.org/
Possibly Parallel Threads
- [LLVMdev] floating point exception and SSE2 instructions
- [LLVMdev] floating point exception and SSE2 instructions
- [LLVMdev] floating point exception and SSE2 instructions
- [LLVMdev] floating point exception and SSE2 instructions
- [LLVMdev] floating point exception and SSE2 instructions