1// -*- mode:c++ -*- 2 3// Copyright (c) 2006 The Regents of The University of Michigan 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 --- 74 unchanged lines hidden (view full) --- 83 decode_template.subst(iop), 84 EACompExecute.subst(ea_iop) 85 + memAccExecTemplate.subst(memacc_iop) 86 + fullExecTemplate.subst(iop) 87 + initiateAccTemplate.subst(iop) 88 + completeAccTemplate.subst(iop)) 89}}; 90 |
91output header {{ 92 std::string inst2string(MachInst machInst); 93}}; 94 95output decoder {{ 96 97std::string inst2string(MachInst machInst) 98{ |
99 string str = ""; |
100 uint32_t mask = 0x80000000; 101 102 for(int i=0; i < 32; i++) { 103 if ((machInst & mask) == 0) { 104 str += "0"; 105 } else { 106 str += "1"; 107 } 108 109 mask = mask >> 1; 110 } 111 112 return str; 113} 114 115}}; |