enhancements for lookup and parsing AArch64 instrs

This commit is contained in:
JanLJL
2020-12-07 00:51:15 +01:00
committed by Jan
parent b9e434d124
commit 23623ca18a
2 changed files with 10 additions and 5 deletions

View File

@@ -123,10 +123,12 @@ class ParserAArch64(BaseParser):
vector = (
pp.oneOf('v z', caseless=True).setResultsName('prefix')
+ pp.Word(pp.nums).setResultsName('name')
+ pp.Literal('.')
+ pp.Optional(pp.Word('12468')).setResultsName('lanes')
+ pp.Word(pp.alphas, exact=1).setResultsName('shape')
+ pp.Optional(index)
+ pp.Optional(
pp.Literal('.')
+ pp.Optional(pp.Word('12468')).setResultsName('lanes')
+ pp.Word(pp.alphas, exact=1).setResultsName('shape')
+ pp.Optional(index)
)
)
predicate = (
pp.CaselessLiteral('p').setResultsName('prefix')

View File

@@ -574,7 +574,10 @@ class MachineModel(object):
if reg['prefix'] != i_reg['prefix']:
return False
if 'shape' in reg:
if 'shape' in i_reg and reg['shape'] == i_reg['shape']:
if 'shape' in i_reg and (
reg['shape'] == i_reg['shape']
or self.WILDCARD in (reg['shape'] + i_reg['shape'])
):
return True
return False
return True