From d53524208963df290a72327ff4118c1851bd9a61 Mon Sep 17 00:00:00 2001 From: Alex Smith Date: Thu, 2 Sep 2010 23:35:24 +0100 Subject: [PATCH] Optimiser bugfix: loss of precision in bitshifts --- src/idiotism.oil | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/idiotism.oil b/src/idiotism.oil index 68f76c6..ee21e5b 100644 --- a/src/idiotism.oil +++ b/src/idiotism.oil @@ -293,13 +293,16 @@ [combinellshift] ((_1 << #{1}2) << #{1}3)->(_1 << #{x2+x3}0) [combinelrshift] -((_1 << #{1}2) >> #{x>x2}3)->(_1 >> #{x3-x2}0) -((_1 << #{1}2) >> #{x==x2}3)->(_1) -((_1 << #{1}2) >> #{x(_1 << #{x2-x3}0) +((.{65535LU>>x2 >= c}1 << #{1}2) >> #{x>x2}3)->(.1 >> #{x3-x2}0) +((.{65535LU>>x2 >= c}1 << #{1}2) >> #{x==x2}3)->(.1) +((.{65535LU>>x2 >= c}1 << #{1}2) >> #{x(.1 << #{x2-x3}0) +((:{4294967295LU>>x2 >= c}1 << #{1}2) >> #{x>x2}3)->(:1 >> #{x3-x2}0) +((:{4294967295LU>>x2 >= c}1 << #{1}2) >> #{x==x2}3)->(:1) +((:{4294967295LU>>x2 >= c}1 << #{1}2) >> #{x(:1 << #{x2-x3}0) [combinerlshift] -((_1 >> #{1}2) << #{x>x2}3)->(_1 << #{x3-x2}0) -((_1 >> #{1}2) << #{x==x2}3)->(_1) -((_1 >> #{1}2) << #{x(_1 >> #{x2-x3}0) +((_{!(((1LU<> #{1}2) << #{x>x2}3)->(_1 << #{x3-x2}0) +((_{!(((1LU<> #{1}2) << #{x==x2}3)->(_1) +((_{!(((1LU<> #{1}2) << #{x(_1 >> #{x2-x3}0) [combinerrshift] ((_1 >> #{1}2) >> #{1}3)->(_1 >> #{x2+x3}0) [nullshift] -- 2.43.0