From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 47B5D3986001; Mon, 21 Sep 2020 14:44:06 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 47B5D3986001 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1600699446; bh=ci2vX8f34I+MtL/9ipDRt2XBpibo0/60tlpBdFLsraI=; h=From:To:Subject:Date:From; b=uahaWqHqmkkES2ueXi/l2AjSlQ0BTIgfcxiAIAiJfZrrsJHVioC1zL+af+LGum9+K HfKKmHRzoNKQ/1xz0YNXvMAGIEfc0fOFb60qDYAzpK+Ta8snMdqojRygyfkWWivR9W O4hX/BlorttkVyU4YdTS6vBcW7DRzDT5WCjzOhKY= From: "david.spickett at linaro dot org" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/97150] New: [AArch64] 2nd parameter of unsigned Neon scalar shift intrinsics should be signed Date: Mon, 21 Sep 2020 14:44:06 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: target X-Bugzilla-Version: unknown X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: david.spickett at linaro dot org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Sep 2020 14:44:06 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D97150 Bug ID: 97150 Summary: [AArch64] 2nd parameter of unsigned Neon scalar shift intrinsics should be signed Product: gcc Version: unknown Status: UNCONFIRMED Severity: normal Priority: P3 Component: target Assignee: unassigned at gcc dot gnu.org Reporter: david.spickett at linaro dot org Target Milestone: --- The attached test file assigns the following intrinsics to function pointer= s to check the argument and return types: vqshlb_u8 vqshlh_u16 vqshls_u32 vqshld_u64 vqrshlb_u8 vqrshlh_u16 vqrshls_u32 vqrshld_u64 vshld_u64 (for quick reference) https://developer.arm.com/architectures/instruction-sets/simd-isas/neon/int= rinsics?search=3Dvqshlb_u8 https://developer.arm.com/architectures/instruction-sets/simd-isas/neon/int= rinsics?search=3Dvqshlh_u16 https://developer.arm.com/architectures/instruction-sets/simd-isas/neon/int= rinsics?search=3Dvqshls_u32 https://developer.arm.com/architectures/instruction-sets/simd-isas/neon/int= rinsics?search=3Dvqshld_u64 https://developer.arm.com/architectures/instruction-sets/simd-isas/neon/int= rinsics?search=3Dvqrshlb_u8 https://developer.arm.com/architectures/instruction-sets/simd-isas/neon/int= rinsics?search=3Dvqrshlh_u16 https://developer.arm.com/architectures/instruction-sets/simd-isas/neon/int= rinsics?search=3Dvqrshls_u32 https://developer.arm.com/architectures/instruction-sets/simd-isas/neon/int= rinsics?search=3Dvqrshld_u64 https://developer.arm.com/architectures/instruction-sets/simd-isas/neon/int= rinsics?search=3Dvshld_u64 https://developer.arm.com/architectures/instruction-sets/simd-isas/neon/int= rinsics?search=3Dvrshld_u64 The types in the function pointer declaration are taken from the ACLE, so I= 'd expect this to compile without issue. Except that the second parameter for these intrinsics is not signed as it should be. gcc version: 11.0.0 System: Ubuntu 16.04.7 LTS on x86_64 gcc options: Configured with: /tmp/dgboter/bbs/rhev-vm4--rhe6x86_64/buildbot/rhe6x86_64--aarch64-none-elf= /build/src/gcc/configure --target=3Daarch64-none-elf --prefix=3D/tmp/dgboter/bbs/rhev-vm4--rhe6x86_64/buildbot/rhe6x86_64--aarch= 64-none-elf/build/build-aarch64-none-elf/install// --with-gmp=3D/tmp/dgboter/bbs/rhev-vm4--rhe6x86_64/buildbot/rhe6x86_64--aar= ch64-none-elf/build/build-aarch64-none-elf/host-tools --with-mpfr=3D/tmp/dgboter/bbs/rhev-vm4--rhe6x86_64/buildbot/rhe6x86_64--aa= rch64-none-elf/build/build-aarch64-none-elf/host-tools --with-mpc=3D/tmp/dgboter/bbs/rhev-vm4--rhe6x86_64/buildbot/rhe6x86_64--aar= ch64-none-elf/build/build-aarch64-none-elf/host-tools --with-isl=3D/tmp/dgboter/bbs/rhev-vm4--rhe6x86_64/buildbot/rhe6x86_64--aar= ch64-none-elf/build/build-aarch64-none-elf/host-tools --disable-shared --disable-nls --disable-threads --disable-tls --enable-checking=3Dyes --enable-languages=3Dc,c++,fortran --with-newlib --with-pkgversion=3Dfsf-trunk.2226 Command line to reproduce and output: $ ./aarch64-none-elf-gcc -march=3Darmv8-a+simd -c -o /dev/null /tmp/test.c = -Wall -Wextra /tmp/test.c:3:38: warning: initialization of 'uint8_t (*)(uint8_t, int8_t)' {aka 'unsigned char (*)(unsigned char, signed char)'} from incompatible pointer type 'uint8_t (*)(uint8_t, uint8_t)' {aka 'unsigned char (*)(unsig= ned char, unsigned char)'} [-Wincompatible-pointer-types] 3 | uint8_t (*fp0)(uint8_t, int8_t) =3D vqshlb_u8; | ^~~~~~~~~ /tmp/test.c:4:38: warning: initialization of 'uint16_t (*)(uint16_t, int16= _t)' {aka 'short unsigned int (*)(short unsigned int, short int)'} from incompatible pointer type 'uint16_t (*)(uint16_t, uint16_t)' {aka 'short unsigned int (*)(short unsigned int, short unsigned int)'} [-Wincompatible-pointer-types] 4 | uint16_t (*fp1)(uint16_t, int16_t) =3D vqshlh_u16; | ^~~~~~~~~~ /tmp/test.c:5:38: warning: initialization of 'uint32_t (*)(uint32_t, int32= _t)' {aka 'unsigned int (*)(unsigned int, int)'} from incompatible pointer type 'uint32_t (*)(uint32_t, uint32_t)' {aka 'unsigned int (*)(unsigned int,=20 unsigned int)'} [-Wincompatible-pointer-types] 5 | uint32_t (*fp2)(uint32_t, int32_t) =3D vqshls_u32; | ^~~~~~~~~~ /tmp/test.c:6:38: warning: initialization of 'uint64_t (*)(uint64_t, int64= _t)' {aka 'long unsigned int (*)(long unsigned int, long int)'} from incompatib= le pointer type 'uint64_t (*)(uint64_t, uint64_t)' {aka 'long unsigned int (*)(long unsigned int, long unsigned int)'} [-Wincompatible-pointer-types] 6 | uint64_t (*fp3)(uint64_t, int64_t) =3D vqshld_u64; | ^~~~~~~~~~ /tmp/test.c:7:38: warning: initialization of 'uint8_t (*)(uint8_t, int8_t)' {aka 'unsigned char (*)(unsigned char, signed char)'} from incompatible pointer type 'uint8_t (*)(uint8_t, uint8_t)' {aka 'unsigned char (*)(unsig= ned char, unsigned char)'} [-Wincompatible-pointer-types] 7 | uint8_t (*fp4)(uint8_t, int8_t) =3D vqrshlb_u8; | ^~~~~~~~~~ /tmp/test.c:8:38: warning: initialization of 'uint16_t (*)(uint16_t, int16= _t)' {aka 'short unsigned int (*)(short unsigned int, short int)'} from incompatible pointer type 'uint16_t (*)(uint16_t, uint16_t)' {aka 'short unsigned int (*)(short unsigned int, short unsigned int)'} [-Wincompatible-pointer-types] 8 | uint16_t (*fp5)(uint16_t, int16_t) =3D vqrshlh_u16; | ^~~~~~~~~~~ /tmp/test.c:9:38: warning: initialization of 'uint32_t (*)(uint32_t, int32= _t)' {aka 'unsigned int (*)(unsigned int, int)'} from incompatible pointer type 'uint32_t (*)(uint32_t, uint32_t)' {aka 'unsigned int (*)(unsigned int,=20 unsigned int)'} [-Wincompatible-pointer-types] 9 | uint32_t (*fp6)(uint32_t, int32_t) =3D vqrshls_u32; | ^~~~~~~~~~~ /tmp/test.c:10:38: warning: initialization of 'uint64_t (*)(uint64_t,=20 int64_t)' {aka 'long unsigned int (*)(long unsigned int, long int)'} from incompatible pointer type 'uint64_t (*)(uint64_t, uint64_t)' {aka 'long unsigned int (*)(long unsigned int, long unsigned int)'} [-Wincompatible-pointer-types] 10 | uint64_t (*fp7)(uint64_t, int64_t) =3D vqrshld_u64; | ^~~~~~~~~~~ /tmp/test.c:11:38: warning: initialization of 'uint64_t (*)(uint64_t,=20 int64_t)' {aka 'long unsigned int (*)(long unsigned int, long int)'} from incompatible pointer type 'uint64_t (*)(uint64_t, uint64_t)' {aka 'long unsigned int (*)(long unsigned int, long unsigned int)'} [-Wincompatible-pointer-types] 11 | uint64_t (*fp8)(uint64_t, int64_t) =3D vshld_u64; | ^~~~~~~~~ For what it's worth this also fails to compile with "gcc version 5.4.0 2016= 0609 (Ubuntu/Linaro 5.4.0-6ubuntu1~16.04.9)". (so it isn't a new change)=