PowerPC: add mcrxr instruction definition - #94
Open
StilesCrisis wants to merge 1 commit into
Open
Conversation
mcrxr (Move to Condition Register from XER) was part of the original POWER/PowerPC architecture, but was dropped from Book I as of PowerPC ISA 2.03 - superseded by the non-destructive mcrxrx below on ISA 3.0+ implementations. It moves the top 4 XER bits (SO, OV, CA and a reserved bit) into a chosen CR field and clears them in XER. It's still found in legacy PowerPC/POWER binaries, but was never implemented by LLVM's own PPC backend (which post-dates its removal from the ISA), so it isn't decoded by Capstone either. Encoding is X-form, opcode 31, XO 512 - the same XForm_17-derived layout already used above for mcrxrx's XO 576, with the same single BF (crf) operand. That XO slot is unused by any other PPC instruction, so it's added unconditionally, without a Requires<> predicate. Added a matching P9/P10 scheduling-resource entry (mirroring mcrxrx's) in P9InstrResources.td / P10InstrResources.td: both processor models have CompleteModel = 1, so mcrxr needs a scheduling class to keep tblgen's schedule-completeness check passing. This is the counterpart to capstone-engine/capstone#3065, which carries the corresponding regenerated Capstone tables (regenerated via ASUpdater -a PPC against this change) and has the verification details (test suite results, encoding confirmation, etc). Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012jWces2QBvBWg9m3NfxH4v
2 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implements the
mcrxropcode for disassembly (Move to Condition Register from XER). This opcode was part of the original POWER/PowerPC architecture but was dropped from Book I as of PowerPC ISA 2.03.This CL backs capstone-engine/capstone#3065 (with issue capstone-engine/capstone#3066).
Tests and all PPC table generators complete without error.