From 0f1c475bb485953ad0ae98fbb5a96d24c53d8414 Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Fri, 16 Aug 2024 13:14:45 -0400 Subject: More fixes for ints --- builtins/integers.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/builtins/integers.h b/builtins/integers.h index d3a9546b..898469e2 100644 --- a/builtins/integers.h +++ b/builtins/integers.h @@ -155,7 +155,7 @@ static inline Int_t Int$modulo1(Int_t x, Int_t y) { static inline Int_t Int$left_shifted(Int_t x, Int_t y) { if (__builtin_expect(((x.small & y.small) & 1) != 0, 1)) { - const int64_t z = 4*((x.small>>2) << (y.small>>2)); + const int64_t z = ((x.small>>2) << (y.small>>2))<<2; if (__builtin_expect(z == (int32_t)z, 1)) return (Int_t){.small=z+1}; } @@ -164,7 +164,7 @@ static inline Int_t Int$left_shifted(Int_t x, Int_t y) { static inline Int_t Int$right_shifted(Int_t x, Int_t y) { if (__builtin_expect(((x.small & y.small) & 1) != 0, 1)) { - const int64_t z = 4*((x.small>>2) >> (y.small>>2)); + const int64_t z = ((x.small>>2) >> (y.small>>2))<<2; if (__builtin_expect(z == (int32_t)z, 1)) return (Int_t){.small=z+1}; } @@ -200,7 +200,7 @@ static inline Int_t Int$negated(Int_t x) static inline Int_t Int$negative(Int_t x) { if (__builtin_expect((x.small & 1), 1)) - return (Int_t){.small=4*-((x.small)>>2) + 1}; + return (Int_t){.small=((-((x.small)>>2))<<2) | 1}; return Int$slow_negative(x); } -- cgit v1.2.3