Skip to content

Commit

Permalink
Merge branch 'master' into neon
Browse files Browse the repository at this point in the history
  • Loading branch information
Lynnesbian authored Sep 24, 2024
2 parents 7f3266e + b528490 commit f5d04bd
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 2 deletions.
7 changes: 6 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,22 @@ exclude = [
]

[dependencies]
defmt = { version = "0.3", optional = true }
serde = { version = "1.0", default-features = false, optional = true }

[features]
default = ["std", "serde"]
std = ["alloc", "serde?/std"]
alloc = []
alloc = ["defmt?/alloc"]
serde = ["dep:serde", "alloc"]
defmt-03 = ["dep:defmt"]

[target.'cfg(not(feature = "alloc"))'.dependencies]
heapless = { version = "0.8" }

[target.'cfg(not(feature = "alloc"))'.features]
defmt-03 = ["dep:defmt", "heapless/defmt-03"]

[dev-dependencies]
criterion = "0.5"
rustc-hex = "1.0"
Expand Down
1 change: 1 addition & 0 deletions src/decode.rs
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@ pub unsafe fn hex_check_sse(src: &[u8]) -> bool {
}

#[derive(Eq, PartialEq)]
#[cfg_attr(feature = "defmt-03", derive(defmt::Format))]
pub enum CheckCase {
None,
Lower,
Expand Down
1 change: 1 addition & 0 deletions src/error.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#[derive(Clone, Copy, PartialEq)]
#[cfg_attr(feature = "defmt-03", derive(defmt::Format))]
pub enum Error {
InvalidChar,
InvalidLength(usize),
Expand Down
3 changes: 2 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ pub use crate::decode::{hex_check_neon, hex_check_neon_with_case};

#[derive(Copy, Clone, PartialEq, Eq, Debug)]
#[allow(dead_code)]
#[cfg_attr(feature = "defmt-03", derive(defmt::Format))]
pub(crate) enum Vectorization {
None = 0,
SSE41 = 1,
Expand Down Expand Up @@ -120,7 +121,7 @@ fn vectorization_support_no_cache_x86() -> Vectorization {

let have_xsave = (proc_info_ecx >> 26) & 1 == 1;
let have_osxsave = (proc_info_ecx >> 27) & 1 == 1;
let have_avx = (proc_info_ecx >> 27) & 1 == 1;
let have_avx = (proc_info_ecx >> 28) & 1 == 1;
if have_xsave && have_osxsave && have_avx {
// # Safety: We checked that the processor supports xsave
if unsafe { avx2_support_no_cache_x86() } {
Expand Down

0 comments on commit f5d04bd

Please sign in to comment.