summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/Mips/Mips16HardFloat.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Rewrite the Mips16HardFloat pass to avoid using the Subtarget.Eric Christopher2015-01-061-12/+12
| | | | llvm-svn: 225231
* [mips] Set GCC-compatible MIPS asssembler options before inline asm blocks.Toma Tabacu2014-12-171-2/+0
| | | | | | | | | | | | | | | | | | | | Summary: When generating MIPS assembly, LLVM always overrides the default assembler options by emitting the '.set noreorder', '.set nomacro' and '.set noat' directives, while GCC uses the default options if an assembly-level function contains inline assembly code. This becomes a problem when the code generated by LLVM is interleaved with inline assembly which assumes GCC-like assembler options (from Linux, for example). This patch fixes these conflicts by setting the appropriate assembler options at the beginning of an inline asm block and popping them at the end. Reviewers: dsanders Reviewed By: dsanders Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D6637 llvm-svn: 224425
* Fix more instances of -Wsentinel on Windows with s/NULL/nullptr/Reid Kleckner2014-11-201-1/+1
| | | | | | Follow up to r221940, where I must not have caught em all. NFC llvm-svn: 222481
* [C++] Use 'nullptr'. Target edition.Craig Topper2014-04-251-3/+3
| | | | llvm-svn: 207197
* [Modules] Fix potential ODR violations by sinking the DEBUG_TYPEChandler Carruth2014-04-221-1/+2
| | | | | | | definition below all of the header #include lines, lib/Target/... edition. llvm-svn: 206842
* Retire llvm::array_endof in favor of non-member std::end.Benjamin Kramer2014-04-121-3/+2
| | | | | | While there make array_lengthof constexpr if we have support for it. llvm-svn: 206112
* This patch has two main functions:Reed Kotler2014-02-141-4/+5
| | | | | | | | | | | | | | | | | 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. 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. llvm-svn: 201426
* Re-sort all of the includes with ./utils/sort_includes.py so thatChandler Carruth2014-01-071-1/+1
| | | | | | | | | | subsequent changes are easier to review. About to fix some layering issues, and wanted to separate out the necessary churn. Also comment and sink the include of "Windows.h" in three .inc files to match the usage in Memory.inc. llvm-svn: 198685
* Fix a problem with mips16 stubs when calls are transformed duringReed Kotler2013-12-181-0/+18
| | | | | | | | | tail call optimization. Some more work may be needed for indirect calls but this patch fixes the current regression in Prolangc++/trees. S2 optimization as part of the general cleanup and optimization of prolog and epilog was not saving S2 in this case and needed to. llvm-svn: 197630
* Next step in Mips16 prologue/epilogue cleanup.Reed Kotler2013-12-101-4/+10
| | | | | | | | Save S2(reg 18) only when we are calling floating point stubs that have a return value of float or complex. Some more work to make this better but this is the first step. llvm-svn: 196921
* Add fabsf to the list of inlined functions; otherwiseReed Kotler2013-10-081-0/+1
| | | | | | | Mips16 will try and create a stub for it and this will result in a link error because that function does not exist in libc. llvm-svn: 192223
* Fix a bad typo in the inline assembly code for mips16 pic fp stubsReed Kotler2013-09-251-3/+3
| | | | | | | and make one cosmetic cleanup to make it look the same as gcc in this area; adjusting test cases. llvm-svn: 191400
* Set .reorder for the stub so that gas takes care of delay slot processing.Reed Kotler2013-09-211-1/+3
| | | | llvm-svn: 191125
* Make sure we don't generate stubs for any of these functions because theyReed Kotler2013-09-011-2/+21
| | | | | | | | | don't exist in libc. This is really not the right way to solve this problem; but it's not clear to me at this time exactly what is the right way. If we create stubs here, they will cause link errors because these functions do not exist in libc. llvm-svn: 189727
* Fix a problem with dual mips16/mips32 mode. When the underlying processorReed Kotler2013-08-301-0/+20
| | | | | | | | | | | | | has hard float, when you compile the mips32 code you have to make sure that it knows to compile any mips32 routines as hard float. I need to clean up the way mips16 hard float is specified but I need to first think through all the details. Mips16 always has a form of soft float, the difference being whether the underlying hardware has floating point. So it's not really necessary to pass the -soft-float to llvm since soft-float is always true for mips16 by virtue of the fact that it will not register floating point registers. By using this fact, I can simplify the way this is all handled. llvm-svn: 189690
* Start to add the LLVM builtins to the mips16 exclusion lists for fp.Reed Kotler2013-08-251-1/+1
| | | | | | | | | | | | | I need to add the rest of these to the list or else to delay putting out the actual stub until later in code generation when I know if the external function ever got emitted Resubmit this patch. The target triple needs to be added to the test so that clang does not tell the backend the wrong target when the host is BSD. There is a clang bug in here somewhere that I need to track down. At Mips this has been filed internally as a bug. llvm-svn: 189186
* Revert 189161Shuxin Yang2013-08-241-1/+1
| | | | llvm-svn: 189176
* Start to add the builtind to the mips16 exclusion lists for fp.Reed Kotler2013-08-241-1/+1
| | | | | | | | I need to add the rest of these to the list or else to delay putting out the actual stub until later in code generation when I know if the external function ever got emitted. llvm-svn: 189161
* Remove global construction. const char* is sufficient here.Benjamin Kramer2013-08-121-2/+2
| | | | | | No functionality change. llvm-svn: 188158
* Don't generate floating point stubs for mips16 code if the functionReed Kotler2013-08-111-1/+13
| | | | | | | | | | | is actually an instrinsic that will not occur in libc. This list here is not exhaustive but fixes the one places in test-suite where this occurs. I have filed a bug against myself to research the full list and add them to the array of such cases. In the future, actual stub generation will occur in a later phase and we won't need this code because we will know at that time during the compilation that in fact no helper function was even needed. llvm-svn: 188149
* Fix some misc. issues with Mips16 fp stubs.Reed Kotler2013-08-011-2/+7
| | | | | | | | 1) They should never be inlined. 2) A naming inconsistency with gcc mips16 3) Stubs should not have the global attribute llvm-svn: 187555
* Patch number 2 for mips16/32 floating point interoperability stubs.Reed Kotler2013-05-161-3/+43
| | | | | | | | | This creates stubs that help Mips32 functions call Mips16 functions which have floating point parameters that are normally passed in floating point registers. llvm-svn: 181972
* Fix typo.Reed Kotler2013-05-141-1/+1
| | | | llvm-svn: 181759
* Removed an unnamed namespace and forgot to make two of the functions insideReed Kotler2013-05-141-3/+5
| | | | | | "static". llvm-svn: 181754
* This is the first of three patches which creates stubs used forReed Kotler2013-05-141-0/+275
| | | | | | | | | | | | | | | | | | | | | | | Mips16/32 floating point interoperability. When Mips16 code calls external functions that would normally have some of its parameters or return values passed in floating point registers, it needs (Mips32) helper functions to do this because while in Mips16 mode there is no ability to access the floating point registers. In Pic mode, this is done with a set of predefined functions in libc. This case is already handled in llvm for Mips16. In static relocation mode, for efficiency reasons, the compiler generates stubs that the linker will use if it turns out that the external function is a Mips32 function. (If it's Mips16, then it does not need the helper stubs). These stubs are identically named and the linker knows about these tricks and will not create multiple copies and will delete them if they are not needed. llvm-svn: 181753
* Checkin in of first of several patches to finish implementation ofReed Kotler2013-05-101-0/+141
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). llvm-svn: 181641
OpenPOWER on IntegriCloud