niedziela, 1 maja 2016

GCC: and inlining failed in call to always_inline 'FOO': target specific option mismatch

AVX512 comes with the number of variants, and a compiler must know which AVX512 version it compiles.

GCC error inlining failed in call to always_inline 'FOO': target specific option mismatch occurs when a program containing some SIMD-intrinsics, and compiler has wrong or missing target options. The target option are introduced by "-m".

Lets look at the error from real world:

/usr/lib/gcc/x86_64-linux-gnu/5/include/avx512vlbwintrin.h:790:1: error: inlining failed in call to always_inline ‘_mm_movm_epi8’: target specific option mismatch


Now, when open avx512vlbwintrin.h, we see at the beginning of file:

...
#pragma GCC push_options
#pragma GCC target("avx512vl,avx512bw")
#define __DISABLE_AVX512VLBW__
...

Thus, in order to properly compile the program, gcc have to be feed with the two options listed at the target line: -mavx512vl and -mavx512bw.

sobota, 13 lutego 2016

bash: $0 value

When a script is run from a command line then the 0th parameter is the script's name. However, when a script is run via source command, then the 0th parameter is a shell name. Weird, but true.


$ cat test.sh 
echo "\$0 is $0"

$ bash test.sh
$0 is test.sh

$ source ./test.sh
$0 is bash

niedziela, 17 stycznia 2016

Base64 encoding with SIMD instructions

Base64 decoding could also be vectorized, although the speedup is not very impressive, merely 35%. Read more ...

wtorek, 12 stycznia 2016

Base64 encoding with SIMD instructions

An SSE code is more than 2 times faster on Core i7, and around 70% faster on Core i5. Read more...

wtorek, 29 grudnia 2015

Fast conversion of floating-point values to string

The conversion to string could be 15 times faster than sprintf. Read more...

niedziela, 27 grudnia 2015

Base64 encoding — implementation study

Although base64 encoding is a very basic algorithm, it could be sped up a little (25% sounds good?) Read more...

sobota, 26 grudnia 2015

Benefits from the obsession

Everything has started few years ago when I found John Regher's blog. If you don't know the blog I highly recommend it. Among other things (I like the photos!) the author studies bugs in compilers, undefined behaviours and similar things. The word "overflow" appears quite often in his posts due to the great number of errors related to improper use of the integer arithmetic. Well, I don't know when the obsession has exactly started, but recently I realized that I am alert of all integer operations in my programs. Read more...