From 21fd5c8195be5faf20d8bc7ce3ba6cd8d26c8b29 Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Tue, 13 Aug 2024 01:43:46 -0400 Subject: Bugfixes --- builtins/integers.c | 6 +++++- builtins/integers.h | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) (limited to 'builtins') 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; \ -- cgit v1.2.3