public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: Richard Henderson <rth@redhat.com>
To: Linus Torvalds <torvalds@transmeta.com>, gcc@gcc.gnu.org
Subject: Re: Optimizations on long long multiply/divide on PowerPC32 don't work
Date: Mon, 10 Dec 2001 01:24:00 -0000	[thread overview]
Message-ID: <20011210011413.A23383@redhat.com> (raw)
In-Reply-To: <20011210005444.A23367@redhat.com>; from rth@redhat.com on Mon, Dec 10, 2001 at 12:54:44AM -0800

On Mon, Dec 10, 2001 at 12:54:44AM -0800, Richard Henderson wrote:
> GCC knows how to do this.  It will do this if the target supports
> all of these operations on 64 bit data types and it considers them
> to be cheap enough.

How irritating.  I do not like the taste of crow.

While the above is true, powerpc apparently has a rather cheap 32-bit
divide instruction which throws off the heuristics in this case.


r~



Index: expmed.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/expmed.c,v
retrieving revision 1.97
diff -c -p -d -r1.97 expmed.c
*** expmed.c	2001/11/20 04:12:11	1.97
--- expmed.c	2001/12/10 09:07:20
*************** expand_divmod (rem_flag, code, mode, op0
*** 3271,3277 ****
  		      goto fail1;
  		  }
  		else if (EXACT_POWER_OF_2_OR_ZERO_P (d)
! 			 && (rem_flag ? smod_pow2_cheap : sdiv_pow2_cheap))
  		  ;
  		else if (EXACT_POWER_OF_2_OR_ZERO_P (abs_d))
  		  {
--- 3271,3286 ----
  		      goto fail1;
  		  }
  		else if (EXACT_POWER_OF_2_OR_ZERO_P (d)
! 			 && (rem_flag ? smod_pow2_cheap : sdiv_pow2_cheap)
! 			 /* ??? The cheap metric is computed only for
! 			    word_mode.  If this operation is wider, this may
! 			    not be so.  Assume true if the optab has an
! 			    expander for this mode.  */
! 			 && (((rem_flag ? smod_optab : sdiv_optab)
! 			      ->handlers[(int) compute_mode].insn_code
! 			      != CODE_FOR_nothing)
! 			     || (sdivmod_optab->handlers[(int) compute_mode]
! 				 .insn_code != CODE_FOR_nothing)))
  		  ;
  		else if (EXACT_POWER_OF_2_OR_ZERO_P (abs_d))
  		  {

  reply	other threads:[~2001-12-10  9:15 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-12-07 16:08 Corey Minyard
2001-12-07 17:08 ` Richard Henderson
2001-12-07 17:40   ` Corey Minyard
2001-12-09 23:29   ` Linus Torvalds
2001-12-10  1:15     ` Richard Henderson
2001-12-10  1:24       ` Richard Henderson [this message]
2001-12-10  2:40         ` Franz Sirl
2001-12-10  9:21           ` Linus Torvalds
2001-12-10 10:59             ` Franz Sirl
2001-12-10 11:11               ` Linus Torvalds
2001-12-10 11:31               ` Gabriel Paubert
2001-12-10 17:58                 ` Richard Henderson
2002-01-22  8:51         ` Franz Sirl
2002-01-22 12:04           ` Richard Henderson
2002-01-23  7:24             ` Gerald Pfeifer
2002-02-03 10:44               ` Franz Sirl
2001-12-10  9:15       ` Linus Torvalds
2001-12-10 13:03         ` Richard Henderson
2001-12-10 13:59           ` Linus Torvalds
2001-12-10  9:09     ` Paul Koning
2001-12-10 10:23       ` Linus Torvalds
2001-12-10 11:35         ` Optimizations on long long multiply/divide on PowerPC32 don't Joe Buck
2001-12-10 13:49           ` guerby
2001-12-10 14:08             ` Arnaud Charlet
2001-12-10 14:31               ` guerby
2001-12-10  9:09 ` Optimizations on long long multiply/divide on PowerPC32 don't work Christoph Hellwig
2001-12-07 18:28 mike stump

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=20011210011413.A23383@redhat.com \
    --to=rth@redhat.com \
    --cc=gcc@gcc.gnu.org \
    --cc=torvalds@transmeta.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).