-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Armv7-M: Allow register overlap in ldm + ldrd #153
Open
SH1E0r1r2y
wants to merge
11
commits into
slothy-optimizer:main
Choose a base branch
from
SH1E0r1r2y:overlap
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 2 commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
0a9ac4e
fixed the register overlap
SH1E0r1r2y bc18688
add example for overlap
SH1E0r1r2y 3c8dd2f
fixed the example
SH1E0r1r2y 1825961
M7: Fix Keccak M7 code size
mkannwischer 7ce4998
Always run CI
mkannwischer 89e54ee
CM7: Simplify Kyber basemuls naive
dop-amin 25aaba0
CM7: Simplify Dilithium iNTT code
dop-amin ec8112c
CM7: Simplify Dilithium 769 NTT code
dop-amin da0c503
CM7: Re-enable address offset fixup for Dilithium NTT
dop-amin 66fab54
fixed the example.2
SH1E0r1r2y 02dd6fe
fixed.3 & add part of examples
SH1E0r1r2y File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,69 +1,75 @@ | ||
|
||
start: | ||
// Instructions: 24 | ||
// Expected cycles: 26 | ||
// Expected IPC: 0.92 | ||
// | ||
// Cycle bound: 26.0 | ||
// IPC bound: 0.92 | ||
// | ||
// Wall time: 0.20s | ||
// User time: 0.20s | ||
// | ||
// ----- cycle (expected) ------> | ||
// 0 25 | ||
// |------------------------|---- | ||
ldr r6, [r0, #4] // *............................. // @slothy:reads=a | ||
add r10, r2, r6 // .*............................ | ||
eor.w r1, r10, r3 // ..*........................... | ||
smlabt r7, r2, r2, r1 // ..*........................... | ||
asrs r5, r7, #1 // ....*......................... | ||
str r5, [r0, #4] // ....*......................... // @slothy:writes=a | ||
ldm r0, {r7,r9,r11} // .....*........................ // @slothy:reads=a | ||
add r8, r9, r7 // ........*..................... | ||
eor.w r2, r8, r11 // .........*.................... | ||
smlabt r12, r9, r9, r2 // .........*.................... | ||
asrs r11, r12, #1 // ...........*.................. | ||
str r11, [r0, #4] // ...........*.................. // @slothy:writes=a | ||
ldm r0, {r7,r8,r10} // ............*................. // @slothy:reads=a | ||
add r6, r8, r7 // ...............*.............. | ||
eor.w r5, r6, r10 // ................*............. | ||
smlabt r12, r8, r8, r5 // ................*............. | ||
asrs r9, r12, #1 // ..................*........... | ||
str r9, [r0, #4] // ..................*........... // @slothy:writes=a | ||
ldm r0, {r1,r2,r8} // ...................*.......... // @slothy:reads=a | ||
add r14, r2, r1 // ......................*....... | ||
eor.w r5, r14, r8 // .......................*...... | ||
smlabt r10, r2, r2, r5 // .......................*...... | ||
asrs r3, r10, #1 // .........................*.... | ||
str r3, [r0, #4] // .........................*.... // @slothy:writes=a | ||
// Instructions: 27 | ||
// Expected cycles: 27 | ||
// Expected IPC: 1.00 | ||
// | ||
// Cycle bound: 27.0 | ||
// IPC bound: 1.00 | ||
// | ||
// Wall time: 0.22s | ||
// User time: 0.22s | ||
// | ||
// ----- cycle (expected) ------> | ||
// 0 25 | ||
// |------------------------|---- | ||
ldr r4, [r0, #4] // *............................. // @slothy:reads=a | ||
add r4, r2, r4 // .*............................ | ||
eor.w r4, r4, r3 // ..*........................... | ||
smlabt r2, r2, r2, r4 // ..*........................... | ||
asrs r2, r2, #1 // ....*......................... | ||
str r2, [r0, #4] // ....*......................... // @slothy:writes=a | ||
ldm r0, {r11,r12,r14} // .....*........................ // @slothy:reads=a | ||
add r2, r12, r11 // ........*..................... | ||
eor.w r2, r2, r14 // .........*.................... | ||
smlabt r2, r12, r12, r2 // .........*.................... | ||
asrs r2, r2, #1 // ...........*.................. | ||
str r2, [r0, #4] // ...........*.................. // @slothy:writes=a | ||
ldm r0, {r11,r12,r14} // ............*................. // @slothy:reads=a | ||
add r2, r12, r11 // ...............*.............. | ||
eor.w r2, r2, r14 // ................*............. | ||
smlabt r2, r12, r12, r2 // ................*............. | ||
asrs r2, r2, #1 // ..................*........... | ||
str r2, [r0, #4] // ..................*........... // @slothy:writes=a | ||
ldm r0, {r11,r12,r14} // ...................*.......... // @slothy:reads=a | ||
add r2, r12, r11 // ......................*....... | ||
eor.w r14, r2, r14 // .......................*...... | ||
smlabt r6, r12, r12, r14 // .......................*...... | ||
ldrd r4, r2, [r14, #8] // ........................*..... | ||
str r4, [r0] // ........................*..... | ||
asrs r2, r6, #1 // .........................*.... | ||
str r2, [r0, #4] // .........................*.... // @slothy:writes=a | ||
ldm r0, {r0,r1,r2,r3} // ..........................*... | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Your output shows that you have not turned on fusion. So the code you have commited isn't actually used. |
||
|
||
// ------ cycle (expected) ------> | ||
// 0 25 | ||
// |------------------------|----- | ||
// ldr r1, [r0, #4] // *.............................. | ||
// add r1, r2,r1 // .*............................. | ||
// eor.w r1,r1, r3 // ..*............................ | ||
// smlabt r3,r2, r2, r1 // ..*............................ | ||
// asrs r3, r3,#1 // ....*.......................... | ||
// str r3, [r0,#4] // ....*.......................... | ||
// ldm r0, {r1-r2,r14} // .....*......................... | ||
// add r1, r2,r1 // ........*...................... | ||
// eor.w r1,r1, r14 // .........*..................... | ||
// smlabt r3,r2, r2, r1 // .........*..................... | ||
// asrs r3, r3,#1 // ...........*................... | ||
// str r3, [r0,#4] // ...........*................... | ||
// ldm r0, {r1-r3} // ............*.................. | ||
// add r1, r2,r1 // ...............*............... | ||
// eor.w r1,r1, r3 // ................*.............. | ||
// smlabt r3,r2, r2, r1 // ................*.............. | ||
// asrs r3, r3,#1 // ..................*............ | ||
// str r3, [r0,#4] // ..................*............ | ||
// ldm r0, {r1,r2,r3} // ...................*........... | ||
// add r1, r2,r1 // ......................*........ | ||
// eor.w r1,r1, r3 // .......................*....... | ||
// smlabt r3,r2, r2, r1 // .......................*....... | ||
// asrs r3, r3,#1 // .........................*..... | ||
// str r3, [r0,#4] // .........................*..... | ||
// ------ cycle (expected) ------> | ||
// 0 25 | ||
// |------------------------|----- | ||
// ldr r1, [r0, #4] // *.............................. | ||
// add r1, r2,r1 // .*............................. | ||
// eor.w r1,r1, r3 // ..*............................ | ||
// smlabt r3,r2, r2, r1 // ..*............................ | ||
// asrs r3, r3,#1 // ....*.......................... | ||
// str r3, [r0,#4] // ....*.......................... | ||
// ldm r0, {r1-r2,r14} // .....*......................... | ||
// add r1, r2,r1 // ........*...................... | ||
// eor.w r1,r1, r14 // .........*..................... | ||
// smlabt r3,r2, r2, r1 // .........*..................... | ||
// asrs r3, r3,#1 // ...........*................... | ||
// str r3, [r0,#4] // ...........*................... | ||
// ldm r0, {r1-r3} // ............*.................. | ||
// add r1, r2,r1 // ...............*............... | ||
// eor.w r1,r1, r3 // ................*.............. | ||
// smlabt r3,r2, r2, r1 // ................*.............. | ||
// asrs r3, r3,#1 // ..................*............ | ||
// str r3, [r0,#4] // ..................*............ | ||
// ldm r0, {r1,r2,r3} // ...................*........... | ||
// add r1, r2,r1 // ......................*........ | ||
// eor.w r1,r1, r3 // .......................*....... | ||
// smlabt r3,r2, r2, r1 // .......................*....... | ||
// asrs r3, r3,#1 // .........................*..... | ||
// str r3, [r0,#4] // .........................*..... | ||
// ldrd r2, r3, [r1, #8] // ........................*...... | ||
// str r2,[r0] // ........................*...... | ||
// ldm r0 ,{r0-r3} // ..........................*.... | ||
|
||
end: |
This file contains 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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This does not actually overlap. Please change to