public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/60846] New: Add 128-bit integer types for general use on 32-bit/64-bit CPUs
@ 2014-04-15 14:06 jirik.svoboda at seznam dot cz
2014-04-15 14:11 ` [Bug c/60846] " rguenth at gcc dot gnu.org
` (9 more replies)
0 siblings, 10 replies; 11+ messages in thread
From: jirik.svoboda at seznam dot cz @ 2014-04-15 14:06 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60846
Bug ID: 60846
Summary: Add 128-bit integer types for general use on
32-bit/64-bit CPUs
Product: gcc
Version: unknown
Status: UNCONFIRMED
Severity: enhancement
Priority: P3
Component: c
Assignee: unassigned at gcc dot gnu.org
Reporter: jirik.svoboda at seznam dot cz
(u)int64_t is available on all targets (32-bit and 64-bit) but __int128 isn't
(according to http://gcc.gnu.org/onlinedocs/gcc/_005f_005fint128.html __int128
is only available if long long is 128-bits wide which doesn't seem to be the
case for 32-bit/64-bit Intel targets).
Please add something like (u)int128_t, i.e. 128-bit signed and unsigned integer
types available on 32-bit and 64-bit compiler targets. This would allow, for
example, representing an IPv6 address as a single scalar value. Address masking
could be performed with a simple bitwise operator.
Since 32-bit and 64-bit CPUs typically cannot operate on 128-bit integers
directly, multiple instructions need to be generated for a single arithmetic
operation.
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug c/60846] Add 128-bit integer types for general use on 32-bit/64-bit CPUs
2014-04-15 14:06 [Bug c/60846] New: Add 128-bit integer types for general use on 32-bit/64-bit CPUs jirik.svoboda at seznam dot cz
@ 2014-04-15 14:11 ` rguenth at gcc dot gnu.org
2014-04-17 3:56 ` hp at gcc dot gnu.org
` (8 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: rguenth at gcc dot gnu.org @ 2014-04-15 14:11 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60846
Richard Biener <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Resolution|--- |WORKSFORME
--- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> ---
It's already available. The sentence you quote just says you can't write a
literal 128bit constant in source.
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug c/60846] Add 128-bit integer types for general use on 32-bit/64-bit CPUs
2014-04-15 14:06 [Bug c/60846] New: Add 128-bit integer types for general use on 32-bit/64-bit CPUs jirik.svoboda at seznam dot cz
2014-04-15 14:11 ` [Bug c/60846] " rguenth at gcc dot gnu.org
@ 2014-04-17 3:56 ` hp at gcc dot gnu.org
2014-04-17 3:58 ` hp at gcc dot gnu.org
` (7 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: hp at gcc dot gnu.org @ 2014-04-17 3:56 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60846
Hans-Peter Nilsson <hp at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |hp at gcc dot gnu.org
--- Comment #2 from Hans-Peter Nilsson <hp at gcc dot gnu.org> ---
Reporter: do you mean just x86_64 / x86 targets or all 32- and 64-bit targets?
(The implied reply from the description is yes; I only ask since you mentioned
"32-bit/64-bit Intel" and people commonly think that's the whole world, ...)
Point: the reporter is correct in the general case (confirmed for cris-elf) and
if that was the actual request, the WORKSFORME would be incorrect.
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug c/60846] Add 128-bit integer types for general use on 32-bit/64-bit CPUs
2014-04-15 14:06 [Bug c/60846] New: Add 128-bit integer types for general use on 32-bit/64-bit CPUs jirik.svoboda at seznam dot cz
2014-04-15 14:11 ` [Bug c/60846] " rguenth at gcc dot gnu.org
2014-04-17 3:56 ` hp at gcc dot gnu.org
@ 2014-04-17 3:58 ` hp at gcc dot gnu.org
2014-04-22 13:32 ` jirik.svoboda at seznam dot cz
` (6 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: hp at gcc dot gnu.org @ 2014-04-17 3:58 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60846
--- Comment #3 from Hans-Peter Nilsson <hp at gcc dot gnu.org> ---
(In reply to Hans-Peter Nilsson from comment #2)
> (The implied reply from the description is yes
Sorry, I meant "the implied reply from the description is 'all targets'"...
Bah.
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug c/60846] Add 128-bit integer types for general use on 32-bit/64-bit CPUs
2014-04-15 14:06 [Bug c/60846] New: Add 128-bit integer types for general use on 32-bit/64-bit CPUs jirik.svoboda at seznam dot cz
` (2 preceding siblings ...)
2014-04-17 3:58 ` hp at gcc dot gnu.org
@ 2014-04-22 13:32 ` jirik.svoboda at seznam dot cz
2014-04-23 18:59 ` hp at gcc dot gnu.org
` (5 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: jirik.svoboda at seznam dot cz @ 2014-04-22 13:32 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60846
Jiri Svoboda <jirik.svoboda at seznam dot cz> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|RESOLVED |UNCONFIRMED
Resolution|WORKSFORME |---
--- Comment #4 from Jiri Svoboda <jirik.svoboda at seznam dot cz> ---
As an example:
jirka@omelette:/tmp> echo "__int128 i;" > test.c
jirka@omelette:/tmp> gcc -o test -m64 test.c
/usr/lib64/gcc/x86_64-suse-linux/4.8/../../../../lib64/crt1.o: In function
`_start':
/home/abuild/rpmbuild/BUILD/glibc-2.18/csu/../sysdeps/x86_64/start.S:118:
undefined reference to `main'
collect2: error: ld returned 1 exit status
jirka@omelette:/tmp> gcc -c -m64 test.c
jirka@omelette:/tmp> echo "__int128 i;" > test.c
jirka@omelette:/tmp> gcc -c -m64 test.c
jirka@omelette:/tmp> gcc -c -m32 test.c
test.c:1:1: error: ‘__int128’ is not supported for this target
__int128 i;
^
jirka@omelette:/tmp> gcc --version
gcc (SUSE Linux) 4.8.1 20130909 [gcc-4_8-branch revision 202388]
Copyright (C) 2013 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
jirka@omelette:/tmp> gcc -dumpmachine
x86_64-suse-linux
jirka@omelette:/tmp>
So it works for x86_64 64-bit target, but not for 32-bit target.
And I mean I would like to have this functionality in all 32-bit and 64-bit
targets, not just in some. Since I'm developping a cross-platform network stack
which runs on Intel (32-bit, 64-bit), PowerPC (32-bit), Itanium (64-bit), ARM
(32-bit), MIPS (32-bit), etc.
>From gcc-bugs-return-449571-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Tue Apr 22 13:32:15 2014
Return-Path: <gcc-bugs-return-449571-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 6010 invoked by alias); 22 Apr 2014 13:32:15 -0000
Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm
Precedence: bulk
List-Id: <gcc-bugs.gcc.gnu.org>
List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/>
List-Post: <mailto:gcc-bugs@gcc.gnu.org>
List-Help: <mailto:gcc-bugs-help@gcc.gnu.org>
Sender: gcc-bugs-owner@gcc.gnu.org
Delivered-To: mailing list gcc-bugs@gcc.gnu.org
Received: (qmail 5956 invoked by uid 55); 22 Apr 2014 13:32:12 -0000
From: "rguenth at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug tree-optimization/60849] [4.7/4.8 Regression] bogus comparison result type
Date: Tue, 22 Apr 2014 13:32:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: tree-optimization
X-Bugzilla-Version: 4.9.0
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: rguenth at gcc dot gnu.org
X-Bugzilla-Status: ASSIGNED
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: rguenth at gcc dot gnu.org
X-Bugzilla-Target-Milestone: 4.7.4
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields:
Message-ID: <bug-60849-4-xDJsdRW6xZ@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-60849-4@http.gcc.gnu.org/bugzilla/>
References: <bug-60849-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 7bit
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2014-04/txt/msg01591.txt.bz2
Content-length: 787
http://gcc.gnu.org/bugzilla/show_bug.cgi?id`849
--- Comment #10 from Richard Biener <rguenth at gcc dot gnu.org> ---
Author: rguenth
Date: Tue Apr 22 13:31:41 2014
New Revision: 209632
URL: http://gcc.gnu.org/viewcvs?rev 9632&root=gcc&view=rev
Log:
2014-04-22 Richard Biener <rguenther@suse.de>
Backport from mainline
2014-04-17 Richard Biener <rguenther@suse.de>
PR middle-end/60849
* tree-ssa-propagate.c (valid_gimple_rhs_p): Only allow effective
boolean results for comparisons.
* g++.dg/opt/pr60849.C: New testcase.
Added:
branches/gcc-4_9-branch/gcc/testsuite/g++.dg/opt/pr60849.C
Modified:
branches/gcc-4_9-branch/gcc/ChangeLog
branches/gcc-4_9-branch/gcc/testsuite/ChangeLog
branches/gcc-4_9-branch/gcc/tree-ssa-propagate.c
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug c/60846] Add 128-bit integer types for general use on 32-bit/64-bit CPUs
2014-04-15 14:06 [Bug c/60846] New: Add 128-bit integer types for general use on 32-bit/64-bit CPUs jirik.svoboda at seznam dot cz
` (3 preceding siblings ...)
2014-04-22 13:32 ` jirik.svoboda at seznam dot cz
@ 2014-04-23 18:59 ` hp at gcc dot gnu.org
2020-03-26 1:13 ` mirh at protonmail dot ch
` (4 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: hp at gcc dot gnu.org @ 2014-04-23 18:59 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60846
Hans-Peter Nilsson <hp at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Last reconfirmed| |2014-04-23
Ever confirmed|0 |1
--- Comment #5 from Hans-Peter Nilsson <hp at gcc dot gnu.org> ---
Confirmed then, for e.g. cris-elf at r209710.
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug c/60846] Add 128-bit integer types for general use on 32-bit/64-bit CPUs
2014-04-15 14:06 [Bug c/60846] New: Add 128-bit integer types for general use on 32-bit/64-bit CPUs jirik.svoboda at seznam dot cz
` (4 preceding siblings ...)
2014-04-23 18:59 ` hp at gcc dot gnu.org
@ 2020-03-26 1:13 ` mirh at protonmail dot ch
2020-03-27 21:10 ` feliks314159 at yahoo dot com
` (3 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: mirh at protonmail dot ch @ 2020-03-26 1:13 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60846
mirh at protonmail dot ch changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |mirh at protonmail dot ch
--- Comment #6 from mirh at protonmail dot ch ---
Any update?
Of course performance is going to take a hit, but if you are working with
128bit data it's not like you have much other choices (other than painstakingly
working this around yourself).
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug c/60846] Add 128-bit integer types for general use on 32-bit/64-bit CPUs
2014-04-15 14:06 [Bug c/60846] New: Add 128-bit integer types for general use on 32-bit/64-bit CPUs jirik.svoboda at seznam dot cz
` (5 preceding siblings ...)
2020-03-26 1:13 ` mirh at protonmail dot ch
@ 2020-03-27 21:10 ` feliks314159 at yahoo dot com
2020-03-27 22:09 ` pinskia at gcc dot gnu.org
` (2 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: feliks314159 at yahoo dot com @ 2020-03-27 21:10 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60846
Bill Gray <feliks314159 at yahoo dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |feliks314159 at yahoo dot com
--- Comment #7 from Bill Gray <feliks314159 at yahoo dot com> ---
I'd really like to see 128-bit ints made available on 32-bit targets. I
realize it wouldn't be fast for multiplying/dividing, but almost all of my use
cases (and most uses in general, I'd bet, except for crypto) involve bitwise
operations.
For that matter, I'd expect crypto folks would welcome 256- and higher-count
integers (get a SHA256 hash in a single scalar value). But perhaps not; they
already have workarounds for such issues.
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug c/60846] Add 128-bit integer types for general use on 32-bit/64-bit CPUs
2014-04-15 14:06 [Bug c/60846] New: Add 128-bit integer types for general use on 32-bit/64-bit CPUs jirik.svoboda at seznam dot cz
` (6 preceding siblings ...)
2020-03-27 21:10 ` feliks314159 at yahoo dot com
@ 2020-03-27 22:09 ` pinskia at gcc dot gnu.org
2020-03-27 22:16 ` joseph at codesourcery dot com
2023-11-04 14:59 ` jakub at gcc dot gnu.org
9 siblings, 0 replies; 11+ messages in thread
From: pinskia at gcc dot gnu.org @ 2020-03-27 22:09 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60846
--- Comment #8 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Note with __builtin_*_overflow, implementing 128bit integer (or larger) as a
class for C++ should be easier now.
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug c/60846] Add 128-bit integer types for general use on 32-bit/64-bit CPUs
2014-04-15 14:06 [Bug c/60846] New: Add 128-bit integer types for general use on 32-bit/64-bit CPUs jirik.svoboda at seznam dot cz
` (7 preceding siblings ...)
2020-03-27 22:09 ` pinskia at gcc dot gnu.org
@ 2020-03-27 22:16 ` joseph at codesourcery dot com
2023-11-04 14:59 ` jakub at gcc dot gnu.org
9 siblings, 0 replies; 11+ messages in thread
From: joseph at codesourcery dot com @ 2020-03-27 22:16 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60846
--- Comment #9 from joseph at codesourcery dot com <joseph at codesourcery dot com> ---
Note that supporting on any given 32-bit architecture requires making a
choice of what the function-calling ABI should be for such types (and
corresponding complex types) as function arguments and return values;
architecture maintainers would need to make such a choice, in consultation
with any group there may be that maintains the ABI for that architecture.
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug c/60846] Add 128-bit integer types for general use on 32-bit/64-bit CPUs
2014-04-15 14:06 [Bug c/60846] New: Add 128-bit integer types for general use on 32-bit/64-bit CPUs jirik.svoboda at seznam dot cz
` (8 preceding siblings ...)
2020-03-27 22:16 ` joseph at codesourcery dot com
@ 2023-11-04 14:59 ` jakub at gcc dot gnu.org
9 siblings, 0 replies; 11+ messages in thread
From: jakub at gcc dot gnu.org @ 2023-11-04 14:59 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60846
Jakub Jelinek <jakub at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |jakub at gcc dot gnu.org
--- Comment #10 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
If a particular 32-bit arch agrees on ABI issues, one could use _BitInt(128) or
unsigned _BitInt(128) for it in GCC 14+, though currently only x86-64 64-bit
enables it.
^ permalink raw reply [flat|nested] 11+ messages in thread
end of thread, other threads:[~2023-11-04 14:59 UTC | newest]
Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-04-15 14:06 [Bug c/60846] New: Add 128-bit integer types for general use on 32-bit/64-bit CPUs jirik.svoboda at seznam dot cz
2014-04-15 14:11 ` [Bug c/60846] " rguenth at gcc dot gnu.org
2014-04-17 3:56 ` hp at gcc dot gnu.org
2014-04-17 3:58 ` hp at gcc dot gnu.org
2014-04-22 13:32 ` jirik.svoboda at seznam dot cz
2014-04-23 18:59 ` hp at gcc dot gnu.org
2020-03-26 1:13 ` mirh at protonmail dot ch
2020-03-27 21:10 ` feliks314159 at yahoo dot com
2020-03-27 22:09 ` pinskia at gcc dot gnu.org
2020-03-27 22:16 ` joseph at codesourcery dot com
2023-11-04 14:59 ` jakub at gcc dot gnu.org
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).