Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
fe04b3b
updating TARGET_VERSION and numpy_to_quad resove desc
SwayamInSync Dec 8, 2025
cdfe02c
Merge branch 'main' into same-value
SwayamInSync Dec 21, 2025
9e3afc3
Merge branch 'main' into same-value
SwayamInSync Dec 23, 2025
605aa59
Merge branch 'main' into same-value
SwayamInSync Dec 24, 2025
9b4d83d
quad2quad
SwayamInSync Dec 24, 2025
95a253a
fix heisenbugs
SwayamInSync Dec 24, 2025
277ee7b
refactor aligned/unaligned into templates
SwayamInSync Dec 24, 2025
5cb4e4a
resolve desc + quad2numpy loop fix
SwayamInSync Dec 24, 2025
3382565
adding same_value int tests
SwayamInSync Dec 25, 2025
534a64e
handling nan in same_value
SwayamInSync Dec 25, 2025
f696848
fix tests
SwayamInSync Dec 25, 2025
22327f8
again union hesinbug?
SwayamInSync Dec 25, 2025
6fa020d
just match with valueerror
SwayamInSync Dec 25, 2025
0babf9d
use memcpy
SwayamInSync Dec 25, 2025
a5cf124
use memcmp
SwayamInSync Dec 25, 2025
90b824d
switch back to no union
SwayamInSync Dec 25, 2025
ff69b8e
addded float tests
SwayamInSync Dec 25, 2025
30f6b95
use double's tiny in ld
SwayamInSync Dec 25, 2025
5c5d791
adding quad->str same_vale
SwayamInSync Dec 25, 2025
dde4a84
improve error msg
SwayamInSync Dec 25, 2025
8862c23
make all from_quad uses const pointer to union
SwayamInSync Dec 25, 2025
e374a36
fixed string same_value
SwayamInSync Dec 25, 2025
c458d53
use quad2sleefquad
SwayamInSync Dec 25, 2025
9d10144
remove non-native order tets for respective systems
SwayamInSync Dec 25, 2025
c17c3d0
powerpc has ld as quad
SwayamInSync Dec 25, 2025
ae9986b
memory barrier
SwayamInSync Dec 25, 2025
308f136
will cont tomorrow from here
SwayamInSync Dec 25, 2025
00acaca
quad2quad same_value
SwayamInSync Dec 26, 2025
e68e6be
nolong need pyucs path
SwayamInSync Dec 26, 2025
3f0cf90
remove unused apis
SwayamInSync Dec 26, 2025
6613125
fixing -0.0 casting
SwayamInSync Dec 27, 2025
ef07ab2
-nan supported
SwayamInSync Dec 27, 2025
770c117
weird bug
SwayamInSync Dec 27, 2025
4199b57
conjunction nan
SwayamInSync Dec 27, 2025
4256e12
fixing to_quad
SwayamInSync Dec 27, 2025
e879e1f
adding debug
SwayamInSync Dec 27, 2025
a4f9359
hadling special sleef->d
SwayamInSync Dec 27, 2025
61e537c
remove debug stmt
SwayamInSync Dec 27, 2025
4bca201
ld handling not needed
SwayamInSync Dec 27, 2025
adf0bc4
improve signbit assert
SwayamInSync Dec 27, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
709 changes: 422 additions & 287 deletions quaddtype/numpy_quaddtype/src/casts.cpp

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions quaddtype/numpy_quaddtype/src/constants.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,12 @@ extern "C" {

// Quad precision constants using sleef_q macro
#define QUAD_PRECISION_ZERO sleef_q(+0x0000000000000LL, 0x0000000000000000ULL, -16383)
#define QUAD_PRECISION_NEG_ZERO sleef_q(-0x0000000000000LL, 0x0000000000000000ULL, -16383)
#define QUAD_PRECISION_ONE sleef_q(+0x1000000000000LL, 0x0000000000000000ULL, 0)
#define QUAD_PRECISION_INF sleef_q(+0x1000000000000LL, 0x0000000000000000ULL, 16384)
#define QUAD_PRECISION_NINF sleef_q(-0x1000000000000LL, 0x0000000000000000ULL, 16384)
#define QUAD_PRECISION_NAN sleef_q(+0x1ffffffffffffLL, 0xffffffffffffffffULL, 16384)
#define QUAD_PRECISION_NEG_NAN sleef_q(-0x1ffffffffffffLL, 0xffffffffffffffffULL, 16384)

// Additional constants
#define QUAD_PRECISION_MAX_FINITE SLEEF_QUAD_MAX
Expand Down
26 changes: 13 additions & 13 deletions quaddtype/numpy_quaddtype/src/dragon4.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Modifications are specific to support the SLEEF_QUAD
#define PY_ARRAY_UNIQUE_SYMBOL QuadPrecType_ARRAY_API
#define PY_UFUNC_UNIQUE_SYMBOL QuadPrecType_UFUNC_API
#define NPY_NO_DEPRECATED_API NPY_2_0_API_VERSION
#define NPY_TARGET_VERSION NPY_2_0_API_VERSION
#define NPY_TARGET_VERSION NPY_2_4_API_VERSION
#define NO_IMPORT_ARRAY
#define NO_IMPORT_UFUNC

Expand Down Expand Up @@ -974,22 +974,22 @@ PrintInfNan(char *buffer, npy_uint32 bufferSize, npy_uint64 mantissa, npy_uint32

DEBUG_ASSERT(bufferSize > 0);

/* Print sign for both inf and nan values */
if (signbit == '+') {
if (pos < maxPrintLen - 1) {
buffer[pos++] = '+';
}
}
else if (signbit == '-') {
if (pos < maxPrintLen - 1) {
buffer[pos++] = '-';
}
}

/* Check for infinity */
if (mantissa == 0) {
npy_uint32 printLen;

/* only print sign for inf values (though nan can have a sign set) */
if (signbit == '+') {
if (pos < maxPrintLen - 1) {
buffer[pos++] = '+';
}
}
else if (signbit == '-') {
if (pos < maxPrintLen - 1) {
buffer[pos++] = '-';
}
}

/* copy and make sure the buffer is terminated */
printLen = (3 < maxPrintLen - pos) ? 3 : maxPrintLen - pos;
memcpy(buffer + pos, "inf", printLen);
Expand Down
2 changes: 1 addition & 1 deletion quaddtype/numpy_quaddtype/src/dtype.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#define PY_ARRAY_UNIQUE_SYMBOL QuadPrecType_ARRAY_API
#define PY_UFUNC_UNIQUE_SYMBOL QuadPrecType_UFUNC_API
#define NPY_NO_DEPRECATED_API NPY_2_0_API_VERSION
#define NPY_TARGET_VERSION NPY_2_0_API_VERSION
#define NPY_TARGET_VERSION NPY_2_4_API_VERSION
#define NO_IMPORT_ARRAY
#define NO_IMPORT_UFUNC
#include "numpy/arrayobject.h"
Expand Down
Loading