Remove bit_or (bad perf on Windows)
This commit is contained in:
parent
62e8332b34
commit
f0ec26992a
|
@ -462,16 +462,6 @@ simdjson_really_inline int8x16_t make_int8x16_t(int8_t x1, int8_t x2, int8_t x
|
||||||
return vgetq_lane_u64(vreinterpretq_u64_u8(sum0), 0);
|
return vgetq_lane_u64(vreinterpretq_u64_u8(sum0), 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
simdjson_really_inline simd8x64<T> bit_or(const T m) const {
|
|
||||||
const simd8<T> mask = simd8<T>::splat(m);
|
|
||||||
return simd8x64<T>(
|
|
||||||
this->chunks[0] | mask,
|
|
||||||
this->chunks[1] | mask,
|
|
||||||
this->chunks[2] | mask,
|
|
||||||
this->chunks[3] | mask
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
simdjson_really_inline uint64_t eq(const T m) const {
|
simdjson_really_inline uint64_t eq(const T m) const {
|
||||||
const simd8<T> mask = simd8<T>::splat(m);
|
const simd8<T> mask = simd8<T>::splat(m);
|
||||||
return simd8x64<bool>(
|
return simd8x64<bool>(
|
||||||
|
|
|
@ -70,7 +70,11 @@ simdjson_really_inline json_character_block json_character_block::classify(const
|
||||||
_mm256_shuffle_epi8(whitespace_table, in.chunks[0]),
|
_mm256_shuffle_epi8(whitespace_table, in.chunks[0]),
|
||||||
_mm256_shuffle_epi8(whitespace_table, in.chunks[1])
|
_mm256_shuffle_epi8(whitespace_table, in.chunks[1])
|
||||||
});
|
});
|
||||||
const simd8x64<uint8_t> curlified = in.bit_or(0x20); // Turn [ and ] into { and }
|
// Turn [ and ] into { and }
|
||||||
|
const simd8x64<uint8_t> curlified{
|
||||||
|
in.chunks[0] | 0x20,
|
||||||
|
in.chunks[1] | 0x20
|
||||||
|
};
|
||||||
const uint64_t op = curlified.eq({
|
const uint64_t op = curlified.eq({
|
||||||
_mm256_shuffle_epi8(op_table, in.chunks[0]),
|
_mm256_shuffle_epi8(op_table, in.chunks[0]),
|
||||||
_mm256_shuffle_epi8(op_table, in.chunks[1])
|
_mm256_shuffle_epi8(op_table, in.chunks[1])
|
||||||
|
|
|
@ -337,7 +337,7 @@ namespace simd {
|
||||||
).to_bitmask();
|
).to_bitmask();
|
||||||
}
|
}
|
||||||
|
|
||||||
simdjson_really_inline uint64_t eq(const simd8x64<uint8_t> other) const {
|
simdjson_really_inline uint64_t eq(const simd8x64<uint8_t> &other) const {
|
||||||
return simd8x64<bool>(
|
return simd8x64<bool>(
|
||||||
this->chunks[0] == other.chunks[0],
|
this->chunks[0] == other.chunks[0],
|
||||||
this->chunks[1] == other.chunks[1]
|
this->chunks[1] == other.chunks[1]
|
||||||
|
|
|
@ -65,7 +65,13 @@ simdjson_really_inline json_character_block json_character_block::classify(const
|
||||||
_mm_shuffle_epi8(whitespace_table, in.chunks[2]),
|
_mm_shuffle_epi8(whitespace_table, in.chunks[2]),
|
||||||
_mm_shuffle_epi8(whitespace_table, in.chunks[3])
|
_mm_shuffle_epi8(whitespace_table, in.chunks[3])
|
||||||
});
|
});
|
||||||
const simd8x64<uint8_t> curlified = in.bit_or(0x20); // Turn [ and ] into { and }
|
// Turn [ and ] into { and }
|
||||||
|
const simd8x64<uint8_t> curlified{
|
||||||
|
in.chunks[0] | 0x20,
|
||||||
|
in.chunks[1] | 0x20,
|
||||||
|
in.chunks[2] | 0x20,
|
||||||
|
in.chunks[3] | 0x20
|
||||||
|
};
|
||||||
const uint64_t op = curlified.eq({
|
const uint64_t op = curlified.eq({
|
||||||
_mm_shuffle_epi8(op_table, in.chunks[0]),
|
_mm_shuffle_epi8(op_table, in.chunks[0]),
|
||||||
_mm_shuffle_epi8(op_table, in.chunks[1]),
|
_mm_shuffle_epi8(op_table, in.chunks[1]),
|
||||||
|
|
|
@ -288,23 +288,13 @@ namespace simd {
|
||||||
}
|
}
|
||||||
|
|
||||||
simdjson_really_inline uint64_t to_bitmask() const {
|
simdjson_really_inline uint64_t to_bitmask() const {
|
||||||
uint64_t r0 = uint32_t(this->chunks[0].to_bitmask());
|
uint64_t r0 = uint32_t(this->chunks[0].to_bitmask() );
|
||||||
uint64_t r1 = this->chunks[1].to_bitmask();
|
uint64_t r1 = this->chunks[1].to_bitmask() ;
|
||||||
uint64_t r2 = this->chunks[2].to_bitmask();
|
uint64_t r2 = this->chunks[2].to_bitmask() ;
|
||||||
uint64_t r3 = this->chunks[3].to_bitmask();
|
uint64_t r3 = this->chunks[3].to_bitmask() ;
|
||||||
return r0 | (r1 << 16) | (r2 << 32) | (r3 << 48);
|
return r0 | (r1 << 16) | (r2 << 32) | (r3 << 48);
|
||||||
}
|
}
|
||||||
|
|
||||||
simdjson_really_inline simd8x64<T> bit_or(const T m) const {
|
|
||||||
const simd8<T> mask = simd8<T>::splat(m);
|
|
||||||
return simd8x64<T>(
|
|
||||||
this->chunks[0] | mask,
|
|
||||||
this->chunks[1] | mask,
|
|
||||||
this->chunks[2] | mask,
|
|
||||||
this->chunks[3] | mask
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
simdjson_really_inline uint64_t eq(const T m) const {
|
simdjson_really_inline uint64_t eq(const T m) const {
|
||||||
const simd8<T> mask = simd8<T>::splat(m);
|
const simd8<T> mask = simd8<T>::splat(m);
|
||||||
return simd8x64<bool>(
|
return simd8x64<bool>(
|
||||||
|
@ -315,7 +305,7 @@ namespace simd {
|
||||||
).to_bitmask();
|
).to_bitmask();
|
||||||
}
|
}
|
||||||
|
|
||||||
simdjson_really_inline uint64_t eq(const simd8x64<uint8_t> other) const {
|
simdjson_really_inline uint64_t eq(const simd8x64<uint8_t> &other) const {
|
||||||
return simd8x64<bool>(
|
return simd8x64<bool>(
|
||||||
this->chunks[0] == other.chunks[0],
|
this->chunks[0] == other.chunks[0],
|
||||||
this->chunks[1] == other.chunks[1],
|
this->chunks[1] == other.chunks[1],
|
||||||
|
|
Loading…
Reference in New Issue