summaryrefslogtreecommitdiff
path: root/src/arch/isa_parser.py
diff options
context:
space:
mode:
authorGabe Black <gblack@eecs.umich.edu>2011-07-05 16:52:15 -0700
committerGabe Black <gblack@eecs.umich.edu>2011-07-05 16:52:15 -0700
commit63a934d152024c093dc02cc94ad6b29607615af4 (patch)
tree796b6cd7a1c2cfa6d5a3c532409c4802df7ab755 /src/arch/isa_parser.py
parentf16179eb213acdbf4d86a1a50a1facc56c9e660d (diff)
downloadgem5-63a934d152024c093dc02cc94ad6b29607615af4.tar.xz
ISA parser: Define operand types with a ctype directly.
Diffstat (limited to 'src/arch/isa_parser.py')
-rwxr-xr-xsrc/arch/isa_parser.py28
1 files changed, 1 insertions, 27 deletions
diff --git a/src/arch/isa_parser.py b/src/arch/isa_parser.py
index f52727a75..97b1bcecc 100755
--- a/src/arch/isa_parser.py
+++ b/src/arch/isa_parser.py
@@ -1321,13 +1321,12 @@ StaticInstPtr
def p_def_operand_types(self, t):
'def_operand_types : DEF OPERAND_TYPES CODELIT SEMI'
try:
- user_dict = eval('{' + t[3] + '}')
+ self.operandTypeMap = eval('{' + t[3] + '}')
except Exception, exc:
if debug:
raise
error(t,
'error: %s in def operand_types block "%s".' % (exc, t[3]))
- self.buildOperandTypeMap(user_dict, t.lexer.lineno)
t[0] = GenCode(self) # contributes nothing to the output C++ file
# Define the mapping from operand names to operand classes and
@@ -1788,31 +1787,6 @@ StaticInstPtr
return re.sub(r'%(?!\()', '%%', s)
- def buildOperandTypeMap(self, user_dict, lineno):
- """Generate operandTypeMap from the user's 'def operand_types'
- statement."""
- operand_type = {}
- for (ext, (desc, size)) in user_dict.iteritems():
- if desc == 'signed int':
- ctype = 'int%d_t' % size
- elif desc == 'unsigned int':
- ctype = 'uint%d_t' % size
- elif desc == 'float':
- if size == 32:
- ctype = 'float'
- elif size == 64:
- ctype = 'double'
- elif desc == 'twin64 int':
- ctype = 'Twin64_t'
- elif desc == 'twin32 int':
- ctype = 'Twin32_t'
- if ctype == '':
- error(parser, lineno,
- 'Unrecognized type description "%s" in user_dict')
- operand_type[ext] = ctype
-
- self.operandTypeMap = operand_type
-
def buildOperandNameMap(self, user_dict, lineno):
operand_name = {}
for op_name, val in user_dict.iteritems():