src/cpu/zero/vm/register_zero.hpp

Print this page


   1 /*
   2  * Copyright (c) 2000, 2007, Oracle and/or its affiliates. All rights reserved.
   3  * Copyright 2007 Red Hat, Inc.
   4  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   5  *
   6  * This code is free software; you can redistribute it and/or modify it
   7  * under the terms of the GNU General Public License version 2 only, as
   8  * published by the Free Software Foundation.
   9  *
  10  * This code is distributed in the hope that it will be useful, but WITHOUT
  11  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  12  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  13  * version 2 for more details (a copy is included in the LICENSE file that
  14  * accompanied this code).
  15  *
  16  * You should have received a copy of the GNU General Public License version
  17  * 2 along with this work; if not, write to the Free Software Foundation,
  18  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  19  *
  20  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  21  * or visit www.oracle.com if you need additional information or have any
  22  * questions.
  23  *
  24  */
  25 





  26 class VMRegImpl;
  27 typedef VMRegImpl* VMReg;
  28 
  29 // Use Register as shortcut
  30 class RegisterImpl;
  31 typedef RegisterImpl* Register;
  32 
  33 inline Register as_Register(int encoding) {
  34   return (Register)(intptr_t) encoding;
  35 }
  36 
  37 // The implementation of integer registers for the zero architecture
  38 class RegisterImpl : public AbstractRegisterImpl {
  39  public:
  40   enum {
  41     number_of_registers = 0
  42   };
  43 
  44   // construction
  45   inline friend Register as_Register(int encoding);


  91     return (intptr_t)this;
  92   }
  93   bool is_valid() const {
  94     return 0 <= (intptr_t) this && (intptr_t)this < number_of_registers;
  95   }
  96   const char* name() const;
  97 };
  98 
  99 class ConcreteRegisterImpl : public AbstractRegisterImpl {
 100  public:
 101   enum {
 102     number_of_registers = RegisterImpl::number_of_registers +
 103                           FloatRegisterImpl::number_of_registers
 104   };
 105 
 106   static const int max_gpr;
 107   static const int max_fpr;
 108 };
 109 
 110 CONSTANT_REGISTER_DECLARATION(Register, noreg, (-1));


   1 /*
   2  * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
   3  * Copyright 2007 Red Hat, Inc.
   4  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   5  *
   6  * This code is free software; you can redistribute it and/or modify it
   7  * under the terms of the GNU General Public License version 2 only, as
   8  * published by the Free Software Foundation.
   9  *
  10  * This code is distributed in the hope that it will be useful, but WITHOUT
  11  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  12  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  13  * version 2 for more details (a copy is included in the LICENSE file that
  14  * accompanied this code).
  15  *
  16  * You should have received a copy of the GNU General Public License version
  17  * 2 along with this work; if not, write to the Free Software Foundation,
  18  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  19  *
  20  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  21  * or visit www.oracle.com if you need additional information or have any
  22  * questions.
  23  *
  24  */
  25 
  26 #ifndef CPU_ZERO_VM_REGISTER_ZERO_HPP
  27 #define CPU_ZERO_VM_REGISTER_ZERO_HPP
  28 
  29 #include "asm/register.hpp"
  30 
  31 class VMRegImpl;
  32 typedef VMRegImpl* VMReg;
  33 
  34 // Use Register as shortcut
  35 class RegisterImpl;
  36 typedef RegisterImpl* Register;
  37 
  38 inline Register as_Register(int encoding) {
  39   return (Register)(intptr_t) encoding;
  40 }
  41 
  42 // The implementation of integer registers for the zero architecture
  43 class RegisterImpl : public AbstractRegisterImpl {
  44  public:
  45   enum {
  46     number_of_registers = 0
  47   };
  48 
  49   // construction
  50   inline friend Register as_Register(int encoding);


  96     return (intptr_t)this;
  97   }
  98   bool is_valid() const {
  99     return 0 <= (intptr_t) this && (intptr_t)this < number_of_registers;
 100   }
 101   const char* name() const;
 102 };
 103 
 104 class ConcreteRegisterImpl : public AbstractRegisterImpl {
 105  public:
 106   enum {
 107     number_of_registers = RegisterImpl::number_of_registers +
 108                           FloatRegisterImpl::number_of_registers
 109   };
 110 
 111   static const int max_gpr;
 112   static const int max_fpr;
 113 };
 114 
 115 CONSTANT_REGISTER_DECLARATION(Register, noreg, (-1));
 116 
 117 #endif // CPU_ZERO_VM_REGISTER_ZERO_HPP