public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "malat at debian dot org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c/109173] New: incorrect intrinsic signature for _mm_srai_epi64
Date: Fri, 17 Mar 2023 11:47:14 +0000	[thread overview]
Message-ID: <bug-109173-4@http.gcc.gnu.org/bugzilla/> (raw)

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109173

            Bug ID: 109173
           Summary: incorrect intrinsic signature for _mm_srai_epi64
           Product: gcc
           Version: 13.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: malat at debian dot org
  Target Milestone: ---

gcc-13 currently rejects the following:

% /usr/lib/gcc-snapshot/bin/gcc -c -Wsign-conversion -Werror -mavx512vl -O2
tu.c
tu.c: In function 'foo':
tu.c:7:30: error: conversion to 'int' from 'unsigned int' may change the sign
of the result [-Werror=sign-conversion]
    7 |     return _mm_srai_epi64(a, bar());
      |                              ^~~~~
cc1: all warnings being treated as errors

with:

% cat tu.c
#include <immintrin.h>

extern unsigned int bar();

__m128i foo(__m128i a)
{
    return _mm_srai_epi64(a, bar());
}

intel documentation declares it as unsigned int

*
https://www.intel.com/content/www/us/en/docs/cpp-compiler/developer-guide-reference/2021-8/intrinsics-for-shift-operations.html

[...]
__m128i _mm_srai_epi64(__m128i a, unsigned int imm)
[...]

% /usr/lib/gcc-snapshot/bin/gcc --version
gcc (Debian 20230315-1) 13.0.1 20230315 (experimental) [master
r13-6680-ga9ae16db8cb]

             reply	other threads:[~2023-03-17 11:47 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-17 11:47 malat at debian dot org [this message]
2023-03-17 11:51 ` [Bug c/109173] " jakub at gcc dot gnu.org
2023-03-17 12:03 ` jakub at gcc dot gnu.org
2023-03-17 12:04 ` malat at debian dot org
2023-03-17 12:12 ` jakub at gcc dot gnu.org
2023-03-17 14:32 ` [Bug target/109173] " jan.wassenberg at gmail dot com
2023-03-20  5:23 ` crazylht at gmail dot com
2023-05-25  8:08 ` cvs-commit at gcc dot gnu.org
2023-05-25  8:51 ` crazylht at gmail dot com
2023-05-25 18:36 ` pinskia at gcc dot gnu.org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-109173-4@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).