public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "glisse at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug target/29776] result of ffs/clz/ctz/popcount/parity are already sign-extended
Date: Thu, 04 Jul 2013 18:44:00 -0000	[thread overview]
Message-ID: <bug-29776-4-wri8SRC9HW@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-29776-4@http.gcc.gnu.org/bugzilla/>

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29776

--- Comment #11 from Marc Glisse <glisse at gcc dot gnu.org> ---
(In reply to dean from comment #10)
> this is unfortunate really -- the newer LZCNT/TZCNT instructions on x86 
> explicitly return 8*sizeof(type) for input of zero

Same as the power cntlz* instructions. And in both cases we implement
intrinsics as a call to __builtin_clz*. So it would make sense to assume this
behavior in the optimizations (if it is undefined behavior, picking this
behavior won't break more things than assuming it never happens).


  parent reply	other threads:[~2013-07-04 18:44 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <bug-29776-4@http.gcc.gnu.org/bugzilla/>
2011-12-24  8:01 ` pinskia at gcc dot gnu.org
2012-07-29  8:16 ` pinskia at gcc dot gnu.org
2012-07-29 13:24 ` steven at gcc dot gnu.org
2012-07-30 11:37 ` ubizjak at gmail dot com
2012-07-30 12:49 ` ubizjak at gmail dot com
2013-07-03 22:40 ` sgunderson at bigfoot dot com
2013-07-04 10:39 ` jakub at gcc dot gnu.org
2013-07-04 18:44 ` glisse at gcc dot gnu.org [this message]
2013-07-04 19:08 ` jakub at gcc dot gnu.org
2013-07-05  6:52 ` jakub at gcc dot gnu.org
2013-07-05  7:38 ` jakub at gcc dot gnu.org
2013-07-05  8:02 ` jakub at gcc dot gnu.org
2013-07-05  8:28 ` jakub at gcc dot gnu.org
2013-07-06  9:54 ` jakub at gcc dot gnu.org
2021-08-08 22:48 ` pinskia at gcc dot gnu.org
2023-03-21 11:54 ` adam.warner.nz at gmail dot com

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-29776-4-wri8SRC9HW@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).