]> granicus.if.org Git - graphviz/commitdiff
expr: remove legacy IBM compiler work around
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Sun, 16 Jan 2022 18:37:48 +0000 (10:37 -0800)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Wed, 19 Jan 2022 16:20:40 +0000 (08:20 -0800)
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

index b01335b346ed6635a8ea165bea11756c055b0fb2..e2b8e8f81180a327a96c11224eb099ffcfca368c 100644 (file)
@@ -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;