home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   comp.lang.c      Meh, in C you gotta define EVERYTHING      243,242 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 242,043 of 243,242   
   Bonita Montero to All   
   Re: Unicode... (1/2)   
   22 Nov 25 18:13:07   
   
   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)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca