vmreg_x86.inline.hpp revision 6760:22b98ab2a69f
1177633Sdfr/* 2177633Sdfr * Copyright (c) 2006, 2012, Oracle and/or its affiliates. All rights reserved. 3177633Sdfr * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4177633Sdfr * 5177633Sdfr * This code is free software; you can redistribute it and/or modify it 6177633Sdfr * under the terms of the GNU General Public License version 2 only, as 7177633Sdfr * published by the Free Software Foundation. 8177633Sdfr * 9177633Sdfr * This code is distributed in the hope that it will be useful, but WITHOUT 10177633Sdfr * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11177633Sdfr * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 12177633Sdfr * version 2 for more details (a copy is included in the LICENSE file that 13177633Sdfr * accompanied this code). 14177633Sdfr * 15177633Sdfr * You should have received a copy of the GNU General Public License version 16177633Sdfr * 2 along with this work; if not, write to the Free Software Foundation, 17177633Sdfr * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 18177633Sdfr * 19177633Sdfr * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 20177633Sdfr * or visit www.oracle.com if you need additional information or have any 21177633Sdfr * questions. 22177633Sdfr * 23177633Sdfr */ 24177633Sdfr 25177633Sdfr#ifndef CPU_X86_VM_VMREG_X86_INLINE_HPP 26177633Sdfr#define CPU_X86_VM_VMREG_X86_INLINE_HPP 27177633Sdfr 28177633Sdfrinline VMReg RegisterImpl::as_VMReg() { 29177633Sdfr if( this==noreg ) return VMRegImpl::Bad(); 30177633Sdfr#ifdef AMD64 31177633Sdfr return VMRegImpl::as_VMReg(encoding() << 1 ); 32177633Sdfr#else 33177633Sdfr return VMRegImpl::as_VMReg(encoding() ); 34177633Sdfr#endif // AMD64 35177633Sdfr} 36177633Sdfr 37177633Sdfrinline VMReg FloatRegisterImpl::as_VMReg() { 38177633Sdfr return VMRegImpl::as_VMReg((encoding() << 1) + ConcreteRegisterImpl::max_gpr); 39177633Sdfr} 40177633Sdfr 41177633Sdfrinline VMReg XMMRegisterImpl::as_VMReg() { 42177633Sdfr return VMRegImpl::as_VMReg((encoding() << 3) + ConcreteRegisterImpl::max_fpr); 43177633Sdfr} 44177633Sdfr 45177633Sdfr#endif // CPU_X86_VM_VMREG_X86_INLINE_HPP 46177633Sdfr