Re: Using __int128 on 64-bit architectures

From: Stephen Rothwell
Date: Sun Apr 21 2013 - 05:35:50 EST


On Sun, 21 Apr 2013 05:29:28 +0100 (BST) "Maciej W. Rozycki" <macro@xxxxxxxxxxxxxx> 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@xxxxxxxxxxxxxxxx

Attachment: pgp00000.pgp
Description: PGP signature