mem.isa (6305:e518d78b2ed1) mem.isa (6307:067515d22824)
1// -*- mode:c++ -*-
2
3// Copyright (c) 2007-2008 The Florida State University
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

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

271 code = ("%s = Rd;", "Rd = %s;")[l] % mem
272 ea_code = "EA = Rn %s;" % ("", offset)[p]
273 if p == 0 or w == 1:
274 code += "Rn = Rn %s;" % offset
275 if p == 0 and w == 0:
276 # Here's where we'll tack on a flag to make this a usermode access.
277 mnem += "t"
278 type = ("Store", "Load")[l]
1// -*- mode:c++ -*-
2
3// Copyright (c) 2007-2008 The Florida State University
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

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

271 code = ("%s = Rd;", "Rd = %s;")[l] % mem
272 ea_code = "EA = Rn %s;" % ("", offset)[p]
273 if p == 0 or w == 1:
274 code += "Rn = Rn %s;" % offset
275 if p == 0 and w == 0:
276 # Here's where we'll tack on a flag to make this a usermode access.
277 mnem += "t"
278 type = ("Store", "Load")[l]
279 suffix = "_%s_P%dU%dB%dW%d" % (suffix, p, u, b, w)
279 newSuffix = "_%s_P%dU%dB%dW%d" % (suffix, p, u, b, w)
280 if b == 1:
281 mnem += "b"
280 if b == 1:
281 mnem += "b"
282 return LoadStoreBase(mnem, mnem.capitalize() + suffix,
282 return LoadStoreBase(mnem, mnem.capitalize() + newSuffix,
283 ea_code, code, mem_flags = [], inst_flags = [],
283 ea_code, code, mem_flags = [], inst_flags = [],
284 base_class = 'Memory' + suffix,
284 exec_template_base = type.capitalize())
285
286 def buildMode3Inst(p, u, i, w, type, code, mnem):
287 op = ("-", "+")[u]
288 offset = ("%s Rm", "%s hilo")[i] % op
289 ea_code = "EA = Rn %s;" % ("", offset)[p]
290 if p == 0 or w == 1:
291 code += "Rn = Rn %s;" % offset
285 exec_template_base = type.capitalize())
286
287 def buildMode3Inst(p, u, i, w, type, code, mnem):
288 op = ("-", "+")[u]
289 offset = ("%s Rm", "%s hilo")[i] % op
290 ea_code = "EA = Rn %s;" % ("", offset)[p]
291 if p == 0 or w == 1:
292 code += "Rn = Rn %s;" % offset
292 suffix = "_P%dU%dI%dW%d" % (p, u, i, w)
293 return LoadStoreBase(mnem, mnem.capitalize() + suffix,
293 newSuffix = "_P%dU%dI%dW%d" % (p, u, i, w)
294 suffix = ("Reg", "Hilo")[i]
295 return LoadStoreBase(mnem, mnem.capitalize() + newSuffix,
294 ea_code, code, mem_flags = [], inst_flags = [],
296 ea_code, code, mem_flags = [], inst_flags = [],
297 base_class = 'Memory' + suffix,
295 exec_template_base = type.capitalize())
296}};
297
298def format AddrMode2(suffix, offset) {{
299 header_output = decoder_output = exec_output = ""
300 decode_block = "switch(PUBWL) {\n"
301
302 # Loop over all the values of p, u, b, w and l and build instructions and

--- 85 unchanged lines hidden ---
298 exec_template_base = type.capitalize())
299}};
300
301def format AddrMode2(suffix, offset) {{
302 header_output = decoder_output = exec_output = ""
303 decode_block = "switch(PUBWL) {\n"
304
305 # Loop over all the values of p, u, b, w and l and build instructions and

--- 85 unchanged lines hidden ---