[LLVMdev] emitting function stub for mips16 floating point patch

reed kotler rkotler at mips.com
Fri Jan 31 16:04:00 PST 2014


On 01/31/2014 03:59 PM, reed kotler wrote:
> I'm rewriting this patch for the stubs to not use outputing of raw text.
>
> Generating the instructions is very straightforward and that part is 
> done.
>
> I'm translating the actual function now.
>
> How do you emit an .ent or .globl from asm printer?
> .type ?
> .end ??
> .section ???
>
> I'm studying the classes now but it should be simple to do so if you 
> know, you can save me some time
> because this is another maze of llvm data abstraction.
>
> Tia.
>
> Reed
>
>
>
We already have this MIpsTargetStreamer class which seems like a place 
where this could be added.

Given the big storm around any kind of raw text I don't want to add to 
this if this is already something
we are not supposed to be doing.

>
>
>
> void MipsAsmPrinter::EmitFPCallStub(
>   const char* Symbol, const Mips16HardFloatInfo::FuncSignature* 
> Signature) {
>   OutStreamer.EmitRawText("\t.globl "+ Twine(Symbol));
> .........
>   OutStreamer.EmitRawText("\t# Stub function to call " + Twine(RetType) +
>                           " " + Twine(Symbol) + " (" + Twine(Parms) + 
> ")");
> OutStreamer.EmitRawText("\t.section\t.mips16.call.fp"+Twine(Symbol)+",\"ax\", at progbits"); 
>
>   OutStreamer.EmitRawText(".align 2");
>   OutStreamer.EmitRawText(".nomips16");
>   OutStreamer.EmitRawText(".nomicromips");
>   OutStreamer.EmitRawText("\t.ent\t__call_stub_fp_" + Twine(Symbol));
>   OutStreamer.EmitRawText("\t.type\t__call_stub_fp_" + Twine(Symbol) + 
> ", @function");
>   OutStreamer.EmitRawText("\t__call_stub_fp_" + Twine(Symbol) + ":");
>   OutStreamer.EmitRawText("\t.size  __call_stub_fp_" + Twine(Symbol) +
>                           ", .-__call_stub_fp_" + Twine(Symbol));
>   OutStreamer.EmitRawText("\t.end  __call_stub_fp_" + Twine(Symbol))





More information about the llvm-dev mailing list