Skip to content

Commit

Permalink
Fix tzcnt intrinsic inlining
Browse files Browse the repository at this point in the history
  • Loading branch information
ijl committed Jun 7, 2024
1 parent 9f707ad commit 7f67ce0
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/serialize/writer/str.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ use core::simd::cmp::{SimdPartialEq, SimdPartialOrd};
#[cfg(all(feature = "unstable-simd", target_arch = "x86_64", feature = "avx512"))]
use core::arch::x86_64::{
__m256i, _mm256_cmpeq_epu8_mask, _mm256_cmplt_epu8_mask, _mm256_lddqu_si256,
_mm256_maskz_loadu_epi8, _mm256_set1_epi8, _mm256_storeu_epi8, _tzcnt_u32,
_mm256_maskz_loadu_epi8, _mm256_set1_epi8, _mm256_storeu_epi8
};

#[cfg(all(feature = "unstable-simd", target_arch = "x86_64", feature = "avx512"))]
Expand Down Expand Up @@ -45,7 +45,7 @@ macro_rules! impl_format_simd_avx512vl {
| _mm256_cmplt_epu8_mask(str_vec, x20);

if unlikely!(mask > 0) {
let cn = _tzcnt_u32(mask) as usize;
let cn = mask.trailing_zeros() as usize; // _tzcnt_u32() not inlining

$src = $src.add(cn);
let escape = QUOTE_TAB[*($src) as usize];
Expand Down Expand Up @@ -77,7 +77,7 @@ macro_rules! impl_format_simd_avx512vl {
mask &= remainder_mask;

if unlikely!(mask > 0) {
let cn = _tzcnt_u32(mask) as usize;
let cn = mask.trailing_zeros() as usize; // _tzcnt_u32() not inlining

$src = $src.add(cn);
let escape = QUOTE_TAB[*($src) as usize];
Expand Down

0 comments on commit 7f67ce0

Please sign in to comment.