Commit fdd0ba24 authored by Jayke Meijer's avatar Jayke Meijer

Fixed mtc1 use and def.

parent 93e40ce5
...@@ -150,8 +150,10 @@ class Statement: ...@@ -150,8 +150,10 @@ class Statement:
def get_def(self): def get_def(self):
"""Get the variable that this statement defines, if any.""" """Get the variable that this statement defines, if any."""
instr = ['move', 'addu', 'subu', 'li', 'mtc1', 'dmfc1', 'mov.d'] instr = ['move', 'addu', 'subu', 'li', 'dmfc1', 'mov.d']
if self.is_command('mtc1'):
return [self[1]]
if self.is_load_non_immediate() or self.is_arith() \ if self.is_load_non_immediate() or self.is_arith() \
or self.is_logical() or self.is_double_arithmetic() \ or self.is_logical() or self.is_double_arithmetic() \
or self.is_move_from_spec() or self.is_double_unary() \ or self.is_move_from_spec() or self.is_double_unary() \
...@@ -164,13 +166,13 @@ class Statement: ...@@ -164,13 +166,13 @@ class Statement:
def get_use(self): def get_use(self):
"""Get the variables that this statement uses, if any.""" """Get the variables that this statement uses, if any."""
instr = ['addu', 'subu', 'mult', 'div', 'move', 'mtc1', 'mov.d', \ instr = ['addu', 'subu', 'mult', 'div', 'move', 'mov.d', \
'dmfc1'] 'dmfc1']
use = [] use = []
# Case arg0 # Case arg0
if self.is_branch() or self.is_store() or self.is_compare()\ if self.is_branch() or self.is_store() or self.is_compare() \
or self.is_command(*['mult', 'div', 'dsz']): or self.is_command(*['mult', 'div', 'dsz', 'mtc1']):
if self.name == 'dsz': if self.name == 'dsz':
m = re.match('^\d+\(([^)]+)\)$', self[0]) m = re.match('^\d+\(([^)]+)\)$', self[0])
use.append(m) use.append(m)
......
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