1// -*- mode:c++ -*- 2 3// Copyright (c) 2003-2005 The Regents of The University of Michigan 4// All rights reserved. 5// 6// Redistribution and use in source and binary forms, with or without 7// modification, are permitted provided that the following conditions are 8// met: redistributions of source code must retain the above copyright --- 99 unchanged lines hidden (view full) --- 108 # rewrite by substituting 'Rb' for 'Rb_or_imm' 109 code = re.sub(r'Rb_or_imm', 'Rb', orig_code) 110 # generate immediate version by substituting 'imm' 111 # note that imm takes no extenstion, so we extend 112 # the regexp to replace any extension as well 113 imm_code = re.sub(r'Rb_or_imm(\.\w+)?', 'imm', orig_code) 114 115 # generate declaration for register version |
116 iop = InstObjParams(name, Name, 'AlphaStaticInst', code, opt_flags) |
117 header_output = BasicDeclare.subst(iop) 118 decoder_output = BasicConstructor.subst(iop) 119 exec_output = BasicExecute.subst(iop) 120 121 if uses_imm: 122 # append declaration for imm version |
123 imm_iop = InstObjParams(name, Name + 'Imm', 'IntegerImm', imm_code, |
124 opt_flags) 125 header_output += BasicDeclare.subst(imm_iop) 126 decoder_output += BasicConstructor.subst(imm_iop) 127 exec_output += BasicExecute.subst(imm_iop) 128 # decode checks IMM bit to pick correct version 129 decode_block = RegOrImmDecode.subst(iop) 130 else: 131 # no imm version: just check for nop 132 decode_block = OperateNopCheckDecode.subst(iop) 133}}; |