isa_parser.py (3954:d689b611d9dc) isa_parser.py (4040:eb894f3fc168)
1# Copyright (c) 2003-2005 The Regents of The University of Michigan
2# All rights reserved.
3#
4# Redistribution and use in source and binary forms, with or without
5# modification, are permitted provided that the following conditions are
6# met: redistributions of source code must retain the above copyright
7# notice, this list of conditions and the following disclaimer;
8# redistributions in binary form must reproduce the above copyright

--- 1110 unchanged lines hidden (view full) ---

1119 ctype = 'uint%d_t' % size
1120 is_signed = 0
1121 elif desc == 'float':
1122 is_signed = 1 # shouldn't really matter
1123 if size == 32:
1124 ctype = 'float'
1125 elif size == 64:
1126 ctype = 'double'
1# Copyright (c) 2003-2005 The Regents of The University of Michigan
2# All rights reserved.
3#
4# Redistribution and use in source and binary forms, with or without
5# modification, are permitted provided that the following conditions are
6# met: redistributions of source code must retain the above copyright
7# notice, this list of conditions and the following disclaimer;
8# redistributions in binary form must reproduce the above copyright

--- 1110 unchanged lines hidden (view full) ---

1119 ctype = 'uint%d_t' % size
1120 is_signed = 0
1121 elif desc == 'float':
1122 is_signed = 1 # shouldn't really matter
1123 if size == 32:
1124 ctype = 'float'
1125 elif size == 64:
1126 ctype = 'double'
1127 elif desc == 'twin int':
1128 is_signed = 0
1129 ctype = 'Twin64_t'
1127 if ctype == '':
1128 error(lineno, 'Unrecognized type description "%s" in userDict')
1129 operandTypeMap[ext] = (size, ctype, is_signed)
1130
1131#
1132#
1133#
1134# Base class for operand descriptors. An instance of this class (or

--- 16 unchanged lines hidden (view full) ---

1151 self.eff_ext = self.dflt_ext
1152
1153 (self.size, self.ctype, self.is_signed) = operandTypeMap[self.eff_ext]
1154
1155 # note that mem_acc_size is undefined for non-mem operands...
1156 # template must be careful not to use it if it doesn't apply.
1157 if self.isMem():
1158 self.mem_acc_size = self.makeAccSize()
1130 if ctype == '':
1131 error(lineno, 'Unrecognized type description "%s" in userDict')
1132 operandTypeMap[ext] = (size, ctype, is_signed)
1133
1134#
1135#
1136#
1137# Base class for operand descriptors. An instance of this class (or

--- 16 unchanged lines hidden (view full) ---

1154 self.eff_ext = self.dflt_ext
1155
1156 (self.size, self.ctype, self.is_signed) = operandTypeMap[self.eff_ext]
1157
1158 # note that mem_acc_size is undefined for non-mem operands...
1159 # template must be careful not to use it if it doesn't apply.
1160 if self.isMem():
1161 self.mem_acc_size = self.makeAccSize()
1159 self.mem_acc_type = self.ctype
1162 if self.ctype == 'Twin64_t':
1163 self.mem_acc_type = 'Twin'
1164 else:
1165 self.mem_acc_type = 'uint'
1160
1161 # Finalize additional fields (primarily code fields). This step
1162 # is done separately since some of these fields may depend on the
1163 # register index enumeration that hasn't been performed yet at the
1164 # time of __init__().
1165 def finalize(self):
1166 self.flags = self.getFlags()
1167 self.constructor = self.makeConstructor()

--- 213 unchanged lines hidden (view full) ---

1381
1382 def makeConstructor(self):
1383 return ''
1384
1385 def makeDecl(self):
1386 # Note that initializations in the declarations are solely
1387 # to avoid 'uninitialized variable' errors from the compiler.
1388 # Declare memory data variable.
1166
1167 # Finalize additional fields (primarily code fields). This step
1168 # is done separately since some of these fields may depend on the
1169 # register index enumeration that hasn't been performed yet at the
1170 # time of __init__().
1171 def finalize(self):
1172 self.flags = self.getFlags()
1173 self.constructor = self.makeConstructor()

--- 213 unchanged lines hidden (view full) ---

1387
1388 def makeConstructor(self):
1389 return ''
1390
1391 def makeDecl(self):
1392 # Note that initializations in the declarations are solely
1393 # to avoid 'uninitialized variable' errors from the compiler.
1394 # Declare memory data variable.
1395 if self.ctype == 'Twin64_t':
1396 return "%s %s; %s.a = 0; %s.b = 0;\n" % (self.ctype, self.base_name,
1397 self.base_name, self.base_name)
1389 c = '%s %s = 0;\n' % (self.ctype, self.base_name)
1390 return c
1391
1392 def makeRead(self):
1393 return ''
1394
1395 def makeWrite(self):
1396 return ''

--- 485 unchanged lines hidden ---
1398 c = '%s %s = 0;\n' % (self.ctype, self.base_name)
1399 return c
1400
1401 def makeRead(self):
1402 return ''
1403
1404 def makeWrite(self):
1405 return ''

--- 485 unchanged lines hidden ---