Page MenuHomePhabricator

[PowerPC] Don't use rldicl when targeting 32bit CPUs
ClosedPublic

Authored by LemonBoy on Apr 11 2020, 9:12 AM.

Details

Reviewers
hfinkel
nemanjai
MaskRay
Group Reviewers
Restricted Project
Commits
rGa5d161c119d5: [PowerPC] Don't use rldicl for PPC32
Summary

As reported in the documentation the rldicl instruction should not be used when targeting 32bit CPUs.

Since rldicl is used to clear the upper 32bits of the byteswapped register I've patched the tablegen pattern to avoid emitting it when a 32bit CPU is targeted.

It's my first adventure with TableGen and its DSL so be kind, I also have a few unresolved questions:

  • Should the predicate be use64BitRegs instead of In64BitMode ?
  • The i64 byteswap is marked as legal but is still expanded, I'd expect that to cause a "failure to select" error but that's not the case. Am I missing something?

Diff Detail

Event Timeline

LemonBoy created this revision.Apr 11 2020, 9:12 AM
LemonBoy set the repository for this revision to rG LLVM Github Monorepo.Apr 13 2020, 3:41 AM
Herald added a project: Restricted Project. · View Herald TranscriptApr 13 2020, 3:41 AM
nemanjai accepted this revision.Apr 16 2020, 2:31 AM

LGTM. Thanks for fixing this.

llvm/lib/Target/PowerPC/PPCInstrInfo.td
5074

These are the right predicates to use. Using RLDICL in 32-bit mode is at best unnecessary here and at worst not legal.

This revision is now accepted and ready to land.Apr 16 2020, 2:31 AM

Can you (or anyone) commit this on my behalf? I don't have commit access.

MaskRay accepted this revision.Apr 18 2020, 5:21 PM
MaskRay added a subscriber: MaskRay.

Will commit shortly.

This revision was automatically updated to reflect the committed changes.