[LLVMdev] LLVM interpreter does not support fmod

Chris Lattner clattner at apple.com
Tue Jun 14 21:05:55 PDT 2011


On Jun 14, 2011, at 7:57 PM, 陳韋任 wrote:

> Hi,
> 
>> It seems llvm interpreter only supports a limited number of external
>> functions. fmod, in particular is not supported. any reason why it is not
>> supported ?
>> 
>> "lli -force-interpreter test.bc
>> LLVM ERROR: Tried to execute an unknown external function: double (double,
>> double)* fmod
>> "
> 
>  You can check out the comments in lib/ExecutionEngine/Interpreter/ExternalFunctions.cpp
> to see how LLVM interpreter handle external functions.
> 
>  "... If such a wrapper does not exist, and libffi is available, then the Interpreter will
>   attempt to invoke the function using libffi, after finding its address." 
> 
> I guess you have to configure LLVM with "--enable-libffi" option.

Also note that the interpreter has a ton of limitations, this is just the tip of the iceberg.  It is far from being production quality.

-Chris



More information about the llvm-dev mailing list