Page MenuHomePhabricator

[mips] Promote i32 arguments to i64 for the N32/N64 ABI and fix <64-bit structs...
ClosedPublic

Authored by dsanders on Nov 4 2014, 7:04 AM.

Details

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 ABITest.py.

Depends on D6116

Diff Detail

Repository
rL LLVM

Event Timeline

dsanders updated this revision to Diff 15766.Nov 4 2014, 7:04 AM
dsanders retitled this revision from to [mips] Promote i32 arguments to i64 for the N32/N64 ABI and fix <64-bit structs....
dsanders updated this object.
dsanders edited the test plan for this revision. (Show Details)
dsanders added a reviewer: vmedic.
dsanders added a subscriber: Unknown Object (MLST).

Added David as reviewer.

David: This is the important one for your work but the others are necessary to make it possible to do this without breaking softfloat.

theraven edited edge metadata.Nov 5 2014, 7:49 AM
In D6117#5, @dsanders wrote:

Added David as reviewer.

David: This is the important one for your work but the others are necessary to make it possible to do this without breaking softfloat.

We also rely on softfloat - softfloat, MIPS III, n64 is the default on FreeBSD (and JunOS).

David: This is the important one for your work but the others are necessary to make it possible to do this without breaking softfloat.

We also rely on softfloat - softfloat, MIPS III, n64 is the default on FreeBSD (and JunOS).

This version of the patch preserves softfloat support and this was made possible by the refactoring in my recent commits and D6111-D6116 (which this patch depends on).

The previous versions of this patch that I've showed you via the bugzilla tickets broke softfloat but that's no longer the case.

Nothing obviously bad jumps out. Given that it fixes a load of things that are currently badly broken for us, I'd prefer to see these all go in immediately and have post-commit review if needed.

Ok. All but three (D6084, D6085, and this one) of them have been reviewed now. I'll do these three as post-commit reviews.

dsanders closed this revision.Nov 7 2014, 9:05 AM
dsanders updated this revision to Diff 15924.

Closed by commit rL221534 (authored by @dsanders).