base.isa (4679:0b39fa8f5eb8) base.isa (5040:126e4510b5bb)
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:

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

64//////////////////////////////////////////////////////////////////////////
65//
66// Base class for the python representation of x86 microops
67//
68//////////////////////////////////////////////////////////////////////////
69
70let {{
71 class X86Microop(object):
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:

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

64//////////////////////////////////////////////////////////////////////////
65//
66// Base class for the python representation of x86 microops
67//
68//////////////////////////////////////////////////////////////////////////
69
70let {{
71 class X86Microop(object):
72
72 def __init__(self, name):
73 self.name = name
74
75 # This converts a python bool into a C++ bool
76 def cppBool(self, val):
77 if val:
78 return "true"
79 else:
80 return "false"
81
82 # This converts a list of python bools into
83 # a comma seperated list of C++ bools.
84 def microFlagsText(self, vals):
85 text = ""
86 for val in vals:
87 text += ", %s" % self.cppBool(val)
88 return text
89
90 def getAllocator(self, mnemonic, *microFlags):
73 def __init__(self, name):
74 self.name = name
75
76 # This converts a python bool into a C++ bool
77 def cppBool(self, val):
78 if val:
79 return "true"
80 else:
81 return "false"
82
83 # This converts a list of python bools into
84 # a comma seperated list of C++ bools.
85 def microFlagsText(self, vals):
86 text = ""
87 for val in vals:
88 text += ", %s" % self.cppBool(val)
89 return text
90
91 def getAllocator(self, mnemonic, *microFlags):
91 return 'new %s(machInst, %s)' % (self.className, mnemonic, self.microFlagsText(microFlags))
92 return 'new %s(machInst, %s)' % \
93 (self.className, mnemonic, self.microFlagsText(microFlags))
92}};
93
94//////////////////////////////////////////////////////////////////////////
95//
96// FpOp Microop templates
97//
98//////////////////////////////////////////////////////////////////////////
99
100//TODO Actually write an fp microop base class.
94}};
95
96//////////////////////////////////////////////////////////////////////////
97//
98// FpOp Microop templates
99//
100//////////////////////////////////////////////////////////////////////////
101
102//TODO Actually write an fp microop base class.