Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
| From | Keith Thompson <kst-u@mib.org> |
|---|---|
| Newsgroups | comp.lang.c |
| Subject | Re: Large number libraries/algorithms |
| Date | 2012-10-23 12:58 -0700 |
| Organization | None to speak of |
| Message-ID | <lnipa1dkoy.fsf@nuthaus.mib.org> (permalink) |
| References | (1 earlier) <4q6dnXHstpLfshjNnZ2dnUVZ8o-dnZ2d@lyse.net> <lnk3uifm5x.fsf@nuthaus.mib.org> <vm9b88hl9qirqv7i8pnq5j3un82bvmsnik@4ax.com> <0.4b9d32dea7f57a2ad3b4.20121023000110BST.87ipa29knd.fsf@bsb.me.uk> <wNmdnbKqcMPz1xvNnZ2dnUVZ7oSdnZ2d@lyse.net> |
David Brown <david@westcontrol.removethisbit.com> writes:
> On 23/10/2012 01:01, Ben Bacarisse wrote:
>> Robert Wessel <robertwessel2@yahoo.com> writes:
>>> On Mon, 22 Oct 2012 10:31:54 -0700, Keith Thompson <kst-u@mib.org>
>>> wrote:
[...]
>>>> I don't think I've ever seen a C compiler that supports 128-bit
>>>> integers. Can you provide an example?
>>>
>>> Doesn't Jacob Navia's? And GCC on 64 bit targets usually has at least
>>> partial support.
>>
>> It supports a type called int128, but it's not an integer type. For
>> example, you can't cast it to another integer type. It's implemented as
>> a struct using lcc-win32's operator overloading so it's a matter of
>> debate if a program using it is using a "C compiler". Jacob's operator
>> overloading is deliberately unobtrusive but I have not studied the
>> consequences of not using the compiler in a conforming mode.
>>
>> gcc provides __int128 "for targets having an integer mode wide enough to
>> hold 128-bit". I'm not sure exactly what's included in that.
>
> gcc certainly provides it for 64-bit amd64 targets - and I'm guessing
> also for other 64-bit targets (such as PPC, MIPS, IA-64). It is
> treated much like any other integer type as far as gcc is concerned.
> Generated code will use two registers and twice as many operations
> compared to 64-bit integers, but that's standard for C compilers
> working with integers wider than the registers.
>
> It would not surprise me unduly if gcc supported 128-bit integers on
> 32-bit targets as well (after all, it happily supports 64-bit integers
> on 8-bit targets), but I haven't checked.
gcc 4.7 does *not* support __int128 on 32-bit x86.
On a 64-bit system (I have "x86_64-w64-mingw32-gcc" version 4.5.3
under Cygwin), it does support __int128 -- but intmax_t is still
only 64 bits.
--
Keith Thompson (The_Other_Keith) kst-u@mib.org <http://www.ghoti.net/~kst>
Will write code for food.
"We must do something. This is something. Therefore, we must do this."
-- Antony Jay and Jonathan Lynn, "Yes Minister"
Back to comp.lang.c | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Large number libraries/algorithms boltar2003@boltar.world - 2012-10-22 09:11 +0000
Re: Large number libraries/algorithms Mark Bluemel <mark_bluemel@pobox.com> - 2012-10-22 10:15 +0100
Re: Large number libraries/algorithms Heikki Kallasjoki <fis+usenet@zem.fi> - 2012-10-22 09:19 +0000
Re: Large number libraries/algorithms boltar2003@boltar.world - 2012-10-22 09:40 +0000
Re: Large number libraries/algorithms Noob <root@127.0.0.1> - 2012-10-22 11:24 +0200
Re: Large number libraries/algorithms David Brown <david@westcontrol.removethisbit.com> - 2012-10-22 13:29 +0200
Re: Large number libraries/algorithms boltar2003@boltar.world - 2012-10-22 11:53 +0000
Re: Large number libraries/algorithms James Kuyper <jameskuyper@verizon.net> - 2012-10-22 08:01 -0400
Re: Large number libraries/algorithms David Brown <david@westcontrol.removethisbit.com> - 2012-10-22 14:41 +0200
Re: Large number libraries/algorithms James Kuyper <jameskuyper@verizon.net> - 2012-10-22 09:36 -0400
Re: Large number libraries/algorithms Ben Bacarisse <ben.usenet@bsb.me.uk> - 2012-10-22 15:12 +0100
Re: Large number libraries/algorithms Keith Thompson <kst-u@mib.org> - 2012-10-22 10:31 -0700
Re: Large number libraries/algorithms Robert Wessel <robertwessel2@yahoo.com> - 2012-10-22 15:09 -0500
Re: Large number libraries/algorithms Ben Bacarisse <ben.usenet@bsb.me.uk> - 2012-10-23 00:01 +0100
Re: Large number libraries/algorithms David Brown <david@westcontrol.removethisbit.com> - 2012-10-23 09:38 +0200
Re: Large number libraries/algorithms Steve Thompson <stevet810@gmail.com> - 2012-10-23 12:40 +0000
Re: Large number libraries/algorithms David Brown <david@westcontrol.removethisbit.com> - 2012-10-23 16:23 +0200
Re: Large number libraries/algorithms Steve Thompson <stevet810@gmail.com> - 2012-10-23 14:38 +0000
Re: Large number libraries/algorithms Keith Thompson <kst-u@mib.org> - 2012-10-23 12:58 -0700
Re: Large number libraries/algorithms David Brown <david@westcontrol.removethisbit.com> - 2012-10-24 09:01 +0200
Re: Large number libraries/algorithms James Kuyper <jameskuyper@verizon.net> - 2012-10-24 07:18 -0400
Re: Large number libraries/algorithms David Brown <david@westcontrol.removethisbit.com> - 2012-10-24 14:23 +0200
Re: Large number libraries/algorithms Ben Bacarisse <ben.usenet@bsb.me.uk> - 2012-10-24 14:43 +0100
Re: Large number libraries/algorithms Keith Thompson <kst-u@mib.org> - 2012-10-24 11:33 -0700
Re: Large number libraries/algorithms Ben Bacarisse <ben.usenet@bsb.me.uk> - 2012-10-24 19:53 +0100
Re: Large number libraries/algorithms James Kuyper <jameskuyper@verizon.net> - 2012-10-24 10:50 -0400
Re: Large number libraries/algorithms Noob <root@localhost> - 2012-10-24 15:16 +0200
Re: Large number libraries/algorithms Noob <root@localhost> - 2012-10-24 18:57 +0200
Re: Large number libraries/algorithms Keith Thompson <kst-u@mib.org> - 2012-10-24 11:43 -0700
Re: Large number libraries/algorithms David Brown <david@westcontrol.removethisbit.com> - 2012-10-25 09:05 +0200
Re: Large number libraries/algorithms Eric Sosman <esosman@comcast-dot-net.invalid> - 2012-10-22 08:23 -0400
Re: Large number libraries/algorithms tom st denis <tom@iahu.ca> - 2012-10-22 11:40 -0700
Re: Large number libraries/algorithms Keith Thompson <kst-u@mib.org> - 2012-10-22 17:05 -0700
Re: Large number libraries/algorithms tom st denis <tom@iahu.ca> - 2012-10-23 07:10 -0700
Re: Large number libraries/algorithms David Brown <david@westcontrol.removethisbit.com> - 2012-10-22 14:42 +0200
Re: Large number libraries/algorithms Chad <cdalten@gmail.com> - 2012-10-23 14:39 -0700
Re: Large number libraries/algorithms pete <pfiland@mindspring.com> - 2012-10-24 03:27 -0400
csiph-web