| 1473 | #ifdef EE_ARCH_X86_64 |
| 1474 | #if defined( __GNUC__ ) || defined( __clang__ ) |
| 1475 | __attribute__( ( target( "avx2" ) ) ) |
| 1476 | #endif |
| 1477 | static bool isAsciiAVX2( const char32_t* data, size_t len, uint32_t limit ) { |
| 1478 | const char32_t* end = data + len; |
| 1479 | const __m256i maskVec = _mm256_set1_epi32( ~limit ); |
| 1480 | |
| 1481 | while ( data + 8 <= end ) { |
| 1482 | __m256i chunk = _mm256_loadu_si256( (const __m256i*)data ); |
| 1483 | if ( _mm256_testz_si256( chunk, maskVec ) == 0 ) |
| 1484 | return false; |
| 1485 | data += 8; |
| 1486 | } |
| 1487 | |
| 1488 | while ( data < end ) { |
| 1489 | if ( *data > limit ) |
| 1490 | return false; |
| 1491 | data++; |
| 1492 | } |
| 1493 | return true; |
| 1494 | } |
| 1495 | #endif |
| 1496 | |
| 1497 | #ifdef EE_ARCH_ARM64 |