Skip to content

Conversation

@korran
Copy link
Contributor

@korran korran commented Oct 17, 2025

The crc32 instructions are non-standard and not supported by upstream clang.

According to perftest, this only slows things down by a few cycles

before:
I00003 crc32_perftest.c:33] CRC32 computed in 11343 cycles. 
I00004 crc32_perftest.c:33] CRC32 computed in 11317 cycles. 
I00005 crc32_perftest.c:33] CRC32 computed in 11314 cycles. 
I00006 crc32_perftest.c:33] CRC32 computed in 11314 cycles. 
I00007 crc32_perftest.c:33] CRC32 computed in 11314 cycles. 
I00008 crc32_perftest.c:33] CRC32 computed in 11314 cycles. 
I00009 crc32_perftest.c:33] CRC32 computed in 11314 cycles. 
I00010 crc32_perftest.c:33] CRC32 computed in 11314 cycles. 
I00011 crc32_perftest.c:33] CRC32 computed in 11314 cycles. 
I00012 crc32_perftest.c:33] CRC32 computed in 11314 cycles.

after:
I00003 crc32_perftest.c:33] CRC32 computed in 11358 cycles. 
I00004 crc32_perftest.c:33] CRC32 computed in 11319 cycles. 
I00005 crc32_perftest.c:33] CRC32 computed in 11318 cycles. 
I00006 crc32_perftest.c:33] CRC32 computed in 11318 cycles. 
I00007 crc32_perftest.c:33] CRC32 computed in 11318 cycles. 
I00008 crc32_perftest.c:33] CRC32 computed in 11318 cycles. 
I00009 crc32_perftest.c:33] CRC32 computed in 11318 cycles. 
I00010 crc32_perftest.c:33] CRC32 computed in 11318 cycles. 
I00011 crc32_perftest.c:33] CRC32 computed in 11318 cycles.

@korran korran requested a review from a team as a code owner October 17, 2025 22:36
@korran korran requested review from pamaury and removed request for a team October 17, 2025 22:36
@cfrantz cfrantz requested a review from luismarques October 17, 2025 22:38
@cfrantz
Copy link
Contributor

cfrantz commented Oct 17, 2025

bazel run //quality:clang_format_fix to fix the C++ formatting.

The crc32 instructions are non-standard and not supported by upstream
clang.

According to perftest, this only slows things down by a few cycles

before:
I00003 crc32_perftest.c:33] CRC32 computed in 11343 cycles.
I00004 crc32_perftest.c:33] CRC32 computed in 11317 cycles.
I00005 crc32_perftest.c:33] CRC32 computed in 11314 cycles.
I00006 crc32_perftest.c:33] CRC32 computed in 11314 cycles.
I00007 crc32_perftest.c:33] CRC32 computed in 11314 cycles.
I00008 crc32_perftest.c:33] CRC32 computed in 11314 cycles.
I00009 crc32_perftest.c:33] CRC32 computed in 11314 cycles.
I00010 crc32_perftest.c:33] CRC32 computed in 11314 cycles.
I00011 crc32_perftest.c:33] CRC32 computed in 11314 cycles.
I00012 crc32_perftest.c:33] CRC32 computed in 11314 cycles.

after:
I00003 crc32_perftest.c:33] CRC32 computed in 11358 cycles.
I00004 crc32_perftest.c:33] CRC32 computed in 11319 cycles.
I00005 crc32_perftest.c:33] CRC32 computed in 11318 cycles.
I00006 crc32_perftest.c:33] CRC32 computed in 11318 cycles.
I00007 crc32_perftest.c:33] CRC32 computed in 11318 cycles.
I00008 crc32_perftest.c:33] CRC32 computed in 11318 cycles.
I00009 crc32_perftest.c:33] CRC32 computed in 11318 cycles.
I00010 crc32_perftest.c:33] CRC32 computed in 11318 cycles.
I00011 crc32_perftest.c:33] CRC32 computed in 11318 cycles.

Signed-off-by: Kor Nielsen <[email protected]>
Copy link
Contributor

@luismarques luismarques left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall LGTM. See the inline comment about zbc.

@korran
Copy link
Contributor Author

korran commented Oct 20, 2025

Overall LGTM. See the inline comment about zbc.

I tried that, but it broke the "[Verilated English Breakfast]" test cases; you must not be using that compiler flag everywhere.

I will put it back and re-run the tests.

@timothytrippel timothytrippel merged commit a3af426 into lowRISC:earlgrey_1.0.0 Oct 20, 2025
128 of 132 checks passed
@luismarques luismarques added the CherryPick:master This PR should be cherry-picked to master label Jan 28, 2026
@lowrisc-ci
Copy link

lowrisc-ci bot commented Jan 28, 2026

Successfully created backport PR for master:

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

Labels

CherryPick:master This PR should be cherry-picked to master

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants