aboutsummaryrefslogtreecommitdiff
path: root/builtins
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2024-08-16 13:14:45 -0400
committerBruce Hill <bruce@bruce-hill.com>2024-08-16 13:14:45 -0400
commit0f1c475bb485953ad0ae98fbb5a96d24c53d8414 (patch)
tree0f04e56dc0f9417e4cb03b722ce56d6d306de4e8 /builtins
parent436c6d445749a887c76e514867aaad7d6afbc679 (diff)
More fixes for ints
Diffstat (limited to 'builtins')
-rw-r--r--builtins/integers.h6
1 files 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);
}