registers.hh revision 6329
12459SN/A/*
22459SN/A * Copyright (c) 2003-2005 The Regents of The University of Michigan
32459SN/A * All rights reserved.
42459SN/A *
52459SN/A * Redistribution and use in source and binary forms, with or without
62459SN/A * modification, are permitted provided that the following conditions are
72459SN/A * met: redistributions of source code must retain the above copyright
82459SN/A * notice, this list of conditions and the following disclaimer;
92459SN/A * redistributions in binary form must reproduce the above copyright
102459SN/A * notice, this list of conditions and the following disclaimer in the
112459SN/A * documentation and/or other materials provided with the distribution;
122459SN/A * neither the name of the copyright holders nor the names of its
132459SN/A * contributors may be used to endorse or promote products derived from
142459SN/A * this software without specific prior written permission.
152459SN/A *
162459SN/A * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
172459SN/A * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
182459SN/A * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
192459SN/A * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
202459SN/A * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
212459SN/A * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
222459SN/A * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
232459SN/A * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
242459SN/A * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
252459SN/A * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
262459SN/A * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
272665SN/A *
282665SN/A * Authors: Gabe Black
292665SN/A *          Ali Saidi
302459SN/A */
312459SN/A
326329Sgblack@eecs.umich.edu#ifndef __ARCH_SPARC_REGISTERS_HH__
336329Sgblack@eecs.umich.edu#define __ARCH_SPARC_REGISTERS_HH__
342459SN/A
356329Sgblack@eecs.umich.edu#include "arch/sparc/max_inst_regs.hh"
366329Sgblack@eecs.umich.edu#include "arch/sparc/miscregs.hh"
376320SN/A#include "arch/sparc/sparc_traits.hh"
386329Sgblack@eecs.umich.edu#include "base/types.hh"
392459SN/A
402459SN/Anamespace SparcISA
412459SN/A{
426329Sgblack@eecs.umich.edu    using SparcISAInst::MaxInstSrcRegs;
436329Sgblack@eecs.umich.edu    using SparcISAInst::MaxInstDestRegs;
446329Sgblack@eecs.umich.edu
456329Sgblack@eecs.umich.edu    typedef uint64_t IntReg;
466329Sgblack@eecs.umich.edu    typedef uint64_t MiscReg;
476329Sgblack@eecs.umich.edu    typedef float FloatReg;
486329Sgblack@eecs.umich.edu    typedef uint32_t FloatRegBits;
496329Sgblack@eecs.umich.edu    typedef union
506329Sgblack@eecs.umich.edu    {
516329Sgblack@eecs.umich.edu        IntReg intReg;
526329Sgblack@eecs.umich.edu        FloatReg fpreg;
536329Sgblack@eecs.umich.edu        MiscReg ctrlreg;
546329Sgblack@eecs.umich.edu    } AnyReg;
556329Sgblack@eecs.umich.edu
566329Sgblack@eecs.umich.edu    typedef uint16_t RegIndex;
576329Sgblack@eecs.umich.edu
586329Sgblack@eecs.umich.edu    // These enumerate all the registers for dependence tracking.
596329Sgblack@eecs.umich.edu    enum DependenceTags {
606329Sgblack@eecs.umich.edu        FP_Base_DepTag = 32*3+9,
616329Sgblack@eecs.umich.edu        Ctrl_Base_DepTag = FP_Base_DepTag + 64
626329Sgblack@eecs.umich.edu    };
636329Sgblack@eecs.umich.edu
646329Sgblack@eecs.umich.edu    // semantically meaningful register indices
656329Sgblack@eecs.umich.edu    const int ZeroReg = 0;      // architecturally meaningful
666329Sgblack@eecs.umich.edu    // the rest of these depend on the ABI
676329Sgblack@eecs.umich.edu    const int ReturnAddressReg = 31; // post call, precall is 15
686329Sgblack@eecs.umich.edu    const int ReturnValueReg = 8;  // Post return, 24 is pre-return.
696329Sgblack@eecs.umich.edu    const int StackPointerReg = 14;
706329Sgblack@eecs.umich.edu    const int FramePointerReg = 30;
716329Sgblack@eecs.umich.edu
726329Sgblack@eecs.umich.edu    // Some OS syscall use a second register (o1) to return a second value
736329Sgblack@eecs.umich.edu    const int SyscallPseudoReturnReg = 9;
746329Sgblack@eecs.umich.edu
756320SN/A    const int NumIntArchRegs = 32;
766320SN/A    const int NumIntRegs = (MaxGL + 1) * 8 + NWindows * 16 + NumMicroIntRegs;
776320SN/A
782459SN/A} // namespace SparcISA
792459SN/A
802459SN/A#endif
81