diff options
Diffstat (limited to 'runtime/arch/x86/context_x86.h')
| -rw-r--r-- | runtime/arch/x86/context_x86.h | 28 |
1 files changed, 23 insertions, 5 deletions
diff --git a/runtime/arch/x86/context_x86.h b/runtime/arch/x86/context_x86.h index 8b7804d616..c66a9dcb19 100644 --- a/runtime/arch/x86/context_x86.h +++ b/runtime/arch/x86/context_x86.h @@ -61,11 +61,16 @@ class X86Context : public Context { 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 @@ class X86Context : public Context { 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). |