Merge ktlim@zizzer:/bk/newmem
[gem5.git] / src / arch / mips / isa / formats / int.isa
index 99aee828f2a70447dbbc450864093b293a03c7ed..2f131f6d9676ff5d9fa6dde3f40f4fcc3d767a87 100644 (file)
@@ -1,12 +1,39 @@
 // -*- mode:c++ -*-
 
+// Copyright (c) 2006 The Regents of The University of Michigan
+// All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met: redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer;
+// redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution;
+// neither the name of the copyright holders nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//
+// Authors: Korey Sewell
+
 ////////////////////////////////////////////////////////////////////
 //
 // Integer operate instructions
 //
 output header {{
 #include <iostream>
-    using namespace std;
         /**
          * Base class for integer operations.
          */
@@ -197,43 +224,38 @@ output decoder {{
 }};
 
 def format IntOp(code, *opt_flags) {{
-    iop = InstObjParams(name, Name, 'IntOp', CodeBlock(code), opt_flags)
+    iop = InstObjParams(name, Name, 'IntOp', code, opt_flags)
     header_output = BasicDeclare.subst(iop)
     decoder_output = BasicConstructor.subst(iop)
-    decode_block = OperateNopCheckDecode.subst(iop)
+    decode_block = RegNopCheckDecode.subst(iop)
     exec_output = BasicExecute.subst(iop)
 }};
 
 def format IntImmOp(code, *opt_flags) {{
-    iop = InstObjParams(name, Name, 'IntImmOp', CodeBlock(code), opt_flags)
+    iop = InstObjParams(name, Name, 'IntImmOp', code, opt_flags)
     header_output = BasicDeclare.subst(iop)
     decoder_output = BasicConstructor.subst(iop)
-    decode_block = OperateNopCheckDecode.subst(iop)
+    decode_block = ImmNopCheckDecode.subst(iop)
     exec_output = BasicExecute.subst(iop)
 }};
 
 def format HiLoOp(code, *opt_flags) {{
-    if '.sd' in code:
-        code = 'int64_t ' + code
-    elif '.ud' in code:
-        code = 'uint64_t ' + code
-
     code += 'HI = val<63:32>;\n'
     code += 'LO = val<31:0>;\n'
 
-    iop = InstObjParams(name, Name, 'HiLoOp', CodeBlock(code), opt_flags)
+    iop = InstObjParams(name, Name, 'HiLoOp', code, opt_flags)
     header_output = BasicDeclare.subst(iop)
     decoder_output = BasicConstructor.subst(iop)
-    decode_block = OperateNopCheckDecode.subst(iop)
+    decode_block = BasicDecode.subst(iop)
     exec_output = HiLoExecute.subst(iop)
 }};
 
 def format HiLoMiscOp(code, *opt_flags) {{
-    iop = InstObjParams(name, Name, 'HiLoMiscOp', CodeBlock(code), opt_flags)
+    iop = InstObjParams(name, Name, 'HiLoMiscOp', code, opt_flags)
     header_output = BasicDeclare.subst(iop)
     decoder_output = BasicConstructor.subst(iop)
-    decode_block = OperateNopCheckDecode.subst(iop)
-    exec_output = HiLoExecute.subst(iop)
+    decode_block = BasicDecode.subst(iop)
+    exec_output = BasicExecute.subst(iop)
 }};