This is an archive of the discontinued LLVM Phabricator instance.

[mips][mips64r6] Add experimental support for MIPS32r6 and MIPS64r6
ClosedPublic

Authored by dsanders on May 6 2014, 8:35 AM.

Details

Summary

Adds MIPS32r6/MIPS64r6 and checks the compatibility requirements for these
processors.

I've also included comments to describe removed and re-encoded instructions,
along with placeholder def's for the new instructions but there are no
functional changes to codegen at this point.

Diff Detail

Event Timeline

dsanders updated this revision to Diff 9112.May 6 2014, 8:35 AM
dsanders updated this revision to Diff 9113.
dsanders retitled this revision from to [mips][mips64r6] Add experimental support for MIPS32r6 and MIPS64r6.
dsanders updated this object.
dsanders edited the test plan for this revision. (Show Details)
dsanders added reviewers: vmedic, jkolek.

Without the unintended files

vmedic edited edge metadata.May 7 2014, 1:48 AM

The patch looks good to me except for one concern, without definition changes I can't be sure how this will behave: FeatureMips32r6 includes the definition of FeatureMips32r2, meaning that FeatureMips32r2 is defined whenever FeatureMips32r6 is.

def FeatureMips32r6 : SubtargetFeature<"mips32r6", "MipsArchVersion",
"Mips32r6",
"Mips32r6 ISA Support [experimental]",
[FeatureMips32r2, FeatureFP64Bit,
FeatureNaN2008]>;

So, for example, madd.tfm instructions are listed among those that will be removed from r6. They are defined to require FeatureMips32r2, so if this is included in FeatureMips32r6 there might be a conflict. Again, I'm not sure that this will be a case, just expresing the concern.

//**let Predicates = [HasMips32r2, HasStdEnc] in {

def MADD_S : MMRel, MADDS_FT<"madd.s", FGR32Opnd, II_MADD_S, fadd>,
             MADDS_FM<4, 0>;
def MSUB_S : MMRel, MADDS_FT<"msub.s", FGR32Opnd, II_MSUB_S, fsub>,
             MADDS_FM<5, 0>;

}**//

dsanders added a comment.EditedMay 7 2014, 2:22 AM

You're correct that enabling FeatureMips32r2 (and similarly FeatureMips64r2) is wrong. However, it's the best starting point available at the moment. I have a patch-series that correctly annotates all instructions with MIPS1-5 predicates (and tests for both validity on the right CPU and invalidity on the wrong CPUs) which is currently blocked by D3506. Once that is in place we can change it to FeatureMips2 & other bits. I should comment on that in the commit message.

vmedic accepted this revision.May 7 2014, 3:04 AM
vmedic edited edge metadata.

Like I said, it is tricky without full definitions, so if you have other patches prepared that take care of it this is OK.

This revision is now accepted and ready to land.May 7 2014, 3:04 AM
dsanders updated this revision to Diff 9242.May 9 2014, 2:41 AM
dsanders edited edge metadata.

Refresh patch before commit

dsanders closed this revision.May 9 2014, 2:53 AM