Skip to content

Commit

Permalink
Merge pull request #64 from brianwatling/master
Browse files Browse the repository at this point in the history
Support parsing alternative instruction listings
  • Loading branch information
AmitBM committed Jun 9, 2020
2 parents 22343cc + 553a78f commit e04f97d
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion Core/ShaderAnalysis/src/shae.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ def Add (self, reg):
elif reg.startswith ('-'):
reg = reg [1:]

if reg[0] != 'v' or reg == 'vcc' or reg.startswith ('vmcnt'):
if reg[0] != 'v' or reg.startswith('vcc') or reg.startswith ('vmcnt'):
return

if reg[1] == '[':
Expand Down Expand Up @@ -267,6 +267,8 @@ def GetLines(self, inputStream):
if line.startswith(';'):
continue
comment = line.find ('//')
if comment == -1:
comment = line.find(';')
commentStr = ""
instItems = []
if comment != -1:
Expand Down Expand Up @@ -324,6 +326,11 @@ def GetBinEncodingText(self, comment):
foundBinCode = re.search(r' *[0-9a-fA-F]+: *([0-9a-fA-F]{8})( *[0-9a-fA-F]{8})?', comment)
if foundBinCode:
result = comment[comment.find(':')+1 :].lstrip(' ')
else:
# Attempt to match comments containing only the bin code.
foundBinCode = re.search(r' *([0-9a-fA-F]{8})( *[0-9a-fA-F]{8})?', comment)
if foundBinCode:
result = comment.lstrip(' ')
return result

class ShaderAnalyzerIsaReader(_BaseIsaReader):
Expand Down

0 comments on commit e04f97d

Please sign in to comment.