swap.isa (4040:eb894f3fc168) swap.isa (4350:c3f402102507)
1// Copyright (c) 2007 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

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

132def format Swap(code, postacc_code, mem_flags, *opt_flags) {{
133 mem_flags = makeList(mem_flags)
134 flags = string.join(mem_flags, '|')
135
136 (header_output,
137 decoder_output,
138 exec_output,
139 decode_block) = doMemFormat(code, SwapFuncs, '', name, Name, flags,
1// Copyright (c) 2007 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

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

132def format Swap(code, postacc_code, mem_flags, *opt_flags) {{
133 mem_flags = makeList(mem_flags)
134 flags = string.join(mem_flags, '|')
135
136 (header_output,
137 decoder_output,
138 exec_output,
139 decode_block) = doMemFormat(code, SwapFuncs, '', name, Name, flags,
140 opt_flags, postacc_code)
140 ["IsStoreConditional"], postacc_code)
141}};
142
143def format SwapAlt(code, postacc_code, asi, mem_flags, *opt_flags) {{
144 mem_flags = makeList(mem_flags)
145 mem_flags.append(asi)
146 flags = string.join(mem_flags, '|')
147 (header_output,
148 decoder_output,
149 exec_output,
150 decode_block) = doMemFormat(code, SwapFuncs, AlternateASIPrivFaultCheck,
141}};
142
143def format SwapAlt(code, postacc_code, asi, mem_flags, *opt_flags) {{
144 mem_flags = makeList(mem_flags)
145 mem_flags.append(asi)
146 flags = string.join(mem_flags, '|')
147 (header_output,
148 decoder_output,
149 exec_output,
150 decode_block) = doMemFormat(code, SwapFuncs, AlternateASIPrivFaultCheck,
151 name, Name, flags, opt_flags, postacc_code)
151 name, Name, flags, ["IsStoreConditional"], postacc_code)
152}};
153
154
155let {{
156 def doCasFormat(code, execute, faultCode, name, Name, asi, opt_flags, postacc_code = ''):
157 addrCalcReg = 'EA = Rs1;'
158 iop = InstObjParams(name, Name, 'Mem',
159 {"code": code, "postacc_code" : postacc_code,
160 "fault_check": faultCode, "ea_code": addrCalcReg}, opt_flags)
161 header_output = MemDeclare.subst(iop)
162 decoder_output = BasicConstructor.subst(iop)
163 decode_block = BasicDecode.subst(iop)
164 microParams = {"code": code, "postacc_code" : postacc_code,
165 "ea_code" : addrCalcReg, "fault_check" : faultCode}
152}};
153
154
155let {{
156 def doCasFormat(code, execute, faultCode, name, Name, asi, opt_flags, postacc_code = ''):
157 addrCalcReg = 'EA = Rs1;'
158 iop = InstObjParams(name, Name, 'Mem',
159 {"code": code, "postacc_code" : postacc_code,
160 "fault_check": faultCode, "ea_code": addrCalcReg}, opt_flags)
161 header_output = MemDeclare.subst(iop)
162 decoder_output = BasicConstructor.subst(iop)
163 decode_block = BasicDecode.subst(iop)
164 microParams = {"code": code, "postacc_code" : postacc_code,
165 "ea_code" : addrCalcReg, "fault_check" : faultCode}
166 exec_output = doSplitExecute(execute, name, Name, asi, opt_flags,
167 microParams);
166 exec_output = doSplitExecute(execute, name, Name, asi,
167 ["IsStoreConditional"], microParams);
168 return (header_output, decoder_output, exec_output, decode_block)
169}};
170
171
172def format CasAlt(code, postacc_code, asi, mem_flags, *opt_flags) {{
173 mem_flags = makeList(mem_flags)
174 mem_flags.append(asi)
175 flags = string.join(mem_flags, '|')
176 (header_output,
177 decoder_output,
178 exec_output,
179 decode_block) = doCasFormat(code, SwapFuncs, AlternateASIPrivFaultCheck,
168 return (header_output, decoder_output, exec_output, decode_block)
169}};
170
171
172def format CasAlt(code, postacc_code, asi, mem_flags, *opt_flags) {{
173 mem_flags = makeList(mem_flags)
174 mem_flags.append(asi)
175 flags = string.join(mem_flags, '|')
176 (header_output,
177 decoder_output,
178 exec_output,
179 decode_block) = doCasFormat(code, SwapFuncs, AlternateASIPrivFaultCheck,
180 name, Name, flags, opt_flags, postacc_code)
180 name, Name, flags, ["IsStoreConditional"], postacc_code)
181}};
182
183
181}};
182
183