Revert "Revert "ART: Implement X86 hard float (Quick/JNI/Baseline)""
This reverts commit 949c91fb91f40a4a80b2b492913cf8541008975e.
This time, don't clobber EBX before saving it.
Redo some of the macros to make register usage explicit.
Change-Id: I8db8662877cd006816e16a28f42444ab7c36bfef
diff --git a/runtime/arch/x86/context_x86.h b/runtime/arch/x86/context_x86.h
index 8b7804d..c66a9dc 100644
--- a/runtime/arch/x86/context_x86.h
+++ b/runtime/arch/x86/context_x86.h
@@ -61,11 +61,16 @@
void SetGPR(uint32_t reg, uintptr_t value) OVERRIDE;
- bool IsAccessibleFPR(uint32_t reg ATTRIBUTE_UNUSED) OVERRIDE {
- return false;
+ bool IsAccessibleFPR(uint32_t reg) OVERRIDE {
+ DCHECK_LT(reg, static_cast<uint32_t>(kNumberOfFloatRegisters));
+ return fprs_[reg] != nullptr;
}
- uintptr_t GetFPR(uint32_t reg) OVERRIDE;
+ uintptr_t GetFPR(uint32_t reg) OVERRIDE {
+ DCHECK_LT(reg, static_cast<uint32_t>(kNumberOfFloatRegisters));
+ DCHECK(IsAccessibleFPR(reg));
+ return *fprs_[reg];
+ }
void SetFPR(uint32_t reg, uintptr_t value) OVERRIDE;
@@ -73,9 +78,22 @@
void DoLongJump() OVERRIDE;
private:
- // Pointers to register locations, floating point registers are all caller save. Values are
- // initialized to NULL or the special registers below.
+ // Pretend XMM registers are made of uin32_t pieces, because they are manipulated
+ // in uint32_t chunks.
+ enum {
+ XMM0_0 = 0, XMM0_1,
+ XMM1_0, XMM1_1,
+ XMM2_0, XMM2_1,
+ XMM3_0, XMM3_1,
+ XMM4_0, XMM4_1,
+ XMM5_0, XMM5_1,
+ XMM6_0, XMM6_1,
+ XMM7_0, XMM7_1,
+ kNumberOfFloatRegisters};
+
+ // Pointers to register locations. Values are initialized to NULL or the special registers below.
uintptr_t* gprs_[kNumberOfCpuRegisters];
+ uint32_t* fprs_[kNumberOfFloatRegisters];
// Hold values for esp and eip if they are not located within a stack frame. EIP is somewhat
// special in that it cannot be encoded normally as a register operand to an instruction (except
// in 64bit addressing modes).