Checkin in of first of several patches to finish implementation of
authorReed Kotler <rkotler@mips.com>
Fri, 10 May 2013 22:25:39 +0000 (22:25 +0000)
committerReed Kotler <rkotler@mips.com>
Fri, 10 May 2013 22:25:39 +0000 (22:25 +0000)
commit46090914b783b632618268f2a5c99aab83732688
treee13bf35f88f92d052548cf5fbf84de1b8451d5f5
parent1197e38f3338b8db76f0fa38c2687c65b2bcea5c
Checkin in of first of several patches to finish implementation of
mips16/mips32 floating point interoperability.

This patch fixes returns from mips16 functions so that if the function
was in fact called by a mips32 hard float routine, then values
that would have been returned in floating point registers are so returned.

Mips16 mode has no floating point instructions so there is no way to
load values into floating point registers.

This is needed when returning float, double, single complex, double complex
in the Mips ABI.

Helper functions in libc for mips16 are available to do this.

For efficiency purposes, these helper functions have a different calling
convention from normal Mips calls.

Registers v0,v1,a0,a1 are used to pass parameters instead of
a0,a1,a2,a3.

This is because v0,v1,a0,a1 are the natural registers used to return
floating point values in soft float. These values can then be moved
to the appropriate floating point registers with no extra cost.

The only register that is modified is ra in this call.

The helper functions make sure that the return values are in the floating
point registers that they would be in if soft float was not in effect
(which it is for mips16, though the soft float is implemented using a mips32
library that uses hard float).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@181641 91177308-0d34-0410-b5e6-96231b3b80d8
13 files changed:
lib/Target/Mips/CMakeLists.txt
lib/Target/Mips/Mips16HardFloat.cpp [new file with mode: 0644]
lib/Target/Mips/Mips16HardFloat.h [new file with mode: 0644]
lib/Target/Mips/Mips16ISelLowering.cpp
lib/Target/Mips/MipsCallingConv.td
lib/Target/Mips/MipsISelLowering.cpp
lib/Target/Mips/MipsISelLowering.h
lib/Target/Mips/MipsRegisterInfo.cpp
lib/Target/Mips/MipsRegisterInfo.h
lib/Target/Mips/MipsSubtarget.cpp
lib/Target/Mips/MipsSubtarget.h
lib/Target/Mips/MipsTargetMachine.cpp
test/CodeGen/Mips/mips16_fpret.ll [new file with mode: 0644]