From 73d15d3c4c5550ef85fbd1ea68b9afca2500d0bd Mon Sep 17 00:00:00 2001 From: Luke Kenneth Casson Leighton Date: Mon, 30 Aug 2021 13:05:59 +0100 Subject: [PATCH] also add pattern-recognition for just [0] * XLEN have to keep a close eye on this --- src/openpower/decoder/power_pseudo.py | 6 +++++- src/openpower/decoder/pseudo/parser.py | 3 ++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/openpower/decoder/power_pseudo.py b/src/openpower/decoder/power_pseudo.py index ec9bf085..5b251342 100644 --- a/src/openpower/decoder/power_pseudo.py +++ b/src/openpower/decoder/power_pseudo.py @@ -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 diff --git a/src/openpower/decoder/pseudo/parser.py b/src/openpower/decoder/pseudo/parser.py index b9779b0d..c93b74cd 100644 --- a/src/openpower/decoder/pseudo/parser.py +++ b/src/openpower/decoder/pseudo/parser.py @@ -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 -- 2.30.2