Skip to content

Commit

Permalink
Fix compatibility on unsupported CPU architectures
Browse files Browse the repository at this point in the history
  • Loading branch information
liushuyu authored and Licenser committed Jan 20, 2024
1 parent 4e31862 commit f46dc2a
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 4 deletions.
15 changes: 12 additions & 3 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -482,7 +482,10 @@ impl<'de> Deserializer<'de> {
}
}
#[cfg(not(any(
feature = "runtime-detection",
all(
feature = "runtime-detection",
any(target_arch = "x86_64", target_arch = "x86")
),
feature = "portable",
target_feature = "avx2",
target_feature = "sse4.2",
Expand Down Expand Up @@ -594,7 +597,10 @@ impl<'de> Deserializer<'de> {
}
#[cfg_attr(not(feature = "no-inline"), inline)]
#[cfg(not(any(
feature = "runtime-detection",
all(
feature = "runtime-detection",
any(target_arch = "x86_64", target_arch = "x86")
),
feature = "portable",
target_feature = "avx2",
target_feature = "sse4.2",
Expand Down Expand Up @@ -730,7 +736,10 @@ impl<'de> Deserializer<'de> {
}

#[cfg(not(any(
feature = "runtime-detection",
all(
feature = "runtime-detection",
any(target_arch = "x86_64", target_arch = "x86")
),
feature = "portable",
target_feature = "avx2",
target_feature = "sse4.2",
Expand Down
2 changes: 1 addition & 1 deletion src/numberparse.rs
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ fn parse_eight_digits_unrolled(chars: &[u8]) -> u32 {

#[cfg_attr(not(feature = "no-inline"), inline)]
#[cfg(all(
any(target_feature = "neon", target_feature = "simd128"),
not(any(target_arch = "x86", target_arch = "x86_64")),
feature = "swar-number-parsing"
))]
#[allow(clippy::cast_ptr_alignment)]
Expand Down
1 change: 1 addition & 0 deletions src/stringparse.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ const LOW_SURROGATES: Range<u32> = 0xdc00..0xe000;
/// handle a unicode codepoint
/// write appropriate values into dest
#[cfg_attr(not(feature = "no-inline"), inline)]
#[allow(dead_code)]
pub(crate) fn handle_unicode_codepoint(
src_ptr: &[u8],
dst_ptr: &mut [u8],
Expand Down

0 comments on commit f46dc2a

Please sign in to comment.