Skip to content

Commit

Permalink
unguard for sse4.2 to allow rust to polyfill on older platforms
Browse files Browse the repository at this point in the history
  • Loading branch information
Licenser committed Jul 30, 2019
1 parent ddbcbd6 commit 4b3234b
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 5 deletions.
18 changes: 17 additions & 1 deletion .drone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ steps:
commands:
- cargo build --verbose --all
- cargo test --verbose --all

---

kind: pipeline
Expand All @@ -32,6 +31,23 @@ steps:

---

kind: pipeline
name: test-on-pre-sse42

platform:
arch: amd64

steps:
- name: test
image: rust:1
environment:
RUSTFLAGS: '-C target-cpu=native -C target-feature=-avx2,-sse4.2'
commands:
- cargo build --verbose --all
- cargo test --verbose --all

---

kind: pipeline
name: test-on-arm64

Expand Down
6 changes: 3 additions & 3 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -90,11 +90,11 @@ pub use crate::avx2::deser::*;
#[cfg(target_feature = "avx2")]
use crate::avx2::stage1::SIMDJSON_PADDING;

#[cfg(all(target_feature = "sse4.2", not(target_feature = "avx2")))]
#[cfg(not(target_feature = "avx2"))]
mod sse42;
#[cfg(all(target_feature = "sse4.2", not(target_feature = "avx2")))]
#[cfg(not(target_feature = "avx2"))]
pub use crate::sse42::deser::*;
#[cfg(all(target_feature = "sse4.2", not(target_feature = "avx2")))]
#[cfg(not(target_feature = "avx2"))]
use crate::sse42::stage1::SIMDJSON_PADDING;

mod stage2;
Expand Down
2 changes: 1 addition & 1 deletion src/stage2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#[cfg(target_feature = "avx2")]
use crate::avx2::stage1::SIMDJSON_PADDING;
use crate::charutils::*;
#[cfg(all(target_feature = "sse4.2", not(target_feature = "avx2")))]
#[cfg(not(target_feature = "avx2"))]
use crate::sse42::stage1::SIMDJSON_PADDING;
use crate::{Deserializer, Error, ErrorType, Result};

Expand Down

0 comments on commit 4b3234b

Please sign in to comment.