aboutsummaryrefslogtreecommitdiff
path: root/builtins
diff options
context:
space:
mode:
Diffstat (limited to 'builtins')
-rw-r--r--builtins/integers.c6
-rw-r--r--builtins/integers.h2
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; \