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: --- 49 unchanged lines hidden (view full) --- 58//The operand types a microop template can be specialized with 59output header {{ 60 enum OperandType { 61 RegisterOperand, 62 ImmediateOperand 63 }; 64}}; 65 |
66//A class which is the base of all x86 micro ops. It provides a function to |
67//set necessary flags appropriately. 68output header {{ 69 class X86MicroOpBase : public X86StaticInst 70 { 71 protected: 72 uint8_t opSize; 73 uint8_t addrSize; 74 --- 17 unchanged lines hidden (view full) --- 92// behavior in microops. 93def template BaseMicroOpTemplateDeclare {{ 94 template%(signature)s 95 class %(class_name)s; 96}}; 97 98let {{ 99 def buildBaseMicroOpTemplate(Name, numParams): |
100 assert(numParams > 0) |
101 signature = "<" 102 signature += "int SignatureOperandTypeSpecifier0" 103 for count in xrange(1,numParams): 104 signature += \ 105 ", int SingatureOperandTypeSpecifier%d" % count 106 signature += ">" 107 subs = {"signature" : signature, "class_name" : Name} 108 return BaseMicroOpTemplateDeclare.subst(subs) |
109}}; |
110 |
111let {{ |
112 def buildMicroOpTemplateDict(*params): 113 signature = "<" 114 if len(params): 115 signature += params[0] 116 if len(params) > 1: 117 for param in params[1:]: 118 signature += ", %s" % param 119 signature += ">" --- 56 unchanged lines hidden --- |