Skip to content

Commit

Permalink
ci: temporarily disable wasm on nightly
Browse files Browse the repository at this point in the history
  • Loading branch information
DaniPopes committed Sep 29, 2024
1 parent fcd6751 commit 08c6394
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 15 deletions.
6 changes: 6 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,12 @@ jobs:
feature: simd128
rust: [nightly, stable, 1.64]
exclude:
# https://github.com/rust-lang/rust/issues/131031
- target:
triple: wasm32-wasip1
feature: simd128
rust: nightly
# In 1.64 it's still called wasm32-wasi
- target:
triple: wasm32-wasip1
feature: simd128
Expand Down
19 changes: 6 additions & 13 deletions src/arch/aarch64.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,24 +59,17 @@ pub(crate) fn check(input: &[u8]) -> bool {

#[target_feature(enable = "neon")]
pub(crate) unsafe fn check_neon(input: &[u8]) -> bool {
let ascii_zero = vdupq_n_u8(b'0' - 1);
let ascii_nine = vdupq_n_u8(b'9' + 1);
let ascii_ua = vdupq_n_u8(b'A' - 1);
let ascii_uf = vdupq_n_u8(b'F' + 1);
let ascii_la = vdupq_n_u8(b'a' - 1);
let ascii_lf = vdupq_n_u8(b'f' + 1);

generic::check_unaligned_chunks(input, |chunk: uint8x16_t| {
let ge0 = vcgtq_u8(chunk, ascii_zero);
let le9 = vcltq_u8(chunk, ascii_nine);
let ge0 = vcgeq_u8(chunk, vdupq_n_u8(b'0'));
let le9 = vcleq_u8(chunk, vdupq_n_u8(b'9'));
let valid_digit = vandq_u8(ge0, le9);

let geua = vcgtq_u8(chunk, ascii_ua);
let leuf = vcltq_u8(chunk, ascii_uf);
let geua = vcgeq_u8(chunk, vdupq_n_u8(b'A'));
let leuf = vcleq_u8(chunk, vdupq_n_u8(b'F'));
let valid_upper = vandq_u8(geua, leuf);

let gela = vcgtq_u8(chunk, ascii_la);
let lelf = vcltq_u8(chunk, ascii_lf);
let gela = vcgeq_u8(chunk, vdupq_n_u8(b'a'));
let lelf = vcleq_u8(chunk, vdupq_n_u8(b'f'));
let valid_lower = vandq_u8(gela, lelf);

let valid_letter = vorrq_u8(valid_lower, valid_upper);
Expand Down
4 changes: 2 additions & 2 deletions src/arch/wasm32.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,11 @@ pub(crate) fn check(input: &[u8]) -> bool {
if !has_simd128() {
return generic::check(input);
}
unsafe { check_simd128(input) }
check_simd128(input)
}

#[target_feature(enable = "simd128")]
unsafe fn check_simd128(input: &[u8]) -> bool {
fn check_simd128(input: &[u8]) -> bool {
generic::check_unaligned_chunks(input, |chunk: v128| {
let ge0 = u8x16_ge(chunk, u8x16_splat(b'0'));
let le9 = u8x16_le(chunk, u8x16_splat(b'9'));
Expand Down

0 comments on commit 08c6394

Please sign in to comment.