Skip to content

Commit 1954f9b

Browse files
Licensersunnygleason
authored andcommitted
ARM NEON support (#32)
* Put something in the readme so we can have a PR * Add drone file * update build status * unguard for sse4.2 to allow rust to polyfill on older platforms * Add more simd tests * RFC: Neon support (pretty much working) (#35) * feat: neon support * feat: temp stub replacements for neon intrinsics (pending rust-lang/stdarch#792) * fix: drone CI rustup nightly * feat: fix guards, use rust stdlib for bit count operations * fix: remove double semicolon * feat: fancy generic generator functions, thanks @Licenser * Update extq intrinsics * Use simd-lite (#39) * Use simd-lite * Update badge * Update badge * Get rid of transmutes * Use NeonInit trait * vqsubq_u8 fix * vqsubq_u8 fix pt. 2 * use reexprted values from simd-lite * add simd-lite real version
1 parent 84eee6d commit 1954f9b

26 files changed

+1399
-102
lines changed

.drone.yml

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
kind: pipeline
2+
name: test-on-avx2
3+
4+
platform:
5+
arch: amd64
6+
7+
steps:
8+
- name: test
9+
image: rust:1
10+
environment:
11+
RUSTFLAGS: '-C target-cpu=native'
12+
commands:
13+
- cargo build --verbose --all
14+
- cargo test --verbose --all
15+
---
16+
17+
kind: pipeline
18+
name: test-on-sse42
19+
20+
platform:
21+
arch: amd64
22+
23+
steps:
24+
- name: test
25+
image: rust:1
26+
environment:
27+
RUSTFLAGS: '-C target-cpu=native -C target-feature=-avx2'
28+
commands:
29+
- cargo build --verbose --all
30+
- cargo test --verbose --all
31+
32+
---
33+
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+
51+
kind: pipeline
52+
name: test-on-arm64
53+
54+
platform:
55+
arch: arm64
56+
57+
steps:
58+
- name: test
59+
image: rust:1
60+
commands:
61+
- rustup default nightly
62+
- rustup update
63+
- cargo clean && cargo +nightly build --verbose --all --features neon
64+
- cargo +nightly test --verbose --all --features neon

Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ jemallocator = { version = "0.3", optional = true }
2424
perfcnt = { version = "0.4", optional = true }
2525
getopts = { version = "0.2", optional = true }
2626
colored = { version = "1.7", optional = true }
27+
simd-lite = { version = "0.1.0", optional = true }
2728

2829

2930

@@ -45,6 +46,8 @@ harness = false
4546

4647
[features]
4748
default = ["swar-number-parsing", "serde_impl"]
49+
# Support for ARM NEON SIMD
50+
neon = ["simd-lite"]
4851
# use 8 number at once parsing strategy
4952
swar-number-parsing = []
5053
# serde compatibility

README.md

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
# SIMD Json for Rust   [![Build Status]][circleci.com] [![Windows Build Status]][appveyor.com] [![Latest Version]][crates.io]
1+
# SIMD Json for Rust   [![Build Status]][drone.io] [![Windows Build Status]][appveyor.com] [![Latest Version]][crates.io]
22

3-
[Build Status]: https://circleci.com/gh/Licenser/simdjson-rs/tree/master.svg?style=svg
4-
[circleci.com]: https://circleci.com/gh/Licenser/simdjson-rs/tree/master
5-
[Windows Build Status]: https://ci.appveyor.com/api/projects/status/0kf0v6hj5v2gite9?svg=true
3+
4+
[Build Status]: https://cloud.drone.io/api/badges/simd-lite/simdjson-rs/status.svg
5+
[drone.io]: https://cloud.drone.io/simd-lite/simdjson-rs
6+
[Windows Build Status]: https://ci.appveyor.com/api/projects/status/ffi2ese7dxse6pb8?svg=true
67
[appveyor.com]: https://ci.appveyor.com/project/Licenser/simdjson-rs
78
[Latest Version]: https://img.shields.io/crates/v/simd-json.svg
89
[crates.io]: https://crates.io/crates/simd-json
@@ -17,6 +18,8 @@
1718

1819
To be able to take advantage of simdjson your system needs to be SIMD compatible. This means to compile with native cpu support and the given features. Look at [The cargo config in this repository](.cargo/config) to get an example.
1920

21+
simd-json.rs supports AVX2, SSE4.2 and NEON.
22+
2023
### jemalloc
2124

2225
If you are writing performance centric code, make sure to use jemalloc and not the system allocator (which has now become default in rust), it gives a very noticeable boost in performance.

data/fail/fail70.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
["string contains bad UTF-8 €"]

data/fail/fail71.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
["contains bad UTF-8 �"]

data/fail/fail72.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
["contains bad UTF-8 �"]

data/fail/fail73.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
["bad UTF-8 �"]

data/fail/fail74.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
["UTF-8 �"]

data/fail/fail75.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
[""]

data/fail/fail76.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
[""]

0 commit comments

Comments
 (0)