Index: src/ia32/macro-assembler-ia32.cc |
diff --git a/src/ia32/macro-assembler-ia32.cc b/src/ia32/macro-assembler-ia32.cc |
index 2d0720a77d208716b300c8a4346295bb3571a403..9a15eac53aa4fdcba8fcc06481cfdbe8a87576ef 100644 |
--- a/src/ia32/macro-assembler-ia32.cc |
+++ b/src/ia32/macro-assembler-ia32.cc |
@@ -1120,12 +1120,13 @@ void MacroAssembler::EnterExitFrameEpilogue(int argc, bool save_doubles) { |
// Optionally save all XMM registers. |
if (save_doubles) { |
CpuFeatureScope scope(this, SSE2); |
- int space = XMMRegister::kNumRegisters * kDoubleSize + argc * kPointerSize; |
+ int space = XMMRegister::kNumRegisters * kFloat32x4Size + |
+ argc * kPointerSize; |
sub(esp, Immediate(space)); |
const int offset = -2 * kPointerSize; |
for (int i = 0; i < XMMRegister::kNumRegisters; i++) { |
XMMRegister reg = XMMRegister::from_code(i); |
- movsd(Operand(ebp, offset - ((i + 1) * kDoubleSize)), reg); |
+ movups(Operand(ebp, offset - ((i + 1) * kFloat32x4Size)), reg); |
} |
} else { |
sub(esp, Immediate(argc * kPointerSize)); |
@@ -1169,7 +1170,7 @@ void MacroAssembler::LeaveExitFrame(bool save_doubles) { |
const int offset = -2 * kPointerSize; |
for (int i = 0; i < XMMRegister::kNumRegisters; i++) { |
XMMRegister reg = XMMRegister::from_code(i); |
- movsd(reg, Operand(ebp, offset - ((i + 1) * kDoubleSize))); |
+ movups(reg, Operand(ebp, offset - ((i + 1) * kFloat32x4Size))); |
} |
} |
@@ -1835,6 +1836,30 @@ void MacroAssembler::AllocateHeapNumber(Register result, |
} |
+void MacroAssembler::AllocateFloat32x4(Register result, |
+ Register scratch, |
+ Label* gc_required) { |
+ // Allocate heap number in new space. |
+ Allocate(Float32x4::kSize, result, scratch, no_reg, gc_required, TAG_OBJECT); |
+ |
+ // Set the map. |
+ mov(FieldOperand(result, HeapObject::kMapOffset), |
+ Immediate(isolate()->factory()->float32x4_map())); |
+} |
+ |
+ |
+void MacroAssembler::AllocateInt32x4(Register result, |
+ Register scratch, |
+ Label* gc_required) { |
+ // Allocate heap number in new space. |
+ Allocate(Int32x4::kSize, result, scratch, no_reg, gc_required, TAG_OBJECT); |
+ |
+ // Set the map. |
+ mov(FieldOperand(result, HeapObject::kMapOffset), |
+ Immediate(isolate()->factory()->int32x4_map())); |
+} |
+ |
+ |
void MacroAssembler::AllocateTwoByteString(Register result, |
Register length, |
Register scratch1, |
@@ -3697,6 +3722,59 @@ void MacroAssembler::JumpIfDictionaryInPrototypeChain( |
j(not_equal, &loop_again); |
} |
+ |
+void MacroAssembler::absps(XMMRegister dst) { |
+ static const struct V8_ALIGNED(16) { |
+ uint32_t a; |
+ uint32_t b; |
+ uint32_t c; |
+ uint32_t d; |
+ } float_absolute_constant = |
+ { 0x7FFFFFFF, 0x7FFFFFFF, 0x7FFFFFFF, 0x7FFFFFFF }; |
+ andps(dst, |
+ Operand(reinterpret_cast<int32_t>(&float_absolute_constant))); |
+} |
+ |
+ |
+void MacroAssembler::notps(XMMRegister dst) { |
+ static const struct V8_ALIGNED(16) { |
+ uint32_t a; |
+ uint32_t b; |
+ uint32_t c; |
+ uint32_t d; |
+ } float_not_constant = |
+ { 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF }; |
+ xorps(dst, |
+ Operand(Operand(reinterpret_cast<int32_t>(&float_not_constant)))); |
+} |
+ |
+ |
+void MacroAssembler::negateps(XMMRegister dst) { |
+ static const struct V8_ALIGNED(16) { |
+ uint32_t a; |
+ uint32_t b; |
+ uint32_t c; |
+ uint32_t d; |
+ } float_negate_constant = |
+ { 0x80000000, 0x80000000, 0x80000000, 0x80000000 }; |
+ xorps(dst, |
+ Operand(Operand(reinterpret_cast<int32_t>(&float_negate_constant)))); |
+} |
+ |
+ |
+void MacroAssembler::pnegd(XMMRegister dst) { |
+ static const struct V8_ALIGNED(16) { |
+ uint32_t a; |
+ uint32_t b; |
+ uint32_t c; |
+ uint32_t d; |
+ } int32_one_constant = { 0x1, 0x1, 0x1, 0x1 }; |
+ notps(dst); |
+ paddd(dst, |
+ Operand(Operand(reinterpret_cast<int32_t>(&int32_one_constant)))); |
+} |
+ |
+ |
} } // namespace v8::internal |
#endif // V8_TARGET_ARCH_IA32 |