[LLVMdev] fp_round libcall

Duncan Sands baldrick at free.fr
Mon Jul 7 12:30:33 PDT 2008


Hi Bruno,

> I'm trying to emit FP_ROUND f64 -> f32 considering a mips target that
> only supports single
> float point operations. The problem is that f32 is considered legal on this
> target but f64 doesn't and the only way I can codegen this instruction is using
> setConvertAction(MVT::f64, MVT::f32, Expand), which issues a EmitStackConvert.
> What if I want a libcall instead? What should I do? The libcall FROUND_F64_F32
> is there, but it seems that it cannot be reached without hacking. What
> should I do
> to support this? Am I missing something?

with the new LegalizeTypes infrastructure you could add a method to
DAGTypeLegalizer::SoftenFloatOperand which would turn FP_ROUND into
a libcall (this logic will only be called if FP_ROUND has a legal
return value but an illegal operand [f64] that is converted to an
integer of the same size [i64]).

Ciao,

Duncan.



More information about the llvm-dev mailing list