Revert "Revert "Better support for x86 XMM registers""
This reverts commit 8ff67e3338952c70ccf3b609559bf8cc0f379cfd.
Fix applied to loc.fp usage.
Change-Id: I1eb3005392544fcf30c595923ed25bcee2dc4859
diff --git a/compiler/dex/quick/x86/utility_x86.cc b/compiler/dex/quick/x86/utility_x86.cc
index f683aff..91c39fa 100644
--- a/compiler/dex/quick/x86/utility_x86.cc
+++ b/compiler/dex/quick/x86/utility_x86.cc
@@ -334,6 +334,7 @@
LIR *res;
if (X86_FPREG(r_dest_lo)) {
DCHECK(X86_FPREG(r_dest_hi)); // ignore r_dest_hi
+ DCHECK_EQ(r_dest_lo, r_dest_hi);
if (value == 0) {
return NewLIR2(kX86XorpsRR, r_dest_lo, r_dest_lo);
} else {
@@ -343,9 +344,11 @@
res = LoadConstantNoClobber(r_dest_lo, val_lo);
}
if (val_hi != 0) {
+ r_dest_hi = AllocTempDouble();
LoadConstantNoClobber(r_dest_hi, val_hi);
NewLIR2(kX86PsllqRI, r_dest_hi, 32);
NewLIR2(kX86OrpsRR, r_dest_lo, r_dest_hi);
+ FreeTemp(r_dest_hi);
}
}
} else {
@@ -370,12 +373,6 @@
is64bit = true;
if (X86_FPREG(r_dest)) {
opcode = is_array ? kX86MovsdRA : kX86MovsdRM;
- if (X86_SINGLEREG(r_dest)) {
- DCHECK(X86_FPREG(r_dest_hi));
- DCHECK_EQ(r_dest, (r_dest_hi - 1));
- r_dest = S2d(r_dest, r_dest_hi);
- }
- r_dest_hi = r_dest + 1;
} else {
pair = true;
opcode = is_array ? kX86Mov32RA : kX86Mov32RM;
@@ -488,12 +485,6 @@
is64bit = true;
if (X86_FPREG(r_src)) {
opcode = is_array ? kX86MovsdAR : kX86MovsdMR;
- if (X86_SINGLEREG(r_src)) {
- DCHECK(X86_FPREG(r_src_hi));
- DCHECK_EQ(r_src, (r_src_hi - 1));
- r_src = S2d(r_src, r_src_hi);
- }
- r_src_hi = r_src + 1;
} else {
pair = true;
opcode = is_array ? kX86Mov32AR : kX86Mov32MR;
@@ -573,4 +564,17 @@
r_src_lo, r_src_hi, kLong, INVALID_SREG);
}
+/*
+ * Copy a long value in Core registers to an XMM register
+ *
+ */
+void X86Mir2Lir::OpVectorRegCopyWide(uint8_t fp_reg, uint8_t low_reg, uint8_t high_reg) {
+ NewLIR2(kX86MovdxrRR, fp_reg, low_reg);
+ int tmp_reg = AllocTempDouble();
+ NewLIR2(kX86MovdxrRR, tmp_reg, high_reg);
+ NewLIR2(kX86PsllqRI, tmp_reg, 32);
+ NewLIR2(kX86OrpsRR, fp_reg, tmp_reg);
+ FreeTemp(tmp_reg);
+}
+
} // namespace art