Repository navigation
Fix the condition, register and immediate of arm32 cmp, cmn, tst and teq ##arch - #27141
Merged
trufae merged 1 commit intoOct 23, 2026
Merged
Conversation
…teq ##arch Co-Authored-By: Claude Opus 5.5 <[email protected]>
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.
Description
cmp,cmn,tstandteqwith an immediate dropped the condition , and above 255 also the register :cmnhi r10, 417792cmn r0, #208896660a7a83teqeq r11, 1856teq r0, #18561d0d3b03tstmi r9, 108, 12tst r9, #108, #126c061943cmple sp, 236, 30ec0f5df3, condition0xf, not an instructionec0f5dd30xe2into the low byte . the2is the I bit , theeis thealcondition , and it was ORed over the condition that was already there , soeqcame out asal, and anything with the top bit , likele, asnvfindyz, which did not set Rn and computed the rotation wrong . it had no other caller , so it is gone , and the value goes throughgetimmed8, the same encodermovuses , which refuses what has no 8 bit rotated form#imm8, #rotform keeps its own path , only checked to fit in 8 bits now , and a bad first register is refused instead of OR'd in as -1found by decoding random words with llvm-mc (
-triple=armv7) , assembling the text withrasm2 -a arm -b 32and decoding the result again . same as llvm went from 618 to 659 of 3459 : 22 that were wrong and 19 thatfindyzrefused , nothing that was right changed . the 6 new lines indb/asm/arm_32fail before the change . the new test indb/tools/rasm2pins that a value with no encoding (tst r0, 0x101) is refused , master refused it too but also loggedParameter 257 out of range (0-255).db/asmhas no failures .the tests are added next to the other compare tests and not at the end of the files , so this does not conflict with #27137 or #27140 , which touch other parts of
armass.c.