scandum / fluxsort

A fast branchless stable quicksort / mergesort hybrid that is highly adaptive.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

"Long double" is not an 128bit integer

Soveu opened this issue · comments

commented

iirc, long double is a weird 80-bit floating point number that x86 apparently supports
Depending on the compiled platform (32bit x86 or x86_64) the 80 bits get rounded up to 12 or 16 bytes
https://github.com/scandum/fluxsort/blob/main/src/fluxsort.h#L177

The bit value refers to the size and not the type, since int and long long can be used for 32 and 64 bit pointers.

I'm aware it's ambiguous for long doubles, but I had to name it something.

You could typedef a 96 and 128 bit structure and handle it that way, though it would result in a compilation error if you uncomment the cmp macro.

long double is also 64-bit on Windows x64 and most non-x86 architectures, causing a duplicate case error.

I know it took a bit, but at last I've added a precompiler check for 64-bit long doubles, and I've documented the ambiguity of long doubles in quadsort.h and fluxsort.h.