Mercurial > hg > graal-jvmci-8
diff src/cpu/sparc/vm/jvmciCodeInstaller_sparc.cpp @ 22682:5ba5ff0fda9e
Add SPARC Quad precision registers and remove unneccesary methods from SPARC.java
author | Stefan Anzinger <stefan.anzinger@oracle.com> |
---|---|
date | Thu, 15 Oct 2015 11:52:47 +0200 |
parents | 3f6488b29c1a |
children | ceca35d52380 |
line wrap: on
line diff
--- a/src/cpu/sparc/vm/jvmciCodeInstaller_sparc.cpp Tue Oct 13 18:22:26 2015 +0200 +++ b/src/cpu/sparc/vm/jvmciCodeInstaller_sparc.cpp Thu Oct 15 11:52:47 2015 +0200 @@ -171,16 +171,20 @@ // convert JVMCI register indices (as used in oop maps) to HotSpot registers VMReg CodeInstaller::get_hotspot_reg(jint jvmci_reg) { + // JVMCI Registers are numbered as follows: + // 0..31: Thirty-two General Purpose registers (CPU Registers) + // 32..63: Thirty-two single precision float registers + // 64..95: Thirty-two double precision float registers + // 96..111: Sixteen quad precision float registers if (jvmci_reg < RegisterImpl::number_of_registers) { return as_Register(jvmci_reg)->as_VMReg(); } else { - jint floatRegisterNumber = jvmci_reg - RegisterImpl::number_of_registers; - floatRegisterNumber += MAX2(0, floatRegisterNumber-32); // Beginning with f32, only every second register is going to be addressed - if (floatRegisterNumber < FloatRegisterImpl::number_of_registers) { - return as_FloatRegister(floatRegisterNumber)->as_VMReg(); - } - ShouldNotReachHere(); - return NULL; + jint jvmciFloatRegisterNumber = jvmci_reg - RegisterImpl::number_of_registers; + jint floatRegisterNumber = MIN2(32, jvmciFloatRegisterNumber); + floatRegisterNumber += 2 * MAX2(0, MIN2(32, jvmciFloatRegisterNumber) - 32); + floatRegisterNumber += 4 * MAX2(0, MIN2(32, jvmciFloatRegisterNumber) - 32 - 32); + floatRegisterNumber = floatRegisterNumber % FloatRegisterImpl::number_of_registers; + return as_FloatRegister(floatRegisterNumber)->as_VMReg(); } }