Skip to content

Commit 5113c8f

Browse files
committed
unguard for sse4.2 to allow rust to polyfill on older platforms
1 parent e2abd7a commit 5113c8f

File tree

3 files changed

+21
-5
lines changed

3 files changed

+21
-5
lines changed

.drone.yml

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ steps:
1212
commands:
1313
- cargo build --verbose --all
1414
- cargo test --verbose --all
15-
1615
---
1716

1817
kind: pipeline
@@ -32,6 +31,23 @@ steps:
3231

3332
---
3433

34+
kind: pipeline
35+
name: test-on-pre-sse42
36+
37+
platform:
38+
arch: amd64
39+
40+
steps:
41+
- name: test
42+
image: rust:1
43+
environment:
44+
RUSTFLAGS: '-C target-cpu=native -C target-feature=-avx2,-sse4.2'
45+
commands:
46+
- cargo build --verbose --all
47+
- cargo test --verbose --all
48+
49+
---
50+
3551
kind: pipeline
3652
name: test-on-arm64
3753

src/lib.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -89,11 +89,11 @@ pub use crate::avx2::deser::*;
8989
#[cfg(target_feature = "avx2")]
9090
use crate::avx2::stage1::SIMDJSON_PADDING;
9191

92-
#[cfg(all(target_feature = "sse4.2", not(target_feature = "avx2")))]
92+
#[cfg(not(target_feature = "avx2"))]
9393
mod sse42;
94-
#[cfg(all(target_feature = "sse4.2", not(target_feature = "avx2")))]
94+
#[cfg(not(target_feature = "avx2"))]
9595
pub use crate::sse42::deser::*;
96-
#[cfg(all(target_feature = "sse4.2", not(target_feature = "avx2")))]
96+
#[cfg(not(target_feature = "avx2"))]
9797
use crate::sse42::stage1::SIMDJSON_PADDING;
9898

9999
mod stage2;

src/stage2.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#[cfg(target_feature = "avx2")]
33
use crate::avx2::stage1::SIMDJSON_PADDING;
44
use crate::charutils::*;
5-
#[cfg(all(target_feature = "sse4.2", not(target_feature = "avx2")))]
5+
#[cfg(not(target_feature = "avx2"))]
66
use crate::sse42::stage1::SIMDJSON_PADDING;
77
use crate::{Deserializer, Error, ErrorType, Result};
88

0 commit comments

Comments
 (0)