Deleted Added
sdiff udiff text old ( 3980:9bcb2a2e9bb8 ) new ( 5093:7f20bc69fda5 )
full compact
1// Copyright (c) 2006-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

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

282
283 calcCcCode = '''
284 uint16_t _ic, _iv, _iz, _in, _xc, _xv, _xz, _xn;
285
286 _in = (Rd >> 31) & 1;
287 _iz = ((Rd & 0xFFFFFFFF) == 0);
288 _xn = (Rd >> 63) & 1;
289 _xz = (Rd == 0);
290 _iv = %(ivValue)s & 1;
291 _ic = %(icValue)s & 1;
292 _xv = %(xvValue)s & 1;
293 _xc = %(xcValue)s & 1;
294
295 Ccr = _ic << 0 | _iv << 1 | _iz << 2 | _in << 3 |
296 _xc << 4 | _xv << 5 | _xz << 6 | _xn << 7;
297
298
299 DPRINTF(Sparc, "in = %%d\\n", _in);
300 DPRINTF(Sparc, "iz = %%d\\n", _iz);
301 DPRINTF(Sparc, "xn = %%d\\n", _xn);
302 DPRINTF(Sparc, "xz = %%d\\n", _xz);
303 DPRINTF(Sparc, "iv = %%d\\n", _iv);
304 DPRINTF(Sparc, "ic = %%d\\n", _ic);
305 DPRINTF(Sparc, "xv = %%d\\n", _xv);
306 DPRINTF(Sparc, "xc = %%d\\n", _xc);
307 '''
308}};
309
310// Primary format for integer operate instructions:
311def format IntOp(code, *opt_flags) {{
312 ccCode = ''
313 (header_output,
314 decoder_output,
315 exec_output,
316 decode_block) = doIntFormat(code, ccCode,
317 name, Name, opt_flags)
318}};
319
320// Primary format for integer operate instructions:
321def format IntOpCc(code, icValue, ivValue, xcValue, xvValue, *opt_flags) {{
322 ccCode = calcCcCode % vars()
323 (header_output,
324 decoder_output,
325 exec_output,
326 decode_block) = doIntFormat(code, ccCode,
327 name, Name, opt_flags)
328}};
329
330// Primary format for integer operate instructions:
331def format IntOpCcRes(code, *opt_flags) {{
332 ccCode = calcCcCode % {"icValue":"0",
333 "ivValue":"0",
334 "xcValue":"0",
335 "xvValue":"0"}
336 (header_output,
337 decoder_output,
338 exec_output,
339 decode_block) = doIntFormat(code, ccCode,
340 name, Name, opt_flags)
341}};
342
343def format SetHi(code, *opt_flags) {{
344 iop = InstObjParams(name, Name, 'SetHi',
345 {"code": code, "cc_code": ''}, opt_flags)
346 header_output = BasicDeclare.subst(iop)
347 decoder_output = BasicConstructor.subst(iop)
348 exec_output = IntOpExecute.subst(iop)
349 decode_block = SetHiDecode.subst(iop)
350}};
351