linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: David Edelsohn <dje@watson.ibm.com>
To: Holger Bettag <hobold@Informatik.Uni-Bremen.DE>
Cc: Geert Uytterhoeven <geert@linux-m68k.org>,
	Kaoru Fukui <k_fukui@highway.ne.jp>,
	Jean-Jacques.Levy@inria.fr,
	Benjamin Herrenschmidt <benh@kernel.crashing.org>,
	linuxppc-dev@lists.linuxppc.org
Subject: Re: __divdi3 unresolved + X pointer blocks
Date: Thu, 05 Jul 2001 11:29:01 -0400	[thread overview]
Message-ID: <200107051529.LAA29124@makai.watson.ibm.com> (raw)
In-Reply-To: Message from Holger Bettag <hobold@Informatik.Uni-Bremen.DE> of "05 Jul 2001 13:48:41 +0200." <8xr8vv61gm.fsf@s62.informatik.uni-bremen.de>


>>>>> Holger Bettag writes:

Holger> And: 'arithmetic shift right' is _not_ the same as signed divide, because the
Holger> rounding of negative operands or results may differ.

	Exactly!  For a 32-bit operand, a signed divide by an exact power
of two is equivalent to:

srawi
addze

	For synthesized 64-bit operand, this is more complicated, which is
why GCC calls __divdi3 instead of open-coding it.

	Will all of the people posting INCORRECT information about logical
versus arithmetic shift and converting signed divide into shift, please
stop.  You are propagating bad information.

	If one converts a divide into a shift, one is assuming more
information than one has informed the compiler.

	This whole discussion thread is confusing two issues.  If one
wants GCC to produce a shift, one needs to write the code so that GCC
safely can convert the divide into a shift.  If the shift is not safe,
then the Linux kernel needs to provide __divdi3.

	The two suggestions of writing the divide as a shift and linking
with libgcc.a BOTH ARE WRONG.

David

** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/

  reply	other threads:[~2001-07-05 15:29 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-07-02 20:31 __divdi3 unresolved + X pointer blocks Jean-Jacques Levy
2001-07-02 14:51 ` Kaoru Fukui
2001-07-05  1:06   ` Jean-Jacques Levy
2001-07-04 20:05     ` Benjamin Herrenschmidt
2001-07-05  5:50       ` Kernel crash with BenH' tree (was: Re: __divdi3...) Michel Lanners
2001-07-08 22:34       ` __divdi3 unresolved + X pointer blocks Jean-Jacques Levy
2001-07-04 22:22     ` David Edelsohn
2001-07-04 22:24       ` Kaoru Fukui
2001-07-04 22:45         ` Kaoru Fukui
2001-07-04 23:18           ` David Edelsohn
2001-07-05  8:13             ` Geert Uytterhoeven
2001-07-05  8:44               ` Kaoru Fukui
2001-07-05 11:48               ` Holger Bettag
2001-07-05 15:29                 ` David Edelsohn [this message]
2001-07-05 16:55                   ` Michael Schmitz
     [not found] <20010711010133.Postino-018213@smtp01.highway.ne.jp>
2001-07-10 16:41 ` Kaoru Fukui
  -- strict thread matches above, loose matches on Subject: below --
2001-07-02 14:55 Kaoru Fukui

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=200107051529.LAA29124@makai.watson.ibm.com \
    --to=dje@watson.ibm.com \
    --cc=Jean-Jacques.Levy@inria.fr \
    --cc=benh@kernel.crashing.org \
    --cc=geert@linux-m68k.org \
    --cc=hobold@Informatik.Uni-Bremen.DE \
    --cc=k_fukui@highway.ne.jp \
    --cc=linuxppc-dev@lists.linuxppc.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 NNTP newsgroup(s).