From: Bonita.Montero@gmail.com   
      
   You can compile the code with -mavx512bw.   
   This is "inline.h":   
      
   #if !defined(INLINE_HEADER)   
    Â Â #define INLINE_HEADER   
      
    Â Â #if !defined(NOINLINE)   
    Â Â Â Â #if defined(__GNUC__) || defined(__clang__)   
    Â Â Â Â Â Â #define NOINLINE __attribute__((noinline))   
    Â Â Â Â #elif defined(_MSC_VER)   
    Â Â Â Â Â Â #define NOINLINE __declspec(noinline)   
    Â Â Â Â #elif   
    Â Â Â Â Â Â #define NOINLINE   
    Â Â Â Â #endif   
    Â Â #endif   
      
    Â Â #if defined(__GNUC__)   
    Â Â Â Â #pragma GCC diagnostic ignored "-Wattributes"   
    Â Â #endif   
      
    Â Â #if !defined(FORCEINLINE)   
    Â Â Â Â #if (defined(__GNUC__) || defined(__clang__))   
    Â Â Â Â Â Â #define FORCEINLINE __attribute__((always_inline)) inline   
    Â Â Â Â #elif defined(_MSC_VER)   
    Â Â Â Â Â Â #define FORCEINLINE __forceinline   
    Â Â Â Â #elif   
    Â Â Â Â Â Â #define FORCEINLINE inline   
    Â Â Â Â #endif   
    Â Â #endif   
      
    Â Â #if !defined(L_FORCEINLINE)   
    Â Â Â Â #if defined(__GNUC__) || defined(__clang__)   
    Â Â Â Â Â Â #define L_FORCEINLINE __attribute__((always_inline))   
    Â Â Â Â #elif defined(_MSC_VER)   
    Â Â Â Â Â Â #define L_FORCEINLINE [[msvc::forceinline]]   
    Â Â Â Â #elif   
    Â Â Â Â Â Â #define L_FORCEINLINE   
    Â Â Â Â #endif   
    Â Â #endif   
   #endif   
      
   Am 22.11.2025 um 17:35 schrieb bart:   
   > On 22/11/2025 15:05, Bonita Montero wrote:   
   >> Take this and -mavx512bw and -std=c++23.   
   >>   
   >> #include    
   >> #include    
   >> #include    
   >> #include    
   >> #include    
   >> #include    
   >> #include    
   >> #include    
   >> #if defined(_MSC_VER)   
   >> Â Â Â #include    
   >> #elif defined(__GNUC__) || defined(__clang__)   
   >> Â Â Â #include    
   >> #endif   
   >> #include "inline.h"   
   >   
   > I don't have 'inline.h'. If I comment that out, then I get the errors   
   > below from 'g++ -std=c++23 prog.c', also with -Wno-inline.   
   >   
   > Your code seems incredibly fragile.   
   >   
   > c.cpp: In function 'size_t utf8Width512(const char*)':   
   > c.cpp:72:37: warning: AVX512F vector return without AVX512F enabled   
   > changes the ABI [-Wpsabi]   
   > Â Â 72 |Â Â Â Â Â Â Â Â ZERO = _mm512_setzero_si512(),   
   > Â Â Â Â Â |Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â    
    Â Â Â Â Â Â Â Â Â Â ^   
   > c.cpp: In function 'size_t utf8Width256(const char*)':   
   > c.cpp:123:37: warning: AVX vector return without AVX enabled changes   
   > the ABI [-Wpsabi]   
   > Â 123 |Â Â Â Â Â Â Â Â ZERO = _mm256_setzero_si256(),   
   > Â Â Â Â Â |Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â    
    Â Â Â Â Â Â Â Â Â Â ^   
   > In file included from   
   > C:/tdm/lib/gcc/x86_64-w64-mingw32/14.1.0/include/x86gprintrin.h:73,   
   > Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â from   
   > C:/tdm/lib/gcc/x86_64-w64-mingw32/14.1.0/include/x86intrin.h:27,   
   > Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â from c.cpp:13:   
   > C:/tdm/lib/gcc/x86_64-w64-mingw32/14.1.0/include/popcntintrin.h: In   
   > lambda function:   
   > C:/tdm/lib/gcc/x86_64-w64-mingw32/14.1.0/include/popcntintrin.h:42:1:   
   > error: inlining failed in call to 'always_inline' 'long long int   
   > _mm_popcnt_u64(long long unsigned int)': target specific option mismatch   
   > Â Â 42 | _mm_popcnt_u64 (unsigned long long __X)   
   > Â Â Â Â Â | ^~~~~~~~~~~~~~   
   > c.cpp:95:106: note: called from here   
   > Â Â 95 |Â Â Â Â Â Â Â Â count += _mm_popcnt_u64( one ) + _mm_popcnt_u64(   
   two )   
   > + _mm_popcnt_u64( three ) + _mm_popcnt_u64( four );   
   > Â Â Â Â Â | Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â    
   ~~~~~~~~~~~~~~^~~~~~~~   
   > C:/tdm/lib/gcc/x86_64-w64-mingw32/14.1.0/include/popcntintrin.h:42:1:   
   > error: inlining failed in call to 'always_inline' 'long long int   
   > _mm_popcnt_u64(long long unsigned int)': target specific option mismatch   
   > Â Â 42 | _mm_popcnt_u64 (unsigned long long __X)   
   > Â Â Â Â Â | ^~~~~~~~~~~~~~   
   > c.cpp:95:80: note: called from here   
   > Â Â 95 |Â Â Â Â Â Â Â Â count += _mm_popcnt_u64( one ) + _mm_popcnt_u64(   
   two )   
   > + _mm_popcnt_u64( three ) + _mm_popcnt_u64( four );   
   > Â Â Â Â Â | Â ~~~~~~~~~~~~~~^~~~~~~~~   
   > C:/tdm/lib/gcc/x86_64-w64-mingw32/14.1.0/include/popcntintrin.h:42:1:   
   > error: inlining failed in call to 'always_inline' 'long long int   
   > _mm_popcnt_u64(long long unsigned int)': target specific option mismatch   
   > Â Â 42 | _mm_popcnt_u64 (unsigned long long __X)   
   > Â Â Â Â Â | ^~~~~~~~~~~~~~   
   > c.cpp:95:56: note: called from here   
   > Â Â 95 |Â Â Â Â Â Â Â Â count += _mm_popcnt_u64( one ) + _mm_popcnt_u64(   
   two )   
   > + _mm_popcnt_u64( three ) + _mm_popcnt_u64( four );   
   > Â Â Â Â Â | ~~~~~~~~~~~~~~^~~~~~~   
   > C:/tdm/lib/gcc/x86_64-w64-mingw32/14.1.0/include/popcntintrin.h:42:1:   
   > error: inlining failed in call to 'always_inline' 'long long int   
   > _mm_popcnt_u64(long long unsigned int)': target specific option mismatch   
   > Â Â 42 | _mm_popcnt_u64 (unsigned long long __X)   
   > Â Â Â Â Â | ^~~~~~~~~~~~~~   
   > c.cpp:95:32: note: called from here   
   > Â Â 95 |Â Â Â Â Â Â Â Â count += _mm_popcnt_u64( one ) + _mm_popcnt_u64(   
   two )   
   > + _mm_popcnt_u64( three ) + _mm_popcnt_u64( four );   
   > Â Â Â Â Â |Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â ~~~~~~~~~~~~~~^~~~~~~   
   > In file included from   
   > C:/tdm/lib/gcc/x86_64-w64-mingw32/14.1.0/include/immintrin.h:65,   
   > Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â from   
   > C:/tdm/lib/gcc/x86_64-w64-mingw32/14.1.0/include/x86intrin.h:32:   
   > C:/tdm/lib/gcc/x86_64-w64-mingw32/14.1.0/include/avx512bwintrin.h:1716:1:   
   > error: inlining failed in call to 'always_inline' '__mmask64   
   > _mm512_cmpeq_epi8_mask(__m512i, __m512i)': target specific option   
   > mismatch   
   > Â 1716 | _mm512_cmpeq_epi8_mask (__m512i __A, __m512i __B)   
   > Â Â Â Â Â | ^~~~~~~~~~~~~~~~~~~~~~   
   > c.cpp:94:42: note: called from here   
   > Â Â 94 |Â Â Â Â Â Â Â Â Â Â Â Â four = _mm512_cmpeq_epi8_mask(   
   _mm512_and_si512(   
   > chunk, FOUR_MASK ), FOUR_HEAD ) & nzMask;   
   > Â Â Â Â Â |   
   > ~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~   
   > In file included from   
   > C:/tdm/lib/gcc/x86_64-w64-mingw32/14.1.0/include/immintrin.h:55:   
   > C:/tdm/lib/gcc/x86_64-w64-mingw32/14.1.0/include/avx512fintrin.h:10651:1:   
   > error: inlining failed in call to 'always_inline' '__m512i   
   > _mm512_and_si512(__m512i, __m512i)': target specific option mismatch   
   > 10651 | _mm512_and_si512 (__m512i __A, __m512i __B)   
   > Â Â Â Â Â | ^~~~~~~~~~~~~~~~   
   > c.cpp:94:42: note: called from here   
   > Â Â 94 |Â Â Â Â Â Â Â Â Â Â Â Â four = _mm512_cmpeq_epi8_mask(   
   _mm512_and_si512(   
   > chunk, FOUR_MASK ), FOUR_HEAD ) & nzMask;   
   > Â Â Â Â Â |   
   > ~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~   
   > C:/tdm/lib/gcc/x86_64-w64-mingw32/14.1.0/include/avx512bwintrin.h:1716:1:   
   > error: inlining failed in call to 'always_inline' '__mmask64   
      
   [continued in next message]   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   
|