112289Sgabeblack@google.com// Copyright (c) 2006-2007 The Regents of The University of Michigan
212289Sgabeblack@google.com// All rights reserved.
312289Sgabeblack@google.com//
412289Sgabeblack@google.com// Redistribution and use in source and binary forms, with or without
512289Sgabeblack@google.com// modification, are permitted provided that the following conditions are
612289Sgabeblack@google.com// met: redistributions of source code must retain the above copyright
712289Sgabeblack@google.com// notice, this list of conditions and the following disclaimer;
812289Sgabeblack@google.com// redistributions in binary form must reproduce the above copyright
912289Sgabeblack@google.com// notice, this list of conditions and the following disclaimer in the
1012289Sgabeblack@google.com// documentation and/or other materials provided with the distribution;
1112289Sgabeblack@google.com// neither the name of the copyright holders nor the names of its
1212289Sgabeblack@google.com// contributors may be used to endorse or promote products derived from
1312289Sgabeblack@google.com// this software without specific prior written permission.
1412289Sgabeblack@google.com//
1512289Sgabeblack@google.com// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
1612289Sgabeblack@google.com// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
1712289Sgabeblack@google.com// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
1812289Sgabeblack@google.com// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
1912289Sgabeblack@google.com// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
2012289Sgabeblack@google.com// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
2112289Sgabeblack@google.com// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
2212289Sgabeblack@google.com// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
2312289Sgabeblack@google.com// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
2412289Sgabeblack@google.com// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
2512289Sgabeblack@google.com// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2612289Sgabeblack@google.com//
2712289Sgabeblack@google.com// Authors: Gabe Black
2812289Sgabeblack@google.com//          Steve Reinhardt
2912289Sgabeblack@google.com
3012289Sgabeblack@google.com////////////////////////////////////////////////////////////////////
3112289Sgabeblack@google.com//
3212289Sgabeblack@google.com// Nop instruction
3312289Sgabeblack@google.com//
3412289Sgabeblack@google.com
3512289Sgabeblack@google.com// Per-cpu-model nop execute method.
3612289Sgabeblack@google.comdef template NopExec {{
3712289Sgabeblack@google.com}};
3812289Sgabeblack@google.com
3912289Sgabeblack@google.comoutput header {{
4012289Sgabeblack@google.com        /**
4112289Sgabeblack@google.com         * Nop class.
4212289Sgabeblack@google.com         */
4312289Sgabeblack@google.com        class Nop : public SparcStaticInst
4412289Sgabeblack@google.com        {
4512289Sgabeblack@google.com          public:
4612289Sgabeblack@google.com            // Constructor
4712289Sgabeblack@google.com            Nop(const char *mnem, ExtMachInst _machInst, OpClass __opClass) :
4812289Sgabeblack@google.com                SparcStaticInst(mnem, _machInst, __opClass)
4912289Sgabeblack@google.com            {
5012289Sgabeblack@google.com                flags[IsNop] = true;
5112289Sgabeblack@google.com            }
5212289Sgabeblack@google.com
5312289Sgabeblack@google.com            Fault
5412289Sgabeblack@google.com            execute(ExecContext *xc, Trace::InstRecord *traceData) const
5512289Sgabeblack@google.com            {
5612289Sgabeblack@google.com                return NoFault;
5712289Sgabeblack@google.com            }
5812289Sgabeblack@google.com
5912289Sgabeblack@google.com            std::string generateDisassembly(Addr pc,
6012616Sgabeblack@google.com                    const SymbolTable *symtab) const override;
6112289Sgabeblack@google.com        };
6212289Sgabeblack@google.com}};
6312289Sgabeblack@google.com
6412289Sgabeblack@google.comoutput decoder {{
6512289Sgabeblack@google.com        std::string Nop::generateDisassembly(Addr pc,
6612289Sgabeblack@google.com                const SymbolTable *symtab) const
6712289Sgabeblack@google.com        {
6812289Sgabeblack@google.com            std::stringstream response;
6912289Sgabeblack@google.com            printMnemonic(response, mnemonic);
7012289Sgabeblack@google.com            return response.str();
7112289Sgabeblack@google.com        }
7212289Sgabeblack@google.com}};
7312289Sgabeblack@google.com
7412289Sgabeblack@google.comdef template NopExecute {{
7512289Sgabeblack@google.com        Fault %(class_name)s::execute(ExecContext *xc,
7612289Sgabeblack@google.com                Trace::InstRecord *traceData) const
7712289Sgabeblack@google.com        {
7812289Sgabeblack@google.com            // Nothing to see here, move along
7912289Sgabeblack@google.com            return NoFault;
8012289Sgabeblack@google.com        }
8112289Sgabeblack@google.com}};
8212289Sgabeblack@google.com
8312289Sgabeblack@google.com// Primary format for integer operate instructions:
8412289Sgabeblack@google.comdef format Nop(code, *opt_flags) {{
8512289Sgabeblack@google.com        iop = InstObjParams(name, Name, 'Nop', code, opt_flags)
8612289Sgabeblack@google.com        header_output = BasicDeclare.subst(iop)
8712289Sgabeblack@google.com        decoder_output = BasicConstructor.subst(iop)
8812289Sgabeblack@google.com        decode_block = BasicDecode.subst(iop)
8912289Sgabeblack@google.com        exec_output = NopExecute.subst(iop)
9012289Sgabeblack@google.com}};
91