This is an archive of the discontinued LLVM Phabricator instance.

[mips] Remove custom versions of CCState::AnalyzeReturn() and CCState::AnalyzeCallReturn().
ClosedPublic

Authored by dsanders on Sep 9 2014, 7:41 AM.

Details

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.

Diff Detail

Event Timeline

dsanders updated this revision to Diff 13464.Sep 9 2014, 7:41 AM
dsanders retitled this revision from to [mips] Remove custom versions of CCState::AnalyzeReturn() and CCState::AnalyzeCallReturn()..
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).
vmedic added inline comments.Sep 10 2014, 7:04 AM
lib/Target/Mips/MipsISelLowering.cpp
2377

I don't see the implementation of this function, is that generated by tableGen?

dsanders added inline comments.Sep 10 2014, 7:12 AM
lib/Target/Mips/MipsISelLowering.cpp
2377

It's on line 3372. I've only moved the prototype so that I can use it from the tablegen-erated code.

vmedic accepted this revision.Sep 11 2014, 2:10 AM
vmedic edited edge metadata.

LGTM.

lib/Target/Mips/MipsISelLowering.cpp
2377

OK, sorry. I thought that the method is newly introduced and was confused since the diff didn't show the code for it.

This revision is now accepted and ready to land.Sep 11 2014, 2:10 AM
dsanders closed this revision.Sep 18 2014, 1:38 AM