106119 Commits

Author SHA1 Message Date
Daniel Sanders
6f5449ce9f Merged from r221534:
[mips] Promote i32 arguments to i64 for the N32/N64 ABI and fix <64-bit structs...

Summary:
... and after all that refactoring, it's possible to distinguish softfloat
floating point values from integers so this patch no longer breaks softfloat to
do it.

Remove direct handling of i32's in the N32/N64 ABI by promoting them to
i64. This more closely reflects the ABI documentation and also fixes
problems with stack arguments on big-endian targets.

We now rely on signext/zeroext annotations (already generated by clang) and
the Assert[SZ]ext nodes to avoid the introduction of unnecessary sign/zero
extends.

It was not possible to convert three tests to use signext/zeroext. These tests
are bswap.ll, ctlz-v.ll, ctlz-v.ll. It's not possible to put signext on a
vector type so we just accept the sign extends here for now. These tests don't
pass the vectors the same way clang does (clang puts multiple elements in the
same argument, these map 1 element to 1 argument) so we don't need to worry too
much about it.

With this patch, all known N32/N64 bugs should be fixed and we now pass the
first 10,000 tests generated by ABITestGen.py.

Subscribers: llvm-commits

Differential Revision: http://reviews.llvm.org/D6117




git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_35@223069 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-01 19:33:33 +00:00
Daniel Sanders
b65ea91efe Merged from r221529:
[mips] Removed the remainder of MipsCC. NFC.

Summary:
One of the calls to AllocateStack (the one in LowerCall) doesn't look like
it should be there but it was there before and removing it breaks the
frame size calculation.

Reviewers: vmedic, theraven

Reviewed By: theraven

Subscribers: llvm-commits

Differential Revision: http://reviews.llvm.org/D6116




git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_35@223065 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-01 19:02:59 +00:00
Daniel Sanders
a68869d1f1 Merged from r221528:
[mips] Remove MipsCC::reservedArgArea() in favour of MipsABIInfo::GetCalleeAllocdArgSizeInBytes(). NFC.

Summary:

Reviewers: theraven, vmedic

Reviewed By: vmedic

Subscribers: llvm-commits

Differential Revision: http://reviews.llvm.org/D6115




git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_35@223063 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-01 18:57:45 +00:00
Daniel Sanders
20d7e9f3d7 Merged from r221527:
MipsCCState.h: Use LLVM_DELETED_FUNCTION for msc17.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_35@223062 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-01 18:52:41 +00:00
Daniel Sanders
a06f6f2af5 Merged from r221525:
[mips] Move MipsCCState to a separate file and clang-formatted it.

Summary:

Reviewers: theraven, vmedic

Reviewed By: vmedic

Subscribers: llvm-commits

Differential Revision: http://reviews.llvm.org/D6114




git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_35@223061 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-01 18:48:22 +00:00
Daniel Sanders
857274fe04 Merged from r221522:
[mips] Fix unused variable warnings introduced in r221521



git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_35@223058 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-01 18:43:35 +00:00
Daniel Sanders
5652743307 Merged from r221521:
[mips] Remove remaining use of MipsCC::intArgRegs() in favour of MipsABIInfo::GetByValArgRegs() and MipsABIInfo::GetVarArgRegs()

Summary:

Reviewers: theraven, vmedic

Reviewed By: vmedic

Subscribers: llvm-commits

Differential Revision: http://reviews.llvm.org/D6113




git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_35@223053 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-01 17:14:37 +00:00
Daniel Sanders
e9f9537b80 Merged from r221519:
[mips] Remove MipsCC::getRegVT(). NFC

Summary: It's no longer used.

Reviewers: vmedic, theraven

Reviewed By: theraven

Subscribers: llvm-commits

Differential Revision: http://reviews.llvm.org/D6112



git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_35@223052 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-01 17:12:32 +00:00
Daniel Sanders
d2e0bdc3ff Merged from r221518:
[mips] Remove MipsCC::analyzeCallOperands in favour of CCState::AnalyzeCallOperands. NFC

Summary:
In addition to the usual f128 workaround, it was also necessary to provide
a means of accessing ArgListEntry::IsFixed.

Reviewers: theraven, vmedic

Reviewed By: vmedic

Subscribers: llvm-commits

Differential Revision: http://reviews.llvm.org/D6111




git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_35@223048 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-01 17:05:38 +00:00
Daniel Sanders
8283cd9f05 Merged from r221517:
[mips] Move SpecialCallingConv to MipsCCState and use it from tablegen-erated code. NFC

Summary:
In the long run, it should probably become a calling convention in its own
right but for now just move it out of
MipsISelLowering::analyzeCallOperands() so that we can drop this function
in favour of CCState::AnalyzeCallOperands().

Subscribers: llvm-commits

Differential Revision: http://reviews.llvm.org/D6085




git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_35@223047 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-01 17:02:26 +00:00
Daniel Sanders
b9d802e7d9 Merged from r221516:
[mips] Removed IsVarArg from MipsISelLowering::analyzeCallOperands(). NFC.

Summary:
CCState objects already carry this information in their isVarArg() method.

Subscribers: llvm-commits

Differential Revision: http://reviews.llvm.org/D6084



git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_35@223045 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-01 16:35:35 +00:00
Daniel Sanders
15093b561d Merged from r221463:
[mips] Removed IsSoftFloat from MipsISelLowering::analyzeCallOperands(). NFC

Summary:
It isn't used anymore.

Reviewers: vmedic

Reviewed By: vmedic

Subscribers: llvm-commits

Differential Revision: http://reviews.llvm.org/D6083




git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_35@223044 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-01 16:33:17 +00:00
Daniel Sanders
05a4461c15 Merged from r221461:
[mips] Removed MipsISelLowering::analyzeFormalArguments() in favour of CCState::AnalyzeFormalArguments()

Summary:
As with returns, we must be able to identify f128 arguments despite them
being lowered away. We do this with a pre-analyze step that builds a
vector and then we use this vector from the tablegen-erated code.

Reviewers: vmedic

Reviewed By: vmedic

Subscribers: llvm-commits

Differential Revision: http://reviews.llvm.org/D6081



git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_35@223042 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-01 16:32:03 +00:00
Daniel Sanders
db438499ee Merged from r221146:
[mips] Remove unused prototype and variable. NFC.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_35@223041 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-01 16:30:07 +00:00
Daniel Sanders
f805dbc7ec Merged from r221081 and r221102:
-------------------------------------------------------------------------------
Revert r221056 and others, "[mips] Move F128 argument handling into MipsCCState as we did for returns. NFC."

  r221056 "[mips] Move F128 argument handling into MipsCCState as we did for returns. NFC."
  r221058 "[mips] Fix unused variable warning introduced in r221056"
  r221059 "[mips] Move all ByVal handling into CCState and tablegen-erated code. NFC."
  r221061 "Renamed CCState members that appear to misspell 'Processed' as 'Proceed'. NFC."

It caused an undefined behavior in LLVM :: CodeGen/Mips/return-vector.ll.

-------------------------------------------------------------------------------
Re-commit r221056 and others with fix, "[mips] Move F128 argument handling into MipsCCState as we did for returns. NFC."

sret arguments can never originate from an f128 argument so we detect
sret arguments and push false into OriginalArgWasF128.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_35@223040 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-01 16:26:48 +00:00
Daniel Sanders
08dc4d2346 Merged from r221061:
Renamed CCState members that appear to misspell
 'Processed' as 'Proceed'. NFC.

Reviewers: rnk

Reviewed By: rnk

Subscribers: rnk, llvm-commits

Differential Revision: http://reviews.llvm.org/D5978




git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_35@223039 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-01 16:05:07 +00:00
Daniel Sanders
da0e11cf7d Merged from r221059:
[mips] Move all ByVal handling into CCState and tablegen-erated code. NFC.

Summary:
CCState already contains a byval implementation that is very similar to the
Mips custom code. This patch merges the custom code into the existing
common code and tablegen-erated code.

Reviewers: vmedic

Reviewed By: vmedic

Subscribers: rnk, llvm-commits

Differential Revision: http://reviews.llvm.org/D5977




git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_35@223037 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-01 15:50:46 +00:00
Daniel Sanders
c5b18cff0a Merged from r221058:
[mips] Fix unused variable warning introduced in r221056



git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_35@223036 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-01 15:37:28 +00:00
Daniel Sanders
b87b49da10 Merged from r221057:
[mips] Remove ByValArgInfo::Address in favour of CCValAssign::getMemLocOffset(). NFC.

Summary: ByValArgInfo is practically the same as CCState::ByValInfo now.

Reviewers: vmedic

Reviewed By: vmedic

Subscribers: llvm-commits

Differential Revision: http://reviews.llvm.org/D5976




git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_35@223035 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-01 15:28:54 +00:00
Daniel Sanders
83eda6b665 Merged from r221056:
[mips] Move F128 argument handling into MipsCCState as we did for returns. NFC.

Summary:
There are a couple more changes to make before analyzeFormalArguments can
be merged into the standard AnalyzeFormalArguments. I've had to temporarily
poke a couple holes in MipsCCState's encapsulation to save having to make
all the required changes for this merge all at once*. These will be removed
shortly.

* We must merge our ByVal argument handling with the implementation in CCState.
  This will be done over the next three patches, then the fourth will merge
  analyzeFormalArguments with AnalyzeFormalArguments.

Reviewers: vmedic

Reviewed By: vmedic

Subscribers: llvm-commits

Differential Revision: http://reviews.llvm.org/D5969




git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_35@223034 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-01 15:24:14 +00:00
Daniel Sanders
3c7ce872b2 Merged from r221054:
[mips] Remove MipsCC::CCInfo. NFC.

Summary:
It's now passed in as an argument to functions that need it. Eventually
this argument will be replaced by the 'this' pointer for a MipsCCState
object.

Reviewers: vmedic

Reviewed By: vmedic

Subscribers: llvm-commits

Differential Revision: http://reviews.llvm.org/D5967




git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_35@223033 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-01 15:15:59 +00:00
Daniel Sanders
c915198c5c Merged from r221053:
[mips] Removed MipsCC::fixedArgFn(). NFC

Summary:
There is one remaining trace of it in MipsCC::analyzeCallOperands() where
Mips16 might override the calling convention. This will moved into
tablegen-erated code later.

Reviewers: vmedic

Reviewed By: vmedic

Subscribers: llvm-commits

Differential Revision: http://reviews.llvm.org/D5966




git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_35@223032 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-01 15:14:34 +00:00
Daniel Sanders
6f2b3f23f5 [tablegen] Add CustomCallingConv and use it to tablegen-erate the outermost parts of the Mips O32 implementation
Summary:
CustomCallingConv is simply a CallingConv that tablegen should not generate the
implementation for. It allows regular CallingConv's to delegate to these custom
functions. This is (currently) necessary for Mips and we cannot use CCCustom
without having to adapt to the different API that CCCustom uses.

This brings us a bit closer to being able to remove
MipsCC::analyzeCallOperands and MipsCC::analyzeFormalArguments in favour of
the common implementation.

No functional change to the targets.

Reviewers: vmedic

Reviewed By: vmedic

Subscribers: vmedic, llvm-commits

Differential Revision: http://reviews.llvm.org/D5965



git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_35@223031 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-01 15:13:16 +00:00
Daniel Sanders
1842c73e12 Added file that should have been in r223022.
I forgot to 'svn add' it.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_35@223030 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-01 15:10:11 +00:00
Daniel Sanders
f0383f0d31 Add file that should have been in r223027
git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_35@223028 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-01 14:43:25 +00:00
Daniel Sanders
823f180c25 Merged from r220568:
[mips] Replace MipsABIEnum with a MipsABIInfo class.

Summary:
No functional change yet, it's just an object replacement for an enum.
It will allow us to gather ABI information in a single place so that we can
start testing for properties of the ABI's instead of the ABI itself.

For example we will eventually be able to use:
  ABI.MinStackAlignmentInBytes()
instead of:
  (isABI_N32() || isABI_N64()) ? 16 : 8
which is clearer and more maintainable.

Reviewers: matheusalmeida

Reviewed By: matheusalmeida

Differential Revision: http://reviews.llvm.org/D3341



git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_35@223027 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-01 14:30:22 +00:00
Daniel Sanders
426365daa6 Merged from r220564:
[mips] Fix >80-column line



git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_35@223026 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-01 14:28:19 +00:00
Daniel Sanders
e2c44a48fc Merged from r220561:
[mips] Remove redundant code in RetCC_MipsN. NFC.

Summary:
i32 is always promoted to i64 so it no longer makes sense to assign i32 to
registers.

Reviewers: vmedic

Reviewed By: vmedic

Subscribers: llvm-commits

Differential Revision: http://reviews.llvm.org/D5964




git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_35@223025 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-01 14:26:43 +00:00
Daniel Sanders
b831bf65ac Merged from r220556:
[mips] For N32/N64, structs must be passed in the upper bits of a register.

Summary:
Most structs were fixed by r218451 but those of between >32-bits and
<64-bits remained broken since they were not marked with [ASZ]ExtUpper.
This patch fixes the remaining cases by using
CCPromoteToUpperBitsInType<i64> on i64's in addition to i32 and smaller.

Reviewers: vmedic

Reviewed By: vmedic

Subscribers: llvm-commits

Differential Revision: http://reviews.llvm.org/D5963




git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_35@223024 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-01 14:17:47 +00:00
Daniel Sanders
823dcfbd39 Merged from r219931:
[mips] Account for endianess when expanding BuildPairF64/ExtractElementF64 nodes.

Summary:
In order to support big endian targets for the BuildPairF64 nodes we
just need to swap the low/high pair registers. Additionally, for the
ExtractElementF64 nodes we have to calculate the correct stack offset
with respect to the node's register/operand that we want to extract.

Reviewers: dsanders

Reviewed By: dsanders

Subscribers: llvm-commits

Differential Revision: http://reviews.llvm.org/D5753




git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_35@223023 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-01 14:16:14 +00:00
Daniel Sanders
c10d50bda0 Merged from r219196:
[mips] Return {f128} correctly for N32/N64.

Summary:
According to the ABI documentation, f128 and {f128} should both be returned
in $f0 and $f2. However, this doesn't match GCC's behaviour which is to
return f128 in $f0 and $f2, but {f128} in $f0 and $f1.

Reviewers: vmedic

Reviewed By: vmedic

Subscribers: llvm-commits

Differential Revision: http://reviews.llvm.org/D5578



git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_35@223022 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-01 14:15:05 +00:00
Daniel Sanders
dcc85a306c Merging r218452:
------------------------------------------------------------------------
r218452 | dsanders | 2014-09-25 14:08:51 +0100 (Thu, 25 Sep 2014) | 3 lines

Add llvm_unreachables() for [ASZ]ExtUpper to X86FastISel.cpp to appease the buildbots.


------------------------------------------------------------------------


git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_35@223021 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-01 14:10:48 +00:00
Daniel Sanders
928c60c297 Merged from r218510:
Fix unused variable warning added in r218509



git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_35@223020 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-01 13:58:19 +00:00
Daniel Sanders
e180fba5f2 Merged from r218509:
[mips] Generalize the handling of f128 return values to support f128 arguments.

Summary:
This will allow us to handle f128 arguments without duplicating code from
CCState::AnalyzeFormalArguments() or CCState::AnalyzeCallOperands().

No functional change.

Reviewers: vmedic

Reviewed By: vmedic

Subscribers: llvm-commits

Differential Revision: http://reviews.llvm.org/D5292



git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_35@223019 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-01 13:55:59 +00:00
Daniel Sanders
011f313edc Merged from r218451:
[mips] Add CCValAssign::[ASZ]ExtUpper and CCPromoteToUpperBitsInType and handle struct's correctly on big-endian N32/N64 return values.

Summary:
The N32/N64 ABI's require that structs passed in registers are laid out
such that spilling the register with 'sd' places the struct at the lowest
address. For little endian this is trivial but for big-endian it requires
that structs are shifted into the upper bits of the register.

We also require that structs passed in registers have the 'inreg'
attribute for big-endian N32/N64 to work correctly. This is because the
tablegen-erated calling convention implementation only has access to the
lowered form of struct arguments (one or more integers of up to 64-bits
each) and is unable to determine the original type.

Reviewers: vmedic

Reviewed By: vmedic

Subscribers: llvm-commits

Differential Revision: http://reviews.llvm.org/D5286




git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_35@223018 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-01 13:46:55 +00:00
Daniel Sanders
5bedd9e618 Merged from r218036:
[mips] Remove custom versions of CCState::AnalyzeReturn() and CCState::AnalyzeCallReturn().

Summary:
The N32/N64 ABI's return f128 values in $f0 and $f2 for hard-float and $v0 and
$a0 for soft-float. The registers used in the soft-float case differ from the
usual $v0, and $v1 specified for return values.

Both cases were previously handled by duplicating the CCState::AnalyzeReturn()
and CCState::AnalyzeCallReturn() functions and modifying them to delegate to
a different assignment function for f128 and further replace the register type
for the hard-float case. There is a simpler way to do both of these.

We now use the common functions and select an initial assignment function based
on whether the original type is f128 or not. We then handle the hard-float case
using CCBitConvertToType<>.

No functional change.

Reviewers: vmedic

Reviewed By: vmedic

Subscribers: llvm-commits

Differential Revision: http://reviews.llvm.org/D5269



git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_35@223017 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-01 13:34:51 +00:00
Daniel Sanders
9892ea5ad8 Merged from r217494:
[mips] Remove inverted predicates from MipsSubtarget that were only used by MipsCallingConv.td

Summary: No functional change

Reviewers: echristo, vmedic

Reviewed By: echristo, vmedic

Subscribers: echristo, llvm-commits

Differential Revision: http://reviews.llvm.org/D5266



git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_35@223016 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-01 13:25:44 +00:00
Daniel Sanders
892a46ff83 Merged from r217485:
[mips] Return an ArrayRef from MipsCC::intArgRegs() and remove MipsCC::numIntArgRegs()

Summary: No functional change.

Reviewers: vmedic

Reviewed By: vmedic

Subscribers: llvm-commits

Differential Revision: http://reviews.llvm.org/D5265




git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_35@223015 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-01 13:18:25 +00:00
Daniel Sanders
1b213676f9 Merged from r217436:
[mips] Move MipsTargetLowering::MipsCC::regSize() to MipsSubtarget::getGPRSizeInBytes()

Summary:
The GPR size is more a property of the subtarget than that of the ABI so move
this information to the MipsSubtarget.

No functional change.

Reviewers: vmedic

Reviewed By: vmedic

Subscribers: llvm-commits

Differential Revision: http://reviews.llvm.org/D5009




git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_35@223014 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-01 13:17:00 +00:00
Daniel Sanders
11fcd25eb7 Merged from r217434:
[mips] Don't cache IsO32 and IsFP64 in MipsTargetLowering::MipsCC

Summary:
Use a MipsSubtarget reference instead.

No functional change.

Reviewers: vmedic

Reviewed By: vmedic

Subscribers: llvm-commits

Differential Revision: http://reviews.llvm.org/D5008




git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_35@223013 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-01 13:15:04 +00:00
Daniel Sanders
cb3c315c96 Merged from r215640:
[mips] Improve robustness of some tests.

Summary:
This is done by removing some hardcoded registers like $at or expecting a single digit register to be selected.

Contains work done by Matheus Almeida.

Reviewers: matheusalmeida, dsanders

Reviewed By: dsanders

Subscribers: tomatabacu

Differential Revision: http://reviews.llvm.org/D4227



git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_35@223012 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-01 11:43:13 +00:00
Daniel Sanders
f1f5c3baed Merged from r215211:
[mips] Invert the abicalls feature bit to be noabicalls so that it's possible for -mno-abicalls to take effect.

Also added the testcase that should have been in r215194.

This behaviour has surprised me a few times now. The problem is that the
generated MipsSubtarget::ParseSubtargetFeatures() contains code like this:

   if ((Bits & Mips::FeatureABICalls) != 0) IsABICalls = true;

so '-abicalls' means 'leave it at the default' and '+abicalls' means 'set it to
true'. In this case, (and the similar -modd-spreg case) I'd like the code to be

  IsABICalls = (Bits & Mips::FeatureABICalls) != 0;

or possibly:

   if ((Bits & Mips::FeatureABICalls) != 0)
     IsABICalls = true;
   else
     IsABICalls = false;

and preferably arrange for 'Bits & Mips::FeatureABICalls' to be true by default
(on some triples).




git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_35@223011 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-01 11:38:38 +00:00
Daniel Sanders
3b09b1f496 Merged from r215194:
[mips] Initial implementation of -mabicalls/-mno-abicalls.

This patch implements the main rules for -mno-abicalls such as reserving $gp,
and emitting the correct .option directive.

Patch by Matheus Almeida and Toma Tabacu

Differential Revision: http://reviews.llvm.org/D4231



git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_35@223009 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-01 11:32:07 +00:00
Daniel Sanders
da5b8f2252 Merged from r214578:
llvm/test/CodeGen/Mips/cconv/arguments-varargs.ll: Add explicit -mtriple=(mips|mipsel)-linux on 4 lines.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_35@223008 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-01 11:23:40 +00:00
Daniel Sanders
ae5e83adbd Merged from r214493:
[mips][PR19612] Fix va_arg for big-endian mode.

Summary:
Big-endian mode was not correctly adjusting the offset for types smaller
than an ABI slot.

Fixes PR19612

Reviewers: dsanders

Reviewed By: dsanders

Subscribers: sstankovic, llvm-commits

Differential Revision: http://reviews.llvm.org/D4556



git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_35@223007 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-01 11:22:34 +00:00
Daniel Sanders
9290cd66a8 Merging r217257:
------------------------------------------------------------------------
r217257 | tomatabacu | 2014-09-05 17:32:09 +0100 (Fri, 05 Sep 2014) | 9 lines

[mips] Change Feature-related types from unsigned to uint64_t in MipsAsmParser. No functional changes.

Summary: Found a couple of cases where unsigned was still being used. These two should be the last ones in the (entire) Mips backend.

Reviewers: dsanders

Reviewed By: dsanders

Differential Revision: http://reviews.llvm.org/D5028
------------------------------------------------------------------------


git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_35@222875 91177308-0d34-0410-b5e6-96231b3b80d8
2014-11-27 10:55:46 +00:00
Daniel Sanders
7bea0cea87 Merging r218745:
------------------------------------------------------------------------
r218745 | dsanders | 2014-10-01 09:26:55 +0100 (Wed, 01 Oct 2014) | 7 lines

[mips] Fix disassembly of [ls][wd]c[23], cache, and pref                          
                                                                                  
Fixes PR21015, and PR20993.                                                       
                                                                                  
Patch by Jun Koi


------------------------------------------------------------------------


git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_35@222696 91177308-0d34-0410-b5e6-96231b3b80d8
2014-11-24 21:47:34 +00:00
Daniel Sanders
f47ab164df Merging r216262:
------------------------------------------------------------------------
r216262 | sstankovic | 2014-08-22 10:23:22 +0100 (Fri, 22 Aug 2014) | 5 lines

[mips] Don't use odd-numbered float registers for double arguments for fastcc
calling convention if FP is 64-bit and +nooddspreg is used.

Differential Revision: http://reviews.llvm.org/D4981.diff

------------------------------------------------------------------------


git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_35@222695 91177308-0d34-0410-b5e6-96231b3b80d8
2014-11-24 21:47:07 +00:00
Daniel Sanders
b164bc7bab Merging r221453:
------------------------------------------------------------------------
r221453 | tomatabacu | 2014-11-06 14:25:42 +0000 (Thu, 06 Nov 2014) | 17 lines

[mips] Tolerate the use of the %z inline asm operand modifier with non-immediates.

Summary:
Currently, we give an error if %z is used with non-immediates, instead of continuing as if the %z isn't there.

For example, you use the %z operand modifier along with the "Jr" constraints ("r" makes the operand a register, and "J" makes it an immediate, but only if its value is 0). 
In this case, you want the compiler to print "$0" if the inline asm input operand turns out to be an immediate zero and you want it to print the register containing the operand, if it's not.

We give an error in the latter case, and we shouldn't (GCC also doesn't).

Reviewers: dsanders

Reviewed By: dsanders

Subscribers: llvm-commits

Differential Revision: http://reviews.llvm.org/D6023
------------------------------------------------------------------------


git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_35@222693 91177308-0d34-0410-b5e6-96231b3b80d8
2014-11-24 21:42:40 +00:00
Daniel Sanders
5b34a189e1 Merging r221408:
------------------------------------------------------------------------
r221408 | petarj | 2014-11-05 22:42:31 +0000 (Wed, 05 Nov 2014) | 9 lines

[mips64] Fix MIPS64 exception personality encoding

Remove dynamic relocations of __gxx_personality_v0 from the .eh_frame.
The MIPS64 follow-up of the MIPS32 fix (rL209907).

Patch by Vladimir Stefanovic.

Differential Revision: http://reviews.llvm.org/D6141

------------------------------------------------------------------------


git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_35@222692 91177308-0d34-0410-b5e6-96231b3b80d8
2014-11-24 21:37:42 +00:00