Referring to computer architecture with addresses and other data units 128 bits wide.
Questions tagged [128-bit]
85 questions
90
votes
9 answers
Are 64 bit programs bigger and faster than 32 bit versions?
I suppose I am focussing on x86, but I am generally interested in the move from 32 to 64 bit.
Logically, I can see that constants and pointers, in some cases, will be larger so programs are likely to be larger. And the desire to allocate memory on…

philcolbourn
- 4,042
- 3
- 28
- 33
76
votes
3 answers
Is there a 128 bit integer in gcc?
I want a 128 bit integer because I want to store results of multiplication of two 64 bit numbers. Is there any such thing in gcc 4.4 and above?

MetallicPriest
- 29,191
- 52
- 200
- 356
31
votes
4 answers
Assigning 128-bit integer in C
When I try to assign an 128-bit integer in gcc 4.9.1, I get a warning: integer constant is too large for its type.
Example Code
int main(void) {
__uint128_t p = 47942806932686753431;
return 0;
}
Output
I'm compiling with gcc -std=c11 -o test…

iblue
- 29,609
- 19
- 89
- 128
27
votes
7 answers
How can I add and subtract 128 bit integers in C or C++ if my compiler does not support them?
I'm writing a compressor for a long stream of 128 bit numbers. I would like to store the numbers as differences -- storing only the difference between the numbers rather than the numbers themselves because I can pack the differences in fewer bytes…

Billy ONeal
- 104,103
- 58
- 317
- 552
24
votes
2 answers
Does gcc support 128-bit int on amd64?
Does gcc support 128-bit int on amd64?
How to define it?
How to use scanf/printf to read/write it?

Yichao Zhou
- 465
- 1
- 4
- 8
23
votes
2 answers
Modulo operator slower than manual implementation?
I have found that manually calculating the % operator on __int128 is significantly faster than the built-in compiler operator. I will show you how to calculate modulo 9, but the method can be used to calculate modulo any other number.
First,…

DaBler
- 2,695
- 2
- 26
- 46
18
votes
2 answers
Cannot use 128bit float in Python on 64bit architecture
I checked the size of a pointer in my python terminal (in Enthought Canopy IDE)
via
import ctypes
print (ctypes.sizeof(ctypes.c_voidp) * 8)
I've a 64bit architecture and working with numpy.float64 is just fine. But I cannot use…

Matthias
- 4,481
- 12
- 45
- 84
17
votes
1 answer
How to use Gcc 4.6.0 libquadmath and __float128 on x86 and x86_64
I have medium size C99 program which uses long double type (80bit) for floating-point computation. I want to improve precision with new GCC 4.6 extension __float128. As I get, it is a software-emulated 128-bit precision math.
How should I convert my…

osgx
- 90,338
- 53
- 357
- 513
17
votes
4 answers
How to know if __uint128_t is defined
We can use the preprocessor to know if unsigned long long is defined:
#include
#ifndef ULLONG_MAX
typedef unsigned long t_mask;
#else
typedef unsigned long long t_mask;
#endif
But how to know if __uint128_t is defined?

David Ranieri
- 39,972
- 7
- 52
- 94
16
votes
2 answers
What gcc versions support the __int128 intrinsic type?
Under the gcc docs 128-bit integers is:
As an extension the integer scalar type __int128 is supported for targets which have an integer mode wide enough to hold 128 bits.
Simply write __int128 for a signed 128-bit integer, or unsigned __int128…

Peeter Joot
- 7,848
- 7
- 48
- 82
15
votes
6 answers
How can I represent a 128bit integer in Java or C++?
Is it possible to have a 128bit integer in Java or C++?
user466534
14
votes
4 answers
128 bit integer on cuda?
I just managed to install my cuda SDK under Linux Ubuntu 10.04. My graphic card is an NVIDIA geForce GT 425M, and I'd like to use it for some heavy computational problem.
What I wonder is: is there any way to use some unsigned 128 bit int var? When…

Matteo Monti
- 8,362
- 19
- 68
- 114
12
votes
5 answers
128-bit division intrinsic in Visual C++
I'm wondering if there really is no 128-bit division intrinsic function in Visual C++?
There is a 64x64=128 bit multiplication intrinsic function called _umul128(), which nicely matches the MUL x64 assembler instruction.
Naturally, I assumed there…

cxxl
- 4,939
- 3
- 31
- 52
12
votes
1 answer
Using Lapack with 128 bit precision
I am trying to use Lapack for a 128 bit precision calculation of a matrix singular value decomposition (SVD) and I found out that there is some black compiler magic to accomplish this. The Intel Fortran compiler (ifort) supports the option -r16…

Maxwell
- 303
- 1
- 7
10
votes
3 answers
__uint128_t on mingw gcc
I'm trying to compile a c program under mingw gcc. This program is using an __uint128_t integer. When I try to compile it under the standard ubuntu gcc on the same 64-bit machine, it perfectly works. But then, when I try to compile it for windows…

Matteo Monti
- 8,362
- 19
- 68
- 114