< prev index next >

src/cpu/x86/vm/register_x86.hpp

Print this page


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


 106  public:
 107   enum {
 108     number_of_registers = 8
 109   };
 110 
 111   // construction
 112   inline friend FloatRegister as_FloatRegister(int encoding);
 113 
 114   inline VMReg as_VMReg();
 115 
 116   // derived registers, offsets, and addresses
 117 
 118   FloatRegister successor() const                          { return as_FloatRegister(encoding() + 1); }
 119 
 120   // accessors
 121   int   encoding() const                          { assert(is_valid(), "invalid register"); return (intptr_t)this; }
 122   bool  is_valid() const                          { return 0 <= (intptr_t)this && (intptr_t)this < number_of_registers; }
 123   const char* name() const;
 124 
 125 };


 126 
 127 // Use XMMRegister as shortcut
 128 class XMMRegisterImpl;
 129 typedef XMMRegisterImpl* XMMRegister;
 130 
 131 // Use MMXRegister as shortcut
 132 class MMXRegisterImpl;
 133 typedef MMXRegisterImpl* MMXRegister;
 134 
 135 inline XMMRegister as_XMMRegister(int encoding) {
 136   return (XMMRegister)(intptr_t)encoding;
 137 }
 138 
 139 inline MMXRegister as_MMXRegister(int encoding) {
 140   return (MMXRegister)(intptr_t)encoding;
 141 }
 142 
 143 // The implementation of XMM registers for the IA32 architecture
 144 class XMMRegisterImpl: public AbstractRegisterImpl {
 145  public:


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


 106  public:
 107   enum {
 108     number_of_registers = 8
 109   };
 110 
 111   // construction
 112   inline friend FloatRegister as_FloatRegister(int encoding);
 113 
 114   inline VMReg as_VMReg();
 115 
 116   // derived registers, offsets, and addresses
 117 
 118   FloatRegister successor() const                          { return as_FloatRegister(encoding() + 1); }
 119 
 120   // accessors
 121   int   encoding() const                          { assert(is_valid(), "invalid register"); return (intptr_t)this; }
 122   bool  is_valid() const                          { return 0 <= (intptr_t)this && (intptr_t)this < number_of_registers; }
 123   const char* name() const;
 124 
 125 };
 126 
 127 CONSTANT_REGISTER_DECLARATION(FloatRegister, fnoreg, (-1));
 128 
 129 // Use XMMRegister as shortcut
 130 class XMMRegisterImpl;
 131 typedef XMMRegisterImpl* XMMRegister;
 132 
 133 // Use MMXRegister as shortcut
 134 class MMXRegisterImpl;
 135 typedef MMXRegisterImpl* MMXRegister;
 136 
 137 inline XMMRegister as_XMMRegister(int encoding) {
 138   return (XMMRegister)(intptr_t)encoding;
 139 }
 140 
 141 inline MMXRegister as_MMXRegister(int encoding) {
 142   return (MMXRegister)(intptr_t)encoding;
 143 }
 144 
 145 // The implementation of XMM registers for the IA32 architecture
 146 class XMMRegisterImpl: public AbstractRegisterImpl {
 147  public:


< prev index next >