[LLVMdev] Instruction Implementation

Stavropoulos Nikos n.stavropoulos at think-silicon.com
Tue Apr 2 08:05:47 PDT 2013


>I'm also a little worried that your pattern has fadd, but your C 
>source has a subtraction. 

:S i wrote it wrong the true implementation is 
def SUBCEIL_S   : FFR<0x11, 0x3, 16, (outs  FGR32:$fd), (ins  FGR32:$fs),
"frac.s\t$fd, $fs", [(set (f32  FGR32:$fd), (fsub (f32  FGR32:$fs ),(f32 
(ceilf FGR32:$fs))))] >; 

I use some C,C++ code to test my backend. 

i use clang with those argument 

-m32 -emit-llvm -S -target mipsel-linux-gnu -I..  
and i have tried to add this in case so it will not use standard libs
-nostdlib -nostdinc -fno-builtin but with no luck

attached the new .ll for code

#include "math.h"
float foo (float x)
{

        return (x - ceilf(x));
}
int main()
{
float d, d1 ;
        d= 12.3f;
        d1= foo(d);
    return 0;
}
 

test.ll <http://llvm.1065342.n5.nabble.com/file/n56383/test.ll>  







--
View this message in context: http://llvm.1065342.n5.nabble.com/LLVMdev-Instruction-Implementation-tp56359p56383.html
Sent from the LLVM - Dev mailing list archive at Nabble.com.



More information about the llvm-dev mailing list