Hi and thanks for answering llc works fine just does not selecting my instruction i ve uploaded .ll file how can i include this attribute "readonly" so i can see if changes the generated assembly? my code is very simple int main (){ float d, d1 ; d= 12.3; d1 = d - ceilf(d); return 0; } -- View this message in context: http://llvm.1065342.n5.nabble.com/LLVMdev-Instruction-Implementation-tp56359p56377.html Sent from the LLVM - Dev mailing list archive at Nabble.com.
Hi,> i ve uploaded .ll fileIs that the C file that's at the end of your message? To produce a .ll file, you give clang the "-emit-llvm" option (and probably "-S"). Anyway, what I see in the C you posted is that Clang is using constant folding to avoid doing any of the operations you've requested. A better C file test would be: float foo(float d) { return d - ceilf(d); } For me LLVM does use the FCEIL node in that case (it doesn't know what d is so can't optimise your operations away). I'm still a little worried that ceilf isn't declared, but LLVM seems to do the "right" thing anyway. I'm also a little worried that your pattern has fadd, but your C source has a subtraction.> how can i include this attribute "readonly" so i can see if changes the > generated assembly?The best documentation is probably the "Function Attributes" section in http://llvm.org/docs/LangRef.html, but it doesn't look like you've been using LLVM IR so that may not be immediately useful. Cheers. Tim.
>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.