This is an archive of the discontinued LLVM Phabricator instance.

[PowerPC] Switch to by-name matching for instructions (part 2 of 2).
ClosedPublic

Authored by jyknight on Nov 8 2022, 2:14 PM.

Details

Summary

Currently, all of the "memri"-style complex operands, which contain
both a register and an immediate, are encoded into a single field in
the instruction definition. This requires complex encoders/decoders,
and instruction definitions that insert and extract the correct parts
of the bits.

Now, switch to naming and encoding/decoding the sub-operands
separately.

Thus, we can now disable useDeprecatedPositionallyEncodedOperands.

Diff Detail

Event Timeline

jyknight created this revision.Nov 8 2022, 2:14 PM
Herald added a project: Restricted Project. · View Herald TranscriptNov 8 2022, 2:14 PM
jyknight requested review of this revision.Nov 8 2022, 2:14 PM
Herald added a project: Restricted Project. · View Herald TranscriptNov 8 2022, 2:14 PM
jyknight edited the summary of this revision. (Show Details)Nov 8 2022, 2:19 PM
barannikov88 accepted this revision.Feb 2 2023, 1:16 AM

LGTM with one note

llvm/lib/Target/PowerPC/MCTargetDesc/PPCMCCodeEmitter.cpp
242

The new version lacks the assertion. Does it make sense to add an EncoderMethod to immZero just for this?

This revision is now accepted and ready to land.Feb 2 2023, 1:16 AM

Thanks for the reviews!

llvm/lib/Target/PowerPC/MCTargetDesc/PPCMCCodeEmitter.cpp
242

Verification in an encoder method that the MachineInstruction operand has a valid value is not typically done currently, for other kinds of operands. E.g. u5imm/etc don't have an EncoderMethod. Nor do other backends e.g. aarch64's simm8_32b/etc.

So I think it's probably not needed here, either.