Deleted Added
sdiff udiff text old ( 4323:13ca4002d2ac ) new ( 4336:bd6ab22f8e11 )
full compact
1// -*- mode:c++ -*-
2
3// Copyright (c) 2007 The Hewlett-Packard Development Company
4// All rights reserved.
5//
6// Redistribution and use of this software in source and binary forms,
7// with or without modification, are permitted provided that the
8// following conditions are met:

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

56// Authors: Gabe Black
57
58////////////////////////////////////////////////////////////////////
59//
60// Instructions that do the same thing to multiple sets of arguments.
61//
62
63let {{
64 def doInst(name, Name, opTypeSet):
65 if not instDict.has_key(Name):
66 raise Exception, "Unrecognized instruction: %s" % Name
67 inst = instDict[Name]()
68 return inst.emit(opTypeSet)
69}};
70
71def format Inst(*opTypeSet) {{
72 (header_output,
73 decoder_output,
74 decode_block,
75 exec_output) = doInst(name, Name, list(opTypeSet))
76}};
77
78def format MultiInst(switchVal, *opTypeSets) {{
79 switcher = {}
80 for (count, opTypeSet) in zip(xrange(len(opTypeSets)), opTypeSets):
81 switcher[count] = (opTypeSet,)
82 (header_output,
83 decoder_output,
84 decode_block,
85 exec_output) = doSplitDecode(name, Name, doInst, switchVal, switcher)
86}};