Lines Matching refs:code

11 # modified or unmodified, in source code or in binary form.
19 # met: redistributions of source code must retain the above copyright
61 # Used to make nested code blocks look pretty.
67 # Munge a somewhat arbitrarily formatted piece of Python code
74 # indentation. Unfortunately the way code literals work, an entire
77 # 1:' to make the let code the nested block inside the if (and have
80 # We don't want to do this if (1) the code block is empty or (2) the
123 # in the templated C++ code)
227 # a defineInst() method that generates the code for an instruction
231 def __init__(self, id, params, code):
235 self.user_code = compile(fixPythonIndentation(code), label, 'exec')
278 # The GenCode class encapsulates generated code destined for various
280 # strings containing code destined for decoder.hh and decoder.cc
281 # respectively. The decode_block attribute contains code to be
283 # decoder.cc). The exec_output attribute is the string of code for the
299 # Write these code chunks out to the filesystem. They will be properly
344 def substBitOps(code):
347 code = bitOp1ArgRE.sub(r'<\1:\1>', code)
350 code = bitOpWordRE.sub(r'bits(\1, \2, \3)', code)
353 match = bitOpExprRE.search(code)
359 if code[here] == '(':
361 elif code[here] == ')':
367 newExpr = r'bits(%s, %s, %s)' % (code[exprStart:exprEnd+1],
369 code = code[:exprStart] + newExpr + code[match.end():]
370 match = bitOpExprRE.search(code)
371 return code
378 # The remaining code is the support for automatically extracting
399 operand for a code block (e.g, "Rc.sq" as a dest). Intermediate
410 code = self.read_code % subst_dict
411 return '%s = %s;\n' % (self.base_name, code)
421 code = self.write_code % subst_dict
427 }''' % (self.dflt_ctype, self.base_name, code)
444 # Finalize additional fields (primarily code fields). This step
631 code = 'xc->readFloatRegOperandBits(this, %s)' % rindex
633 code = 'bitsToFloat32(%s)' % code
635 code = 'bitsToFloat64(%s)' % code
636 return '%s = %s;\n' % (self.base_name, code)
977 error('Attempt to read condition-code register as FP')
994 error('Attempt to write condition-code register as FP')
1128 '''Find all the operands in the given code block. Returns an operand
1130 def __init__(self, parser, code):
1135 code = regEx.sub('', code)
1139 match = parser.operandsRE.search(code, next_pos)
1156 is_dest = (assignRE.match(code, match.end()) != None)
1298 '''Find all the operands in the given code block. Returns an operand
1300 def __init__(self, parser, code, master_list):
1305 code = regEx.sub('', code)
1309 match = parser.operandsRE.search(code, next_pos)
1383 # findOperands()). If the code immediately following the first
1404 code = pre + string.join(flag_list, post + pre) + post
1405 return code
1420 snippets = {'code' : snippets}
1526 # minimum of disruption to existing increment code.
1608 # Get the file object for emitting code into the specified section
1781 # code literal
1996 # Output blocks 'output <foo> {{...}}' (C++ code blocks) are copied
2012 # global let blocks 'let {{...}}' (Python code blocks) are
2014 # special variable context 'exportContext' to prevent the code
2035 # (e.g.) "split('exec')" in the Python code and the split #ifdef's
2137 (id, params, code) = (t[3], t[5], t[7])
2138 self.defFormat(id, params, code, t.lexer.lineno)
2275 # code streams. This works well for ifdefs, so we can ifdef out
2279 # the code generated by the other statements.
2315 # just wrap the decoding code from the block as a case in the
2495 def defFormat(self, id, params, code, lineno):
2503 self.formatMap[id] = Format(id, params, code)
2615 def substMungedOpNames(self, code):
2616 '''Munge operand names in code string to make legal C++
2619 return self.operandsWithExtRE.sub(r'\1', code)
2622 '''Fix up code snippets for final substitution in templates.'''
2687 # the files it expects (in src/arch/$ARCH/generated). This code
2689 # invocations just expect different things. Since this code runs