[LLVMdev] emitting function stub for mips16 floating point patch

reed kotler rkotler at mips.com
Fri Jan 31 15:59:26 PST 2014


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






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