patch for problem when mips16 hard float is linked as c++

Eric Christopher echristo at gmail.com
Wed Feb 12 11:20:01 PST 2014


On Wed, Feb 12, 2014 at 10:03 AM, reed kotler <rkotler at mips.com> wrote:
>
> This patch has been rewritten to not use output raw text in MipsAsmPrinter
> and so is being sent out to the list
> before actual commit to make sure there are no further objections.
>

Echoing the formatting comments of Rafael. A lot of it is formatted
oddly or not to code for llvm.

> This patch has two main functions:
>
> 1) Fix a specific bug when certain conversion functions are called in a
> program compiled as mips16 with hard float and
> the program is linked as c++. There are two libraries that are reversed in
> the link order with gcc/g++ and clang/clang++ for
> mips16 in this case and the proper stubs will then not be called. These
> stubs are normally handled in the Mips16HardFloat pass
> but in this case we don't know at that time that we need to generate the
> stubs. This must all be handled later in code generation
> and we have moved this functionality to MipsAsmPrinter. When linked as C
> (gcc or clang) the proper stubs are linked in from libc.

Also echoing Rafael's comments here. Why don't you know you need to
emit stub calls early?

-eric

>
> 2) Set up the infrastructure to handle 90% of what is in the Mips16HardFloat
> pass in this new area of MipsAsmPrinter. This is a more
> logical place to handle this and we have known for some time that we needed
> to move the code later and not implement it using
> inline asm as we do now but it was not clear exactly where to do this and
> what mechanism should be used. Now it's clear to us
> how to do this and this patch contains the infrastructure to move most of
> this to MipsAsmPrinter but the actual moving will be done
> in a follow on patch. The same infrastructure is used to fix this current
> bug as described in #1. This change was requested by the list
> during the original putback of the Mips16HardFloat pass but was not
> practical for us do at that time.
>



More information about the llvm-commits mailing list