From e422f8722a8b50e917caa02c7c15df32044b8b6c Mon Sep 17 00:00:00 2001 From: Matthew Fernandez Date: Sun, 16 Jan 2022 10:37:48 -0800 Subject: [PATCH] expr: remove legacy IBM compiler work around Despite dredging the commit log, comp.lang, and Stack Overflow, I have been unable to determine what these comments refer to. They read to me like working around a register allocator bug. AFAIK every production compiler from the last decade has been capable of these kind of one-line shifts without work arounds. Gitlab: #2103 --- lib/expr/exeval.c | 44 +++----------------------------------------- 1 file changed, 3 insertions(+), 41 deletions(-) diff --git a/lib/expr/exeval.c b/lib/expr/exeval.c index b01335b34..e2b8e8f81 100644 --- a/lib/expr/exeval.c +++ b/lib/expr/exeval.c @@ -1754,31 +1754,10 @@ eval(Expr_t* ex, Exnode_t* expr, void* env) v.integer = v.floating > r.floating; return v; case LSH: -/* IBM compilers can't deal with these shift operators on long long. - * v.floating = ((Sflong_t)v.floating) << ((Sflong_t)r.floating); - */ - { - Sflong_t op1, op2; - op1 = (Sflong_t)v.floating; - op2 = (Sflong_t)r.floating; - v.floating = (double) (op1 << op2); - } + v.floating = (Sflong_t) ((Sfulong_t)v.floating << (Sflong_t)r.floating); return v; case RSH: -#ifdef _WIN32 v.floating = (Sflong_t) ((Sfulong_t)v.floating >> (Sflong_t)r.floating); -#else -/* IBM compilers can't deal with these shift operators on long long. - * v.floating = ((Sfulong_t)v.floating) >> ((Sflong_t)r.floating); - */ - { - Sflong_t op1, op2; - op1 = (Sfulong_t)v.floating; - op2 = (Sflong_t)r.floating; - v.floating = (double) (op1 >> op2); - } -#endif - return v; } break; @@ -1919,27 +1898,10 @@ eval(Expr_t* ex, Exnode_t* expr, void* env) v.integer = v.integer != r.integer; return v; case LSH: -/* IBM compilers can't deal with these shift operators on long long. - * v.floating = (Sflong_t)v.floating << (Sflong_t)r.floating; - */ - { - Sflong_t op1, op2; - op1 = (Sflong_t)v.floating; - op2 = (Sflong_t)r.floating; - v.floating = (double) (op1 << op2); - } + v.floating = (double)((Sflong_t)v.floating << (Sflong_t)r.floating); return v; case RSH: -/* IBM compilers can't deal with these shift operators on long long. - * v.integer = ((Sfulong_t)v.floating) >> (Sflong_t)r.floating; - */ - { - Sfulong_t op1; - Sflong_t op2; - op1 = (Sfulong_t)v.floating; - op2 = (Sflong_t)r.floating; - v.integer = op1 >> op2; - } + v.integer = (Sfulong_t)v.floating >> (Sflong_t)r.floating; return v; case '<': v.integer = v.integer < r.integer; -- 2.40.0