decoder.isa revision 6076
12SN/A// Copyright (c) 2007 The Hewlett-Packard Development Company
21762SN/A// All rights reserved.
32SN/A//
42SN/A// Redistribution and use of this software in source and binary forms,
52SN/A// with or without modification, are permitted provided that the
62SN/A// following conditions are met:
72SN/A//
82SN/A// The software must be used only for Non-Commercial Use which means any
92SN/A// use which is NOT directed to receiving any direct monetary
102SN/A// compensation for, or commercial advantage from such use.  Illustrative
112SN/A// examples of non-commercial use are academic research, personal study,
122SN/A// teaching, education and corporate research & development.
132SN/A// Illustrative examples of commercial use are distributing products for
142SN/A// commercial advantage and providing services using the software for
152SN/A// commercial advantage.
162SN/A//
172SN/A// If you wish to use this software or functionality therein that may be
182SN/A// covered by patents for commercial use, please contact:
192SN/A//     Director of Intellectual Property Licensing
202SN/A//     Office of Strategy and Technology
212SN/A//     Hewlett-Packard Company
222SN/A//     1501 Page Mill Road
232SN/A//     Palo Alto, California  94304
242SN/A//
252SN/A// Redistributions of source code must retain the above copyright notice,
262SN/A// this list of conditions and the following disclaimer.  Redistributions
272665SN/A// in binary form must reproduce the above copyright notice, this list of
282665SN/A// conditions and the following disclaimer in the documentation and/or
292SN/A// other materials provided with the distribution.  Neither the name of
302SN/A// the COPYRIGHT HOLDER(s), HEWLETT-PACKARD COMPANY, nor the names of its
312SN/A// contributors may be used to endorse or promote products derived from
322SN/A// this software without specific prior written permission.  No right of
336214Snate@binkert.org// sublicense is granted herewith.  Derivatives of the software and
342SN/A// output created using the software may be prepared, but only for
352SN/A// Non-Commercial Uses.  Derivatives of the software may be shared with
362SN/A// others provided: (i) the others agree to abide by the list of
376214Snate@binkert.org// conditions herein which includes the Non-Commercial Use restrictions;
386214Snate@binkert.org// and (ii) such Derivatives of the software include the above copyright
392SN/A// notice to acknowledge the contribution from this software where
402SN/A// applicable, this list of conditions and the disclaimer below.
412SN/A//
429180Sandreas.hansson@arm.com// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
439180Sandreas.hansson@arm.com// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
442SN/A// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
455543SN/A// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
462SN/A// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
475543SN/A// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
482SN/A// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
492SN/A// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
502SN/A// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
512SN/A// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
522SN/A// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
532SN/A//
542SN/A// Authors: Gabe Black
552SN/A
569158Sandreas.hansson@arm.com////////////////////////////////////////////////////////////////////
572SN/A//
589158Sandreas.hansson@arm.com// The actual decoder specification
592SN/A//
609158Sandreas.hansson@arm.com
612667SN/Adecode OPCODE_NUM default Unknown::unknown()
622130SN/A{
639180Sandreas.hansson@arm.com    0x0: M5InternalError::error(
649180Sandreas.hansson@arm.com        {{"Saw an ExtMachInst with zero opcode bytes!"}});
659180Sandreas.hansson@arm.com    //1 byte opcodes
669180Sandreas.hansson@arm.com    ##include "one_byte_opcodes.isa"
679180Sandreas.hansson@arm.com    //2 byte opcodes
689180Sandreas.hansson@arm.com    ##include "two_byte_opcodes.isa"
699180Sandreas.hansson@arm.com    //3 byte opcodes
709180Sandreas.hansson@arm.com    0x3: decode OPCODE_PREFIXA {
719180Sandreas.hansson@arm.com        0xF0: decode OPCODE_PREFIXB {
729180Sandreas.hansson@arm.com            //We don't handle these properly in the predecoder yet, so there's
739180Sandreas.hansson@arm.com            //no reason to implement them for now.
749180Sandreas.hansson@arm.com            0x38: decode OPCODE_OP {
759180Sandreas.hansson@arm.com                default: FailUnimpl::sseThreeEight();
769180Sandreas.hansson@arm.com            }
779180Sandreas.hansson@arm.com            0x3A: decode OPCODE_OP {
789180Sandreas.hansson@arm.com                default: FailUnimpl::sseThreeA();
799180Sandreas.hansson@arm.com            }
809180Sandreas.hansson@arm.com            0xF0: decode OPCODE_OP {
819180Sandreas.hansson@arm.com                default: FailUnimpl::threednow();
829180Sandreas.hansson@arm.com            }
839180Sandreas.hansson@arm.com            default: M5InternalError::error(
849180Sandreas.hansson@arm.com                {{"Unexpected second opcode byte in three byte opcode!"}});
859180Sandreas.hansson@arm.com        }
869180Sandreas.hansson@arm.com        default: M5InternalError::error(
879180Sandreas.hansson@arm.com            {{"Unexpected first opcode byte in three byte opcode!"}});
889180Sandreas.hansson@arm.com    }
899180Sandreas.hansson@arm.com}
909180Sandreas.hansson@arm.com