[LLVMdev] emitting function stub for mips16 floating point patch

reed kotler rkotler at mips.com
Tue Feb 4 09:05:22 PST 2014


On 02/04/2014 08:48 AM, Rafael EspĂ­ndola wrote:
> On 31 January 2014 18:59, reed kotler <rkotler at mips.com> 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.
> awesome!
>
>> I'm translating the actual function now.
>>
>> How do you emit an .ent
> emitDirectiveEnt in the mips target streamer.
>
>> or .globl
> EmitSymbolAttribute with MCSA_Global
>
>> from asm printer?
>> .type ?
> EmitSymbolAttribute with  MCSA_ELF_Type*
>
>> .end ??
> emitDirectiveEnd on the mips target streamer
>
>> .section ???
> SwitchSection
>
>> 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.
> The rule of the thumb is that each line in assembly is a method in the
> streamer or target streamer.
>
>> Tia.
>>
>> Reed
> Cheers,
> Rafael
THanks.

Your pointers will save some time hunting for the right method.

I have 90% of this done already. Now I know where to look for the 
remaining methods.

When I finish this one patch (almost done, which is for a specific bug), 
I'm planning to start to move all the inline assembly code from
pass Mips16HardFloat to this later place in MipsAsmPrinter. 
Mips16HardFloat pass should shrink to 15% of it's current size. I've already
started to move the infrastructure to this place in MipsAsmPrinter.

We discussed this a while back and I agreed to eventually do this but it 
was not clear to me at that time exactly where to move it to and it was much
easier for me to do this in the IR pass. Frankly, at that time, I would 
not have at all thought to move it to AsmPrinter :) .
Now I can see where it should go and also understand the gcc mips16 floating
point scheme better (undocumented and complicated at the same time) and 
how it interacts with llvm and such. It makes sense to move it to AsmPrinter
because in reality the stubs are just a sophisticated asm directive that 
must be expanded.

There are a few bizarre asm statements that I hardly understand (copied 
form the gcc mips16 hard float stubs) in some of the yet to be moved stubs.
I may need some additional mc methods to handle those. When I get there 
we can discuss that.

This scheme is handshake between gcc, gas and ld (all undocumented of 
course :)))

Reed



Reed

I'm planning to move most of the inline assembly emission




More information about the llvm-dev mailing list