hotspot/src/cpu/x86/vm/vmreg_x86.inline.hpp
changeset 13104 657b387034fb
parent 7397 5b173b4ca846
child 25715 d5a8dbdc5150
equal deleted inserted replaced
12960:2989536b61ef 13104:657b387034fb
     1 /*
     1 /*
     2  * Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 2006, 2012, Oracle and/or its affiliates. All rights reserved.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4  *
     4  *
     5  * This code is free software; you can redistribute it and/or modify it
     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
     6  * under the terms of the GNU General Public License version 2 only, as
     7  * published by the Free Software Foundation.
     7  * published by the Free Software Foundation.
    37 inline VMReg FloatRegisterImpl::as_VMReg() {
    37 inline VMReg FloatRegisterImpl::as_VMReg() {
    38   return VMRegImpl::as_VMReg((encoding() << 1) + ConcreteRegisterImpl::max_gpr);
    38   return VMRegImpl::as_VMReg((encoding() << 1) + ConcreteRegisterImpl::max_gpr);
    39 }
    39 }
    40 
    40 
    41 inline VMReg XMMRegisterImpl::as_VMReg() {
    41 inline VMReg XMMRegisterImpl::as_VMReg() {
    42   return VMRegImpl::as_VMReg((encoding() << 1) + ConcreteRegisterImpl::max_fpr);
    42   return VMRegImpl::as_VMReg((encoding() << 3) + ConcreteRegisterImpl::max_fpr);
    43 }
    43 }
    44 
    44 
    45 
    45 
    46 inline bool VMRegImpl::is_Register() {
    46 inline bool VMRegImpl::is_Register() {
    47   return (unsigned int) value() < (unsigned int) ConcreteRegisterImpl::max_gpr;
    47   return (unsigned int) value() < (unsigned int) ConcreteRegisterImpl::max_gpr;
    73 }
    73 }
    74 
    74 
    75 inline XMMRegister VMRegImpl::as_XMMRegister() {
    75 inline XMMRegister VMRegImpl::as_XMMRegister() {
    76   assert( is_XMMRegister() && is_even(value()), "must be" );
    76   assert( is_XMMRegister() && is_even(value()), "must be" );
    77   // Yuk
    77   // Yuk
    78   return ::as_XMMRegister((value() - ConcreteRegisterImpl::max_fpr) >> 1);
    78   return ::as_XMMRegister((value() - ConcreteRegisterImpl::max_fpr) >> 3);
    79 }
    79 }
    80 
    80 
    81 inline   bool VMRegImpl::is_concrete() {
    81 inline   bool VMRegImpl::is_concrete() {
    82   assert(is_reg(), "must be");
    82   assert(is_reg(), "must be");
    83 #ifndef AMD64
    83 #ifndef AMD64