UOps pattern (x%c)+(x//c)*c = x (#6051)

pretty cool that this is very easy to write now
This commit is contained in:
chenyu
2024-08-12 14:58:48 -04:00
committed by GitHub
parent 71c5901fc1
commit 6ed9711898
2 changed files with 7 additions and 0 deletions

View File

@@ -395,6 +395,11 @@ class TestSymbolic(unittest.TestCase):
self.helper_test_variable((((alu2+150)//(-32))+4), 0, 0, "0")
self.helper_test_variable((((alu2+158)//(-32))+4), 0, 0, "0")
def test_div_mod_recombine(self):
gidx = Variable("gidx", 0, 124)
self.helper_test_variable(gidx%4+(gidx//4)*4, 0, 124, "gidx")
self.helper_test_variable((gidx//4)*4+gidx%4, 0, 124, "gidx")
@unittest.skip("not supported on uops yet")
class TestSymbolicNumeric(unittest.TestCase):
def helper_test_numeric(self, f):