On 01/08/2013 01:48 PM, Eli Friedman wrote:> On Mon, Jan 7, 2013 at 6:07 PM, reed kotler <rkotler at mips.com> wrote: >> For example: >> >> /home/rkotler/llvm/install/bin/llc -mcpu=mips16 hf16_2.ll -march=mipsel >> -relocation-model=pic -o hf16_2.s -O3 -mips16-hard-float -soft-float > Try something like the following: > > float f; > double test(void* fptr) { > f = ((float(*)(float,float))fptr)(1.0, 1.0); > } > > -EliIt seems that in SelectionDAGBuilder::visitCall, that I.getCalledFunction() has the correct protoype, even for this case you give. (This case you give is not constructable as you pointed out simply using the DAG in Mips lower call). So it seems possible to add an additional parameter to LowerCallTo and pass it down the chain until Mips lower call is invoked. Is this more or less what you had in mind? There may be some special handling needed for functions which fall under visitUnaryFloatCall and maybe some other cases.
On Tue, Jan 8, 2013 at 6:33 PM, reed kotler <rkotler at mips.com> wrote:> On 01/08/2013 01:48 PM, Eli Friedman wrote: >> >> On Mon, Jan 7, 2013 at 6:07 PM, reed kotler <rkotler at mips.com> wrote: >>> >>> For example: >>> >>> /home/rkotler/llvm/install/bin/llc -mcpu=mips16 hf16_2.ll -march=mipsel >>> -relocation-model=pic -o hf16_2.s -O3 -mips16-hard-float -soft-float >> >> Try something like the following: >> >> float f; >> double test(void* fptr) { >> f = ((float(*)(float,float))fptr)(1.0, 1.0); >> } >> >> -Eli > > It seems that in SelectionDAGBuilder::visitCall, that I.getCalledFunction() > has the correct protoype, > even for this case you give. (This case you give is not constructable as you > pointed out simply using the DAG in Mips lower call). > > So it seems possible to add an additional parameter to LowerCallTo and pass > it down the chain > until Mips lower call is invoked. > > Is this more or less what you had in mind?That's the right idea... but as far as I can tell, it's already part of the CallLoweringInfo structure. -Eli
On 01/08/2013 06:40 PM, Eli Friedman wrote:> On Tue, Jan 8, 2013 at 6:33 PM, reed kotler <rkotler at mips.com> wrote: >> On 01/08/2013 01:48 PM, Eli Friedman wrote: >>> On Mon, Jan 7, 2013 at 6:07 PM, reed kotler <rkotler at mips.com> wrote: >>>> For example: >>>> >>>> /home/rkotler/llvm/install/bin/llc -mcpu=mips16 hf16_2.ll -march=mipsel >>>> -relocation-model=pic -o hf16_2.s -O3 -mips16-hard-float -soft-float >>> Try something like the following: >>> >>> float f; >>> double test(void* fptr) { >>> f = ((float(*)(float,float))fptr)(1.0, 1.0); >>> } >>> >>> -Eli >> It seems that in SelectionDAGBuilder::visitCall, that I.getCalledFunction() >> has the correct protoype, >> even for this case you give. (This case you give is not constructable as you >> pointed out simply using the DAG in Mips lower call). >> >> So it seems possible to add an additional parameter to LowerCallTo and pass >> it down the chain >> until Mips lower call is invoked. >> >> Is this more or less what you had in mind? > That's the right idea... but as far as I can tell, it's already part > of the CallLoweringInfo structure. > > -EliAwesome. thanks for the help. It's already in CallLoweringInfo (gdb) call (*CLI.RetTy).dump() float (gdb) call (*CLI.Args[0].Ty).dump() float (gdb) call (*CLI.Args[1].Ty).dump() float Reed