Mercurial > lcfOS
diff python/ppci/target/basetarget.py @ 362:c05ab629976a
Added CPUID for arm
author | Windel Bouwman |
---|---|
date | Sat, 15 Mar 2014 10:56:34 +0100 |
parents | 5477e499b039 |
children | 396e5cefba13 |
line wrap: on
line diff
--- a/python/ppci/target/basetarget.py Fri Mar 14 16:18:54 2014 +0100 +++ b/python/ppci/target/basetarget.py Sat Mar 15 10:56:34 2014 +0100 @@ -1,3 +1,4 @@ +import types from ppci import CompilerError """ @@ -124,7 +125,12 @@ self.add_rule('instruction', rhs, f) def add_rule(self, lhs, rhs, f): - self.assembler_rules.append((lhs, rhs, f)) + if type(f) is int: + f2 = lambda x: f + else: + f2 = f + assert type(f2) is types.FunctionType + self.assembler_rules.append((lhs, rhs, f2)) def lower_frame_to_stream(self, frame, outs): """ Lower instructions from frame to output stream """