Skip to content

[LA64_DYNAREC] Speed up crc validation - #4178

Merged
ptitSeb merged 1 commit into
ptitSeb:mainfrom
ksco:6-way-crc
Aug 3, 2026
Merged

[LA64_DYNAREC] Speed up crc validation#4178
ptitSeb merged 1 commit into
ptitSeb:mainfrom
ksco:6-way-crc

Conversation

@ksco

@ksco ksco commented Aug 3, 2026

Copy link
Copy Markdown
Collaborator

No description provided.

@ksco

ksco commented Aug 3, 2026

Copy link
Copy Markdown
Collaborator Author

This is only slightly slower than the exact match method, which is good enough.

@ptitSeb

ptitSeb commented Aug 3, 2026

Copy link
Copy Markdown
Owner

Well, the exact match will always be faster in case of mismatch...
But how this new one is faster? is it just loop unrolling?

@ptitSeb
ptitSeb merged commit e0ae94d into ptitSeb:main Aug 3, 2026
28 checks passed
@ksco

ksco commented Aug 3, 2026

Copy link
Copy Markdown
Collaborator Author

No, it's more than that. Every iteration of the original 1-way CRC loop has a data dependency on the previous iteration, and CRC is quite slow. A multi-way CRC loop will cancel most of those dependencies.

@ptitSeb

ptitSeb commented Aug 3, 2026

Copy link
Copy Markdown
Owner

Oh, I see. The point is to avoid starving the pipeline with dependant load+crc pairs

@ksco

ksco commented Aug 3, 2026

Copy link
Copy Markdown
Collaborator Author

For 12 elements, it's like

1 -> 2 -> 3 -> 4 -> 5 -> 6 -> 7 -> 8 -> 9 -> 10 -> 11 -> 12

v.s.

1 -> 7
  2 -> 8
    3 -> 9
      4 -> 10
        5 -> 11
          6 -> 12

@ksco
ksco deleted the 6-way-crc branch August 3, 2026 07:46
@ksco

ksco commented Aug 3, 2026

Copy link
Copy Markdown
Collaborator Author

I tested 4-way, 6-way, 8-way, 6 way seems to be the best, but I guess that depends on the hardware.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants