+ } else if ((source->IsSIMD128StackSlot() &&
+ destination->IsSIMD128StackSlot())) {
+ // Swap two XMM stack slots.
+ Operand src = cgen_->ToOperand(source);
+ Operand dst = cgen_->ToOperand(destination);
+ Register tmp = EnsureTempRegister();
+ __ movups(xmm0, src);
+ for (int offset = 0; offset < kSIMD128Size; offset += kPointerSize) {
+ __ mov(tmp, Operand(dst, offset));
+ __ mov(Operand(src, offset), tmp);
+ }
+ __ movups(dst, xmm0);
+
+ } else if (source->IsSIMD128Register() && destination->IsSIMD128Register()) {
+ // Swap two XMM registers.
+ XMMRegister source_reg = cgen_->ToSIMD128Register(source);
+ XMMRegister destination_reg = cgen_->ToSIMD128Register(destination);
+ __ movaps(xmm0, source_reg);
+ __ movaps(source_reg, destination_reg);
+ __ movaps(destination_reg, xmm0);
+
+ } else if (source->IsSIMD128Register() || destination->IsSIMD128Register()) {
+ // Swap a xmm register and a xmm stack slot.
+ DCHECK((source->IsSIMD128Register() &&
+ destination->IsSIMD128StackSlot()) ||
+ (source->IsSIMD128StackSlot() &&
+ destination->IsSIMD128Register()));
+ XMMRegister reg = cgen_->ToSIMD128Register(source->IsSIMD128Register()
+ ? source
+ : destination);
+ LOperand* other = source->IsSIMD128Register() ? destination : source;
+ DCHECK(other->IsSIMD128StackSlot());
+ Operand other_operand = cgen_->ToOperand(other);
+ __ movups(xmm0, other_operand);
+ __ movups(other_operand, reg);
+ __ movaps(reg, xmm0);
+