Commit 69c93ff8 authored by Jayke Meijer's avatar Jayke Meijer

Fixed failing branch.

parent b8e861b1
...@@ -57,13 +57,13 @@ class Statement: ...@@ -57,13 +57,13 @@ class Statement:
def is_jump(self): def is_jump(self):
"""Check if the statement is a jump.""" """Check if the statement is a jump."""
return self.is_command() \ return self.is_command() \
and re.match('^j|jal|beq|bne|blez|bgtz|bltz|bgez|bct|bcf$', \ and re.match('^j|jal|beq|bne|blez|bgtz|bltz|bgez|bc1t|bc1f$', \
self.name) self.name)
def is_branch(self): def is_branch(self):
"""Check if the statement is a branch.""" """Check if the statement is a branch."""
return self.is_command() \ return self.is_command() \
and re.match('^beq|bne|blez|bgtz|bltz|bgez|bct|bcf$', \ and re.match('^beq|bne|blez|bgtz|bltz|bgez|bct|bcf|bc1f|bc1t$',\
self.name) self.name)
def is_branch_zero(self): def is_branch_zero(self):
...@@ -172,7 +172,9 @@ class Statement: ...@@ -172,7 +172,9 @@ class Statement:
use = [] use = []
# Case arg0 # Case arg0
if self.is_branch() or self.is_store() or self.is_compare() \ if (self.is_branch() \
and not self.is_command(*['bc1f', 'bc1t', 'bct', 'bcf'])) \
or self.is_store() or self.is_compare() \
or self.is_command(*['mult', 'div', 'dsz', 'mtc1']): or self.is_command(*['mult', 'div', 'dsz', 'mtc1']):
if self.name == 'dsz': if self.name == 'dsz':
m = re.match('^[^(]+\(([^)]+)\)$', self[0]) m = re.match('^[^(]+\(([^)]+)\)$', self[0])
...@@ -182,7 +184,9 @@ class Statement: ...@@ -182,7 +184,9 @@ class Statement:
else: else:
use.append(self[0]) use.append(self[0])
# Case arg1 direct adressing # Case arg1 direct adressing
if (self.is_branch() and not self.is_branch_zero()) or self.is_shift()\ if (self.is_branch() and not self.is_branch_zero() \
and not self.is_command(*['bc1f', 'bc1t', 'bct', 'bcf'])) \
or self.is_shift() \
or self.is_double_arithmetic() or self.is_double_unary() \ or self.is_double_arithmetic() or self.is_double_unary() \
or self.is_logical() or self.is_convert() \ or self.is_logical() or self.is_convert() \
or self.is_truncate() or self.is_set_if_less() \ or self.is_truncate() or self.is_set_if_less() \
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment