Questions tagged [extended-precision]
45 questions
52
votes
2 answers
Is there a document describing how Clang handles excess floating-point precision?
It is nearly impossible(*) to provide strict IEEE 754 semantics at reasonable cost when the only floating-point instructions one is allowed to used are the 387 ones. It is particularly hard when one wishes to keep the FPU working on the full 64-bit…

Pascal Cuoq
- 79,187
- 7
- 161
- 281
45
votes
1 answer
80-bit extended precision floating-point in OCaml
Is there an OCaml library to take advantage of the 80-bit extended precision floating-point type on the IA-32 and x86-64 architectures?
I know about the MPFR bindings but my ideal library would be more lightweight. Taking advantage of the historical…

Pascal Cuoq
- 79,187
- 7
- 161
- 281
41
votes
4 answers
long double (GCC specific) and __float128
I'm looking for detailed information on long double and __float128 in GCC/x86 (more out of curiosity than because of an actual problem).
Few people will probably ever need these (I've just, for the first time ever, truly needed a double), but I…

Damon
- 67,688
- 20
- 135
- 185
24
votes
7 answers
Efficient computation of the average of three unsigned integers (without overflow)
There is an existing question "Average of 3 long integers" that is specifically concerned with the efficient computation of the average of three signed integers.
The use of unsigned integers however allows for additional optimizations not applicable…

njuffa
- 23,970
- 4
- 78
- 130
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
17
votes
3 answers
practical BigNum AVX/SSE possible?
SSE/AVX registers could be viewed as integer or floating point BigNums. That is, one could neglect that there exist lanes at all. Does there exist an easy way to exploit this point of view and use these registers as BigNums either singly or…

user1095108
- 14,119
- 9
- 58
- 116
17
votes
5 answers
what is fastest x86-64 assembly-language divide algorithm for huge numbers?
I am writing a code library in x86-64 assembly-language to provide all conventional bitwise, shift, logical, compare, arithmetic and math functions for s0128, s0256, s0512, s1024 signed-integer types and f0128, f0256, f0512, f1024 floating-point…

honestann
- 1,374
- 12
- 19
16
votes
5 answers
What are the applications/benefits of an 80-bit extended precision data type?
Yeah, I meant to say 80-bit. That's not a typo...
My experience with floating point variables has always involved 4-byte multiples, like singles (32 bit), doubles (64 bit), and long doubles (which I've seen referred to as either 96-bit or 128-bit).…

gnovice
- 125,304
- 15
- 256
- 359
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
1 answer
Is it possible to use extended precision (80-bit) floating point arithmetic in GHC/Haskell?
The standard Haskell's Double uses the standard double-precision arithmetic:
data Double
Double-precision floating point numbers. It is desirable that this type be at least equal in range and precision to the IEEE double-precision type.
Does…

Petr
- 62,528
- 13
- 153
- 317
13
votes
3 answers
Is there a 256-bit integer type?
OS: Linux (Debian 10)
CC: GCC 8.3
CPU: i7-5775C
There is a unsigned __int128/__int128 in GCC, but is there any way to have a uint256_t/int256_t in GCC?
I have read of a __m256i which seems to be from Intel. Is there any header that I can include to…

alx - recommends codidact
- 4,204
- 3
- 22
- 51
13
votes
2 answers
C++ handling of excess precision
I'm currently looking at code which does multi-precision floating-point arithmetic. To work correctly, that code requires values to be reduced to their final precision at well-defined points. So even if an intermediate result was computed to an 80…

MvG
- 57,380
- 22
- 148
- 276
12
votes
2 answers
get unsigned long long addition carry
I want to get the carry bit of adding two unsigned 64-bit integers in c.
I can use x86-64 asm if needed.
code:
#include
typedef unsigned long long llu;
int main(void){
llu a = -1, b = -1;
int carry = /*carry of a+b*/;
llu res =…

neo5003
- 131
- 1
- 7
12
votes
2 answers
Properties of 80-bit extended precision computations starting from double precision arguments
Here are two implementations of interpolation functions. Argument u1 is always between 0. and 1..
#include
double interpol_64(double u1, double u2, double u3)
{
return u2 * (1.0 - u1) + u1 * u3;
}
double interpol_80(double u1,…

Pascal Cuoq
- 79,187
- 7
- 161
- 281
10
votes
11 answers
How can I multiply two 64-bit numbers using x86 assembly language?
How would I go about...
multiplying two 64-bit numbers
multiplying two 16-digit hexadecimal numbers
...using Assembly Language.
I'm only allowed to use registers %eax, %ebx, %ecx, %edx, and the stack.
EDIT: Oh, I'm using ATT Syntax on the…

Kawarazu
- 121
- 1
- 1
- 8