[LLVMdev] floating point exception and SSE2 instructions

Simon Burton simon at arrowtheory.com
Tue Apr 18 23:17:34 PDT 2006


Hi,

I'm building a little JIT that creates functions to do array manipulations,
eg. sum all the elements of a double* array. I'm writing this in python, generating
llvm assembly intructions and piping that through a call to ParseAssemblyString, 
ExecutionEngine, etc.

It's working OK on integer values, but i'm getting nasty floating point exceptions
when i try this on double* values. I've seen this behaviour before on this platform
(debian Intel P4) when I tried using ATLAS with sse2. I'm pretty sure it's
valid assembly; the code still causes exceptions when i try using the output
from the llvm demo website. And it works fine on an AMD machine.

What is LLVM doing with my code ? Does it generate SSE2 instructions ?

thanks!

Simon.

double sum_d(double*mem,int n)
{
  double val=0.0;
  while(n)
  { val += *mem; mem++; n--; }
  return val;
}


-- 
Simon Burton, B.Sc.
Licensed PO Box 8066
ANU Canberra 2601
Australia
Ph. 61 02 6249 6940
http://arrowtheory.com 




More information about the llvm-dev mailing list