mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Stephen Rothwell <sfr@canb.auug.org.au>
To: "Maciej W. Rozycki" <macro@linux-mips.org>
Cc: "H. Peter Anvin" <hpa@zytor.com>,
	Linux Arch Mailing List <linux-arch@vger.kernel.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: Using __int128 on 64-bit architectures
Date: Sun, 21 Apr 2013 19:35:31 +1000	[thread overview]
Message-ID: <20130421193531.43965f592f00dfd6e3cfcf45@canb.auug.org.au> (raw)
In-Reply-To: <alpine.LFD.2.03.1304210450490.17443@linux-mips.org>

[-- Attachment #1: Type: text/plain, Size: 1377 bytes --]

On Sun, 21 Apr 2013 05:29:28 +0100 (BST) "Maciej W. Rozycki" <macro@linux-mips.org> wrote:
>
>  Hmm, nobody has replied, so just FYI such widening multiplication is 
> available in all 64-bit MIPS hardware and GCC has supported it since 4.4 
> or mid 2008 (older versions used a libgcc __multi3 helper, not quite so 
> efficient as you can imagine).

$ powerpc64-linux-gcc --version
powerpc64-linux-gcc (GCC) 4.6.3
  ...
$ powerpc64-linux-gcc -O2 -c mulditi3.c
$ powerpc64-linux-objdump -d -r mulditi3.o
mulditi3.o:     file format elf64-powerpc

Disassembly of section .text:

0000000000000000 <.mulditi3>:
   0:	7c 08 02 a6 	mflr    r0
   4:	7c 86 23 78 	mr      r6,r4
   8:	7c c5 fe 76 	sradi   r5,r6,63
   c:	f8 01 00 10 	std     r0,16(r1)
  10:	7c 64 1b 78 	mr      r4,r3
  14:	f8 21 ff 91 	stdu    r1,-112(r1)
  18:	7c 63 fe 76 	sradi   r3,r3,63
  1c:	48 00 00 01 	bl      1c <.mulditi3+0x1c>
			1c: R_PPC64_REL24	__multi3
  20:	60 00 00 00 	nop
  24:	38 21 00 70 	addi    r1,r1,112
  28:	e8 01 00 10 	ld      r0,16(r1)
  2c:	7c 08 03 a6 	mtlr    r0
  30:	4e 80 00 20 	blr
  34:	00 00 00 00 	.long 0x0
  38:	00 00 00 01 	.long 0x1
  3c:	80 00 00 00 	lwz     r0,0(0)
$ 

i.e. for gcc 4.6.3, 64 bit powerpc calls out to __multi3

The same is true for sparc64.

-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au

[-- Attachment #2: Type: application/pgp-signature, Size: 836 bytes --]

  reply	other threads:[~2013-04-21  9:35 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-17 23:04 H. Peter Anvin
2013-04-21  4:29 ` Maciej W. Rozycki
2013-04-21  9:35   ` Stephen Rothwell [this message]
2013-04-21  9:51     ` Michael Cree

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=20130421193531.43965f592f00dfd6e3cfcf45@canb.auug.org.au \
    --to=sfr@canb.auug.org.au \
    --cc=hpa@zytor.com \
    --cc=linux-arch@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=macro@linux-mips.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

all inboxes | Powered by JetHome®