OSDN Git Service

ART: Ensure FP GET/PUT doesn't use Core register
authorMark Mendell <mark.p.mendell@intel.com>
Wed, 15 Oct 2014 20:59:49 +0000 (16:59 -0400)
committerMark P Mendell <mark.p.mendell@intel.com>
Tue, 9 Dec 2014 01:51:20 +0000 (01:51 +0000)
commitca5413403192022d734ce76fda9a84aa63eb9148
tree6d56c2c781463fe3cacf9cea797c74e5c983b04a
parente4ea6a9e73c3cb29e78183be3d30796e524a8a80
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>
compiler/dex/quick/mir_to_lir.cc
compiler/dex/quick/x86/int_x86.cc
compiler/dex/quick/x86/target_x86.cc