also add pattern-recognition for just
authorLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Mon, 30 Aug 2021 12:05:59 +0000 (13:05 +0100)
committerLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Mon, 30 Aug 2021 12:05:59 +0000 (13:05 +0100)
     [0] * XLEN

have to keep a close eye on this

src/openpower/decoder/power_pseudo.py
src/openpower/decoder/pseudo/parser.py

index ec9bf0854fe1b5f306fa36dc4dc20e0b9346b0bb..5b251342d0fcd1fa9660b9b411b1fb7ebe0bb6b3 100644 (file)
@@ -202,7 +202,11 @@ concat_test2 = """
 [0]*(XLEN-16)
 """
 
-code = concat_test2
+concat_test3 = """
+[0]*XLEN
+"""
+
+code = concat_test3
 #code = concat_test1
 #code = XLEN_test
 #code = logictest
index b9779b0db5b00cbd19b3a9fa84d32d718766c044..c93b74cd88cacbb21d38d18c070d20ea2a788dcc 100644 (file)
@@ -190,7 +190,8 @@ def identify_sint_mul_pattern(p):
     if p[2] != '*':  # multiply
         return False
     if (not isinstance(p[3], ast.Constant) and  # rhs = Num
-        not isinstance(p[3], ast.BinOp)):       # rhs = (XLEN-something)
+        not isinstance(p[3], ast.BinOp) and     # rhs = (XLEN-something)
+        not isinstance(p[3], ast.Name)):        # rhs = XLEN
         return False
     if not isinstance(p[1], ast.List):  # lhs is a list
         return False