-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
fix(wc):GNU wc-cpu.sh #9144
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
Open
mattsu2020
wants to merge
13
commits into
uutils:main
Choose a base branch
from
mattsu2020:wc_compatibility
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
fix(wc):GNU wc-cpu.sh #9144
Changes from 1 commit
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
4bbd987
feat(wc): add conditional SIMD support for counting with debug flag
mattsu2020 4752e2a
refactor(wc): reorder SIMD debug output conditions for better readabi…
mattsu2020 ead1881
chore: add jargon words to spellcheck dictionary
mattsu2020 6ea2596
Update src/uu/wc/src/cpu_features.rs
mattsu2020 cf4d860
Merge branch 'uutils:main' into wc_compatibility
mattsu2020 a7400a6
refactor(wc): use uucore's SIMD policy instead of local cpu_features
mattsu2020 78ec009
chore: alphabetize uucore imports in wc.rs
mattsu2020 b2f7ead
refactor(wc): sort dependencies in Cargo.toml alphabetically
mattsu2020 e5662a2
test(wc): add test for SIMD respect of GLIBC tunables
mattsu2020 dcf7174
fix: adjust content ownership in SIMD GLIBC tunable test
mattsu2020 d1935f3
chore(wc): reformat uucore features to multiline array
mattsu2020 d23fc8b
refactor(test_wc): optimize test input generation by avoiding per-lin…
mattsu2020 1a25344
feat(wc): internationalize hardware support debug messages
mattsu2020 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
refactor(wc): use uucore's SIMD policy instead of local cpu_features
- Add "hardware" feature to uucore dependency in Cargo.toml - Replace local cpu_features module with uucore::hardware::simd_policy - Update debug output to use enabled_features() method for consistency
- Loading branch information
commit a7400a66125de946db7415bd8a04dd63bc81db66
There are no files selected for viewing
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
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
This file was deleted.
Oops, something went wrong.
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -7,7 +7,6 @@ | |
|
|
||
| mod count_fast; | ||
| mod countable; | ||
| mod cpu_features; | ||
| mod utf8; | ||
| mod word_count; | ||
|
|
||
|
|
@@ -28,6 +27,7 @@ use utf8::{BufReadDecoder, BufReadDecoderError}; | |
| use uucore::translate; | ||
|
|
||
| use uucore::{ | ||
| hardware::simd_policy, | ||
| error::{FromIo, UError, UResult}, | ||
| format_usage, | ||
| parser::shortcut_value_parser::ShortcutValueParser, | ||
|
|
@@ -827,15 +827,15 @@ fn wc(inputs: &Inputs, settings: &Settings) -> UResult<()> { | |
| }; | ||
|
|
||
| if settings.debug { | ||
| let policy = cpu_features::simd_policy(); | ||
| if policy.env_allows_simd() { | ||
| let available = policy.available_features(); | ||
| if available.is_empty() { | ||
| let policy = simd_policy(); | ||
| if policy.allows_simd() { | ||
| let enabled = policy.enabled_features(); | ||
| if enabled.is_empty() { | ||
| eprintln!("wc: debug: hardware support unavailable on this CPU"); | ||
|
||
| } else { | ||
| eprintln!( | ||
| "wc: debug: using hardware support (features: {})", | ||
| available.join(", ") | ||
| enabled.join(", ") | ||
| ); | ||
| } | ||
| } else { | ||
|
|
||
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.