diff options
| author | Bruce Hill <bruce@bruce-hill.com> | 2024-08-13 01:43:46 -0400 |
|---|---|---|
| committer | Bruce Hill <bruce@bruce-hill.com> | 2024-08-13 01:43:46 -0400 |
| commit | 21fd5c8195be5faf20d8bc7ce3ba6cd8d26c8b29 (patch) | |
| tree | 6ef75ed164cc8bf63e97a90fea3d8c827d245d48 | |
| parent | d08f795794b33a5d52e39c6b9f0c4e6e88fede3d (diff) | |
Bugfixes
| -rw-r--r-- | builtins/integers.c | 6 | ||||
| -rw-r--r-- | builtins/integers.h | 2 |
2 files changed, 6 insertions, 2 deletions
diff --git a/builtins/integers.c b/builtins/integers.c index 8bc66172..d087cd39 100644 --- a/builtins/integers.c +++ b/builtins/integers.c @@ -49,8 +49,12 @@ public int32_t Int$compare(const Int_t *x, const Int_t *y, const TypeInfo *type) } public int32_t Int$compare_value(const Int_t x, const Int_t y) { - if (__builtin_expect(((x.small & y.small) & 1) == 0, 0)) + CORD_printf("comparing values %r vs %r\n", Int$as_text(&x, true, NULL), Int$as_text(&y, true, NULL)); + printf("comparing values %p vs %p\n", x.big, y.big); + if (__builtin_expect(((x.small & y.small) & 1) == 0, 0)) { + printf("MPZ comparing\n"); return mpz_cmp(*x.big, *y.big); + } return (x.small > y.small) - (x.small < y.small); } diff --git a/builtins/integers.h b/builtins/integers.h index cf2e7e25..a586dfcf 100644 --- a/builtins/integers.h +++ b/builtins/integers.h @@ -101,7 +101,7 @@ Int_t Int$slow_abs(Int_t x); #define Int$minus(_x, _y) ({ \ Int_t x = _x, y = _y; \ const int64_t z = (int64_t)(((uint64_t)x.small ^ 3) - (uint64_t)y.small); \ - __builtin_expect(((z & ~2) != (int32_t)z), 0) ? Int$slow_minus(x, y) : (Int_t){.small=(z-1)}; }) + __builtin_expect(((z & ~2) != (int32_t)z), 0) ? Int$slow_minus(x, y) : (Int_t){.small=z}; }) #define Int$times(_x, _y) ({ \ Int_t x = _x, y = _y; \ |
