Repository navigation
uucore: name hardware features after the CPU instructions - #15232
Conversation
There was a problem hiding this comment.
🟢 Approval recommended
The rename is complete and preserves existing detection and output behavior.
0 open findings
What changed in this PR
Renames hardware feature APIs to match the detected CPU instructions without changing user-visible debug labels or behavior.
Changes:
- Renames PCLMULQDQ and PMULL feature variants, methods, and detectors.
- Updates
cksumandwccall sites while preserving output labels.
| File | Description |
|---|---|
src/uucore/src/lib/features/hardware.rs |
Renames hardware feature APIs. |
src/uu/cksum/src/cksum.rs |
Uses the renamed detection methods. |
src/uu/wc/src/wc.rs |
Updates variants while retaining existing labels. |
🧠 Review effort: Balanced
💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Merging this PR will not alter performance
|
b9051d8 to
53687b2
Compare
| "AVX2" => Ok(Avx2), | ||
| "PCLMUL" | "PMULL" => Ok(PclMul), | ||
| "VMULL" => Ok(Vmull), | ||
| "PCLMUL" | "PMULL" => Ok(Pclmulqdq), |
There was a problem hiding this comment.
with the new names, "PMULL" => Pclmulqdq looks wrong, is that intended?
There was a problem hiding this comment.
Yes, it's intended to keep this as a non-behavior-change PR and avoid a large hard-to-review diff. But I do have a plan to change them later after fixing another bug it's relying on for preventing regressions.
A sample of such regression of we make the change now for the keys here:
With GLIBC_TUNABLES=glibc.cpu.hwcaps=-PMULL
GNU: cksum: pclmul support not detected
main: cksum: pclmul support not detected
keys changed: cksum: using pclmul hardware support
There was a problem hiding this comment.
Hi @sylvestre, may I get this re-review to unblock the follow up work? Or if you still think this rename is not right, I can combine this PR with the follow up work but diff will be larger (might be harder to review).
53687b2 to
556b621
Compare
556b621 to
69dfb27
Compare
There was a problem hiding this comment.
Warning
Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.
Copilot review overview
1 open finding
🧠 Review effort: Lite
|
GNU testsuite comparison: |
There was a problem hiding this comment.
Warning
Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.
Copilot review overview
2 open findings
1 resolved since last review
🧠 Review effort: Lite
There was a problem hiding this comment.
Warning
Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.
Copilot review overview
1 open finding
2 resolved since last review
🧠 Review effort: Lite
69dfb27 to
b8974c2
Compare
There was a problem hiding this comment.
Warning
Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.
Copilot review overview
1 open finding
🧠 Review effort: Lite
b8974c2 to
4cab8ba
Compare
There was a problem hiding this comment.
Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing. Review the Copilot code review billing settings.
4cab8ba to
c986ccb
Compare
There was a problem hiding this comment.
Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing. Review the Copilot code review billing settings.
`PclMul` and `Vmull` were named after the cksum CRC paths, not after the PCLMULQDQ and PMULL instructions that they detect. Rename them, and their `has_*` and `detect_*` functions, after the instructions. Signed-off-by: Zhiwei Liang <zhiwei.liang@zliang.me>
c986ccb to
c4cdefb
Compare
There was a problem hiding this comment.
Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing. Review the Copilot code review billing settings.
|
Thanks for your PR |


Summary
HardwareFeature::PclMulandHardwareFeature::Vmulltake their names from the two CRC paths thatcksum --debugreports aspclmulandvmull. But they detect CPU instructions:is_x86_feature_detected!("pclmulqdq")andis_aarch64_feature_detected!("pmull"). The distinction matters because a path needs more than its instruction. For example, thepclmulpath also needs AVX, so a check such ashas_pclmul() && has_avx()(in a follow up PR) reads as if pclmul needs more than pclmul.This PR renames the variants to
PclmulqdqandPmull, withhas_pclmulqdq(),has_pmull()and thedetect_*functions to match. Now the enum names the instruction andcksumnames the path. Behavior does not change:cksum --debugstill printspclmulandvmull, and theGLIBC_TUNABLESnames andwc --debuglabels stay the same but may be updated in the follow up PRs to align with GNU behaviors.No behavior change is intended in this PR.