Skip to content

Commit

Permalink
structural tweak
Browse files Browse the repository at this point in the history
  • Loading branch information
chengsun committed Jun 16, 2022
1 parent 68fbf24 commit a4e8ac2
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions src/structural.rs
Original file line number Diff line number Diff line change
Expand Up @@ -154,13 +154,10 @@ mod x86 {
#[inline]
unsafe fn classify_one_avx2(&self, input: __m256i) -> ClassifyOneAvx2
{
let lparen = _mm256_cmpeq_epi8(input, _mm256_set1_epi8(b'(' as i8));
let rparen = _mm256_cmpeq_epi8(input, _mm256_set1_epi8(b')' as i8));
let parens = _mm256_cmpgt_epi8(_mm256_set1_epi8(2), _mm256_sub_epi8(input, _mm256_set1_epi8(b'(' as i8)));
let quote = _mm256_cmpeq_epi8(input, _mm256_set1_epi8(b'"' as i8));
let backslash = _mm256_cmpeq_epi8(input, _mm256_set1_epi8(b'\\' as i8));

let parens = _mm256_or_si256(lparen, rparen);

let mut atom_like = input.clone();
self.atom_terminator_classifier.classify_avx2(std::slice::from_mut(&mut atom_like));
let atom_like = _mm256_cmpeq_epi8(atom_like, _mm256_set1_epi8(0));
Expand Down Expand Up @@ -331,13 +328,10 @@ mod aarch64 {
unsafe fn classify_one_neon(&self, input: uint8x16_t) -> ClassifyOneNeon {
use vector_classifier::Classifier;

let lparen = vceqq_u8(input, vdupq_n_u8(b'('));
let rparen = vceqq_u8(input, vdupq_n_u8(b')'));
let parens = vcltq_u8(vsubq_u8(input, vdupq_n_u8(b'(')), vdupq_n_u8(2));
let quote = vceqq_u8(input, vdupq_n_u8(b'"'));
let backslash = vceqq_u8(input, vdupq_n_u8(b'\\'));

let parens = vorrq_u8(lparen, rparen);

let mut atom_like = input.clone();
self.atom_terminator_classifier.classify_neon(std::slice::from_mut(&mut atom_like));
let atom_like = vceqq_u8(atom_like, vdupq_n_u8(0));
Expand Down

0 comments on commit a4e8ac2

Please sign in to comment.