https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93673
Bug ID: 93673
Summary: Fake error given by gcc when compiling for _kshift
intrinsics
Product: gcc
Version: 10.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: target
Assignee: unassigned at gcc dot gnu.org
Reporter: crazylht at gmail dot com
Target Milestone: ---
Target: i386, x86-64
cat test.c
----
#include<immintrin.h>
#include<assert.h>
__mmask16 i__kshiftli_mask16_KSHIFTLW(__mmask16 arg_0, unsigned int arg_1){
__mmask16 result;
switch (arg_1) {
case 0xFF: // arg_1
result = _kshiftli_mask16(arg_0, 0xff);
break;
default: // arg_1
assert(false);
break;
}
return result;
}
---
gcc10_trunk test.c -S -O0 -mavx512f
error:
#1 with x86-64 gcc (trunk)
In file included from
/opt/compiler-explorer/gcc-trunk-20200211/lib/gcc/x86_64-linux-gnu/10.0.1/include/immintrin.h:55,
from <source>:1:
<source>: In function '__mmask16 i__kshiftli_mask16_KSHIFTLW(__mmask16,
unsigned int)':
<source>:7:13: error: the last argument must be an 8-bit immediate
7 | result = _kshiftli_mask16(arg_0, 0xff);
| ^~~~~~~~~~~~~~~~
Compiler returned: 1
But oxFF is already an 8-bit immediate.
Refer to https://godbolt.org/z/xirwxN