multi.isa (4371:c5003760793e) | multi.isa (4528:f0b19ee67a7b) |
---|---|
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: --- 46 unchanged lines hidden (view full) --- 55// 56// Authors: Gabe Black 57 58//////////////////////////////////////////////////////////////////// 59// 60// Instructions that do the same thing to multiple sets of arguments. 61// 62 | 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: --- 46 unchanged lines hidden (view full) --- 55// 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) {{ | 63def format Inst(*opTypeSet) {{ |
72 (header_output, 73 decoder_output, 74 decode_block, 75 exce_output) = doInst(name, Name, list(opTypeSet)).makeList() | 64 decode_block = specializeInst(Name, list(opTypeSet), EmulEnv()) |
76}}; 77 78def format MultiInst(switchVal, *opTypeSets) {{ 79 switcher = {} 80 for (count, opTypeSet) in zip(xrange(len(opTypeSets)), opTypeSets): | 65}}; 66 67def format MultiInst(switchVal, *opTypeSets) {{ 68 switcher = {} 69 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).makeList() | 70 switcher[count] = (opTypeSet, EmulEnv()) 71 decode_block = doSplitDecode(Name, specializeInst, switchVal, switcher) |
86}}; | 72}}; |