public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: kenner@vlsi1.ultra.nyu.edu (Richard Kenner)
To: richard.guenther@gmail.com
Cc: ebotcazou@adacore.com, gcc-patches@gcc.gnu.org, rguenther@suse.de
Subject: Re: [PATCH] Remove bogus TYPE_IS_SIZETYPE special-casing in extract_muldiv_1
Date: Sat, 03 Sep 2011 21:27:00 -0000	[thread overview]
Message-ID: <11109032127.AA29336@vlsi1.ultra.nyu.edu> (raw)
In-Reply-To: <CAFiYyc3c0fT2KvM2JjaJFuvZV3nzGnKQU7rFV6v9f9D2c8_ufQ@mail.gmail.com>

> So what's your opinion on the "bug" that triggered the patch in question?\
> Namely extract_muldiv_1 folding
> 
> (((10240 - (sizetype) first) + 1) * 8) /[cl] 8
> 
> to
> 
> ((sizetype) first * 0x0fffffffffffffff8 + 81928) /[cl] 8
> 
> to
> 
> ((sizetype) first * 2305843009213693951 + 10241)

I think this optimization "works" if you sign-extend the constant when 
you do division by 8.

  parent reply	other threads:[~2011-09-03 21:27 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-31  9:14 Richard Guenther
2011-09-02  8:37 ` Eric Botcazou
2011-09-02  9:05   ` Richard Guenther
2011-09-02 13:26     ` Eric Botcazou
2011-09-02 13:33       ` Richard Guenther
2011-09-03  9:23         ` Eric Botcazou
2011-09-03 11:57           ` Richard Guenther
2011-09-03 15:08             ` Eric Botcazou
2011-09-03 19:09               ` Richard Guenther
2011-09-03 19:47                 ` Richard Kenner
2011-09-03 20:37                   ` Richard Guenther
2011-09-03 20:39                     ` Richard Guenther
2011-09-03 21:20                       ` Richard Kenner
2011-09-03 21:20                     ` Richard Kenner
2011-09-03 21:27                     ` Richard Kenner [this message]
2011-09-05  7:33           ` Richard Guenther

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=11109032127.AA29336@vlsi1.ultra.nyu.edu \
    --to=kenner@vlsi1.ultra.nyu.edu \
    --cc=ebotcazou@adacore.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=rguenther@suse.de \
    --cc=richard.guenther@gmail.com \
    /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).