OSDN Git Service
ART: Ensure FP GET/PUT doesn't use Core register
Routine void org.jbox2d.collision.AABB.combine(
org.jbox2d.collision.AABB, org.jbox2d.collision.AABB)
in the icyrocks application generated code for an iget of a FP field
that was loaded into a Core register, and then into an XMM register.
This was caused by the Dex code:
0x0030: iget v2, v2, F org.jbox2d.common.Vec2.x // field@3747
I traced this to GenIGet using a reg_class of kAnyReg, and EvalLoc
finding that v2 was available in EDX. Since kAnyReg is compatible
with EDX, The iget loaded the FP value into EDX, and then into an XMM
register for subsequent use.
Fix: Pass kSingle/kDouble into IGET/IPUT/SGET/SPUT/AGET/APUT when the
source/destination is FP. Change X86Mir2Lir::RegClassForFieldLoadStore
to return kFPReg for those cases. This causes EvalLoc to return an XMM
register, and the load is done right to the XMM register.
Change-Id: Ifbcc9e4d80bc6da8ea4ebf7e6cebaaf672a2766e
Signed-off-by: Mark Mendell <mark.p.mendell@intel.com>