[LLVMdev] Instruction Implementation
Tim Northover
t.p.northover at gmail.com
Tue Apr 2 04:54:38 PDT 2013
Hi,
> def SUBCEIL_S : FFR<0x11, 0x3, 16, (outs FGR32:$fd), (ins FGR32:$fs),
> "frac.s\t$fd, $fs", [(set (f32 FGR32:$fd), (fadd (f32 FGR32:$fs ),(f32
> (ceilf FGR32:$fs))))] >;
>
> it makes and install correctly but when i ll try to write code to use this
> instruction there is no luck.
More details (including the .ll source and *how* exactly things are
going wrong) would be useful. Does llc crash? Does it simply not
select your code even though there's an fceil in the DAG? Is there no
fceil node in the DAG (run llc with "-view-isel-dags")?
Assuming the "ceilf" is a typo, my wild stab in the dark would be that
you've got code something like:
define float @foo(float %in) {
%1 = tail call float @ceilf(float %in)
ret float %1
}
declare float @ceilf(float)
and haven't given the "@ceilf" function the attribute "readonly". This
is what LLVM uses (in many cases) to decide whether the call is a
known library call and can be transformed into an appropriate ISD
node.
Tim.
More information about the llvm-dev
mailing list