This is an archive of the discontinued LLVM Phabricator instance.

[PowerPC] Set SubRegIndex offset for sub_vsx1/sub_pair1
ClosedPublic

Authored by jsji on Dec 8 2020, 10:15 AM.

Details

Reviewers
bsaleil
Group Reviewers
Restricted Project
Commits
rG45b08c41bfb0: [PowerPC] Set SubRegIndex offset for sub_vsx1/sub_pair1
Summary

We defined SubRegIndex for 256/512 regs, but we did not set the offset for higher part,
so the offset of lower and higher part are the same.
This may cause problem in access ranges of SubReg, it is great that this haven't affected any testcases,
but I think we should fix it to avoid hidden bugs in the future.

You can see the changes in PPCGenRegisterInfo.inc.

@@ -637,25 +637,25 @@
extern const MCRegisterInfo::SubRegCoveredBits PPCSubRegIdxRanges[] = {

{ 65535, 65535 },
{ 0, 32 },   // sub_32
{ 0, 64 },   // sub_64
{ 2, 1 },    // sub_eq
{ 1, 1 },    // sub_gt
{ 0, 1 },    // sub_lt
{ 0, 256 },  // sub_pair0
  • { 0, 256 }, // sub_pair1

+ { 256, 256 }, // sub_pair1

{ 3, 1 },    // sub_un
{ 0, 128 },  // sub_vsx0
  • { 0, 128 }, // sub_vsx1
  • { 0, 64 }, // sub_vsx1_then_sub_64
  • { 0, 64 }, // sub_pair1_then_sub_64
  • { 0, 128 }, // sub_pair1_then_sub_vsx0
  • { 0, 128 }, // sub_pair1_then_sub_vsx1
  • { 0, 64 }, // sub_pair1_then_sub_vsx1_then_sub_64

+ { 128, 128 }, sub_vsx1
+ { 128, 64 },
sub_vsx1_then_sub_64
+ { 256, 64 }, sub_pair1_then_sub_64
+ { 256, 128 },
sub_pair1_then_sub_vsx0
+ { 384, 128 }, sub_pair1_then_sub_vsx1
+ { 384, 64 },
sub_pair1_then_sub_vsx1_then_sub_64
};

Diff Detail

Event Timeline

jsji created this revision.Dec 8 2020, 10:15 AM
jsji requested review of this revision.Dec 8 2020, 10:15 AM
Herald added a project: Restricted Project. · View Herald TranscriptDec 8 2020, 10:15 AM
jsji added reviewers: bsaleil, Restricted Project.Dec 8 2020, 10:15 AM
jsji edited the summary of this revision. (Show Details)
bsaleil accepted this revision.Dec 8 2020, 1:38 PM

Good catch, thanks for fixing that.

This revision is now accepted and ready to land.Dec 8 2020, 1:38 PM
This revision was landed with ongoing or failed builds.Dec 8 2020, 7:57 PM
This revision was automatically updated to reflect the committed changes.