OSDN Git Service

x86 GenLongRegOrMemOp should be aware about xmm to core reg conversion
authorSerguei Katkov <serguei.i.katkov@intel.com>
Tue, 25 Mar 2014 03:51:15 +0000 (10:51 +0700)
committerSerguei Katkov <serguei.i.katkov@intel.com>
Wed, 26 Mar 2014 04:59:02 +0000 (11:59 +0700)
GenLongRegOrMemOp function expects arithmetic on core regs but does not
ensure that operand in core reg.

The patch adds the conversion if it is required.

Change-Id: Ibb6928b8cc2c63ede1a20d6ee45d9a64884231b6
Signed-off-by: Serguei Katkov <serguei.i.katkov@intel.com>
compiler/dex/quick/x86/int_x86.cc

index dcbaad9..1fe0af9 100644 (file)
@@ -1091,6 +1091,8 @@ void X86Mir2Lir::GenLongRegOrMemOp(RegLocation rl_dest, RegLocation rl_src,
   X86OpCode x86op = GetOpcode(op, rl_dest, rl_src, false);
   if (rl_src.location == kLocPhysReg) {
     // Both operands are in registers.
+    // But we must ensure that rl_src is in pair
+    rl_src = EvalLocWide(rl_src, kCoreReg, true);
     if (rl_dest.reg.GetReg() == rl_src.reg.GetHighReg()) {
       // The registers are the same, so we would clobber it before the use.
       int temp_reg = AllocTemp();