Reenable X25519 selftest and use .equ instead of define#380
Draft
mkannwischer wants to merge 9 commits into
Draft
Reenable X25519 selftest and use .equ instead of define#380mkannwischer wants to merge 9 commits into
mkannwischer wants to merge 9 commits into
Conversation
Collaborator
mkannwischer
commented
Dec 17, 2025
- Depends on aarch64: Proper fcsel support #375
- Depends on Neon: Set addr for 3 instructions #376
- Depends on equ: Allow underscores in names, and spaces in expressions #378
- Depends on X25519: Fix literal pool loads #= -> = #379
- Resolves Several Problems when running tutorial-7.py #358
LLVM-MC fails to assemble ldr x24, #=121666 while GAS assembles this without complaints. LLVM seems to be right - the correct syntax for literal pool loads is ldr x255, =121666. This commit fixes the wrong syntax in all places in slothy. Signed-off-by: Matthias J. Kannwischer <matthias@kannwischer.eu>
SLOTHY accepts literals as #=1234 and =1234 just like GAS, and unlike LLVM which only accepts the proper =1234. However, SLOTHY before incorrectly always outputs #=1234 which breaks if you want to assembly it using LLVM (or if you are in a multi-step optimization and run SLOTHY on the output again). This commit fixes SLOTHY by separating the parsing and writing of immediates and literals. Signed-off-by: Matthias J. Kannwischer <matthias@kannwischer.eu>
* Introduces register aliases for dform registers into the clean source.
For the selftest to properly detect which registers are used as addresses,
the model needs to set the addr property. This was missing for 3 instructions:
1) ld2 { <Va>.<dt>, <Vb>.<dt> }[<index>], [<Xa>], <imm>"
2) ldr <Wd>, [<Xa>, <Wb>, SXTW <imm>]
3) ld1r {<Va>.<dt>}, [<Xa>], <imm>
This commit fixes that and also adds a unit test for all memory operations
(some currently can't be tested as they are not supported by the A55 model).
Signed-off-by: Matthias J. Kannwischer <matthias@kannwischer.eu>
I noticed that our equ parsing cannot handle underscores and spaces well. This commit fixes that and adds a test. Signed-off-by: Matthias J. Kannwischer <matthias@kannwischer.eu>
SLOTHY cannot understand constants defined as preprocessor macros and, hence, the selftest fails on X25519 as the stack offsets are not defined. This commit fixes that using equ instead of define. - Resolves #358 Signed-off-by: Matthias J. Kannwischer <matthias@kannwischer.eu>
0fbed07 to
c7e41b9
Compare
Collaborator
Author
|
We cannot merge this yet. there are still some problems: |
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.