Referring to computer architecture with addresses and other data units 128 bits wide.
Questions tagged [128-bit]
85 questions
3
votes
2 answers
How to use boost::uuids::uuid to convert to 128/64 bit numbers?
I use this code to produce UUIDs from boost:
boost::uuids::random_generator gen;
boost::uuids::uuid uuidId = gen();
string randomUUID = boost::lexical_cast(uuidId);
std::remove( randomUUID.begin(), randomUUID.end(), '-');
randomUUID =…

Alec H
- 51
- 1
- 2
3
votes
2 answers
How to combine 4 uint32_t ints into a whole 128 bit int and return
As part of a struct(let's call it ASM) in a header file there are declared four uint32_t ints.
uint32_t Result1;
uint32_t Result2;
uint32_t Result3;
uint32_t Result4;
I want to access these like this: ASM->Result1, ASM->Result2 etc and combine…

Django
- 343
- 1
- 4
- 23
3
votes
2 answers
Intrinsics for 128 multiplication and division
In x86_64 I know that the mul and div opp codes support 128 integers by putting the lower 64 bits in the rax and the upper in the rdx registers. I was looking for some sort of intrinsic to do this in the intel intrinsics guide and I could not find…

chasep255
- 11,745
- 8
- 58
- 115
3
votes
5 answers
Compute (a*b)%n FAST for 64-bit unsigned arguments in C(++) on x86-64 platforms?
I'm looking for a fast method to efficiently compute (a⋅b) modulo n (in the mathematical sense of that) for a, b, n of type uint64_t. I could live with preconditions such as n!=0, or even a

fgrieu
- 2,724
- 1
- 23
- 53
2
votes
2 answers
Is it possible to perform 128-bit / 64-bit division without branching, in terms of 64-bit division?
I'm working with the Algorand contract code which has a very limited scope of possible operations in their assembly code - e.g., it is not possible to control flow of the code. Basic 64 bit arithmetic operations are available.
What I need to do is…

Sebastian
- 33
- 3
2
votes
2 answers
gcc 7.3 128-bit unsigned integer operation
I'm confused with the usage of 128-bit integer.
Please look at the test code:
uint128_t test_data = 0x00000000FFFFFFFF0101010101010101;
uint64_t test_data_h = test_data >> 64;
uint64_t test_data_l = test_data ;
printf("test_data 0x %016llx…

melquiades
- 21
- 3
2
votes
1 answer
Divide 64-bit integers as though the dividend is shifted left 64 bits, without having 128-bit types
Apologies for the confusing title. I'm not sure how to better describe what I'm trying to accomplish. I'm essentially trying to do the reverse of
getting the high half of a 64-bit multiplication in C for platforms where
int64_t divHi64(int64_t…

superb owl
- 185
- 2
- 13
2
votes
1 answer
OpenCL 128bit multiplication result
I need to multipltcate two unsigned 64 bit integers (unsigned long) inside an OpenCL-kernel, the result an 128 bit integer (unsigned long long).
Newer versions of openCL seem to support this type.
unsigned long m1, m2;
.
.
unsigned long long result…

Craden
- 145
- 6
2
votes
3 answers
How to take input 128 bit unsigned integer in c++
I am new to c++. I want to take input a unsigned 128 bit integer using scanf and print it using printf. As I am new to c++ , I only know these two methods for input output. Can someone help me out?

Ridwan
- 75
- 2
- 8
2
votes
1 answer
C 128 bit double type
I have the following code...
ran_int = rand(); //check READ ME Citation B
if (input == 32){
//rand() with 2^31 as lower limit and 2^32 as its upper
long long int upper_limit = 4294967295;
…

Kendall Weihe
- 111
- 1
- 1
- 9
2
votes
4 answers
Is there a library or other way to do 128-bit math operations?
I am writing a cryptography application and need to work with 128 bit integers.
In addition to standard add, subtract, multiply, divide, and comparisons, I also need a power and modulo function as well.
Does anyone know of a library or other…

samoz
- 56,849
- 55
- 141
- 195
2
votes
0 answers
128bit integer in mips assembly
I have to write a program in MIPS assembly (32bits) checking whether fixed point decimal number can be written accurately in ieee754.
I know the structure of float, hence i do it like:
split number with comma into integer and fractional part…

Piotr_iOS
- 129
- 1
- 7
2
votes
3 answers
How to concatenate two 64bits integer into a 128 bits integer?
I have 2 64 bit integers and I would like to concatenate it into a single 128bit integer.
uint64_t len_A;
uint64_t len_C;
len_AC= (len_A << 64) | len_C;
GCC doesn't support uint128_t.
Is there any other ways to do it?

Anne
- 123
- 8
2
votes
1 answer
Can I store only 96 bit of 128 with SSE instructions?
_mm_store_ps stores (for example) 128 bit in a 4 float elements of an array.
Can I store only 96 bit? or rather, only first 3 byte in 3 elements of array? (with SSE instuctions)
I explained myself badly: I do not want to mask the bits. I would like…

user2120196
- 61
- 4
2
votes
2 answers
Custom string to 128-bit string
I am trying to force a custom string with a length between 0 and 15 to a 128-bit string, so I can use it as a AesCryptoServiceProvider key.
I have tried fiddling around with multiple strategies, and have ended up with the following:
if…

TheGeekZn
- 3,696
- 10
- 55
- 91