OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 291 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
302 __ mov(dst, tmp); | 302 __ mov(dst, tmp); |
303 } | 303 } |
304 | 304 |
305 } else if (source->IsConstantOperand()) { | 305 } else if (source->IsConstantOperand()) { |
306 ASSERT(destination->IsRegister() || destination->IsStackSlot()); | 306 ASSERT(destination->IsRegister() || destination->IsStackSlot()); |
307 Immediate src = cgen_->ToImmediate(source); | 307 Immediate src = cgen_->ToImmediate(source); |
308 Operand dst = cgen_->ToOperand(destination); | 308 Operand dst = cgen_->ToOperand(destination); |
309 __ mov(dst, src); | 309 __ mov(dst, src); |
310 | 310 |
311 } else if (source->IsDoubleRegister()) { | 311 } else if (source->IsDoubleRegister()) { |
312 ASSERT(destination->IsDoubleRegister() || | |
313 destination->IsDoubleStackSlot()); | |
314 XMMRegister src = cgen_->ToDoubleRegister(source); | 312 XMMRegister src = cgen_->ToDoubleRegister(source); |
315 Operand dst = cgen_->ToOperand(destination); | 313 if (destination->IsDoubleRegister()) { |
316 __ movdbl(dst, src); | 314 XMMRegister dst = cgen_->ToDoubleRegister(destination); |
317 | 315 __ movaps(dst, src); |
| 316 } else { |
| 317 ASSERT(destination->IsDoubleStackSlot()); |
| 318 Operand dst = cgen_->ToOperand(destination); |
| 319 __ movdbl(dst, src); |
| 320 } |
318 } else if (source->IsDoubleStackSlot()) { | 321 } else if (source->IsDoubleStackSlot()) { |
319 ASSERT(destination->IsDoubleRegister() || | 322 ASSERT(destination->IsDoubleRegister() || |
320 destination->IsDoubleStackSlot()); | 323 destination->IsDoubleStackSlot()); |
321 Operand src = cgen_->ToOperand(source); | 324 Operand src = cgen_->ToOperand(source); |
322 if (destination->IsDoubleRegister()) { | 325 if (destination->IsDoubleRegister()) { |
323 XMMRegister dst = cgen_->ToDoubleRegister(destination); | 326 XMMRegister dst = cgen_->ToDoubleRegister(destination); |
324 __ movdbl(dst, src); | 327 __ movdbl(dst, src); |
325 } else { | 328 } else { |
326 // We rely on having xmm0 available as a fixed scratch register. | 329 // We rely on having xmm0 available as a fixed scratch register. |
327 Operand dst = cgen_->ToOperand(destination); | 330 Operand dst = cgen_->ToOperand(destination); |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
384 __ xor_(tmp0, src); | 387 __ xor_(tmp0, src); |
385 __ xor_(src, tmp0); | 388 __ xor_(src, tmp0); |
386 __ xor_(tmp0, src); | 389 __ xor_(tmp0, src); |
387 __ mov(dst, tmp0); | 390 __ mov(dst, tmp0); |
388 } else { | 391 } else { |
389 __ mov(tmp0, dst); | 392 __ mov(tmp0, dst); |
390 __ mov(tmp1, src); | 393 __ mov(tmp1, src); |
391 __ mov(dst, tmp1); | 394 __ mov(dst, tmp1); |
392 __ mov(src, tmp0); | 395 __ mov(src, tmp0); |
393 } | 396 } |
| 397 } else if (source->IsDoubleRegister() && destination->IsDoubleRegister()) { |
| 398 // XMM register-register swap. We rely on having xmm0 |
| 399 // available as a fixed scratch register. |
| 400 XMMRegister src = cgen_->ToDoubleRegister(source); |
| 401 XMMRegister dst = cgen_->ToDoubleRegister(destination); |
| 402 __ movaps(xmm0, src); |
| 403 __ movaps(src, dst); |
| 404 __ movaps(dst, xmm0); |
394 | 405 |
395 } else if (source->IsDoubleRegister() || destination->IsDoubleRegister()) { | 406 } else if (source->IsDoubleRegister() || destination->IsDoubleRegister()) { |
396 // XMM register-register or register-memory. We rely on having xmm0 | 407 // XMM register-memory swap. We rely on having xmm0 |
397 // available as a fixed scratch register. | 408 // available as a fixed scratch register. |
398 ASSERT(source->IsDoubleRegister() || source->IsDoubleStackSlot()); | 409 ASSERT(source->IsDoubleStackSlot() || destination->IsDoubleStackSlot()); |
399 ASSERT(destination->IsDoubleRegister() || | |
400 destination->IsDoubleStackSlot()); | |
401 XMMRegister reg = cgen_->ToDoubleRegister(source->IsDoubleRegister() | 410 XMMRegister reg = cgen_->ToDoubleRegister(source->IsDoubleRegister() |
402 ? source | 411 ? source |
403 : destination); | 412 : destination); |
404 Operand other = | 413 Operand other = |
405 cgen_->ToOperand(source->IsDoubleRegister() ? destination : source); | 414 cgen_->ToOperand(source->IsDoubleRegister() ? destination : source); |
406 __ movdbl(xmm0, other); | 415 __ movdbl(xmm0, other); |
407 __ movdbl(other, reg); | 416 __ movdbl(other, reg); |
408 __ movdbl(reg, Operand(xmm0)); | 417 __ movdbl(reg, Operand(xmm0)); |
409 | 418 |
410 } else if (source->IsDoubleStackSlot() && destination->IsDoubleStackSlot()) { | 419 } else if (source->IsDoubleStackSlot() && destination->IsDoubleStackSlot()) { |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
457 } else if (destination->IsRegister()) { | 466 } else if (destination->IsRegister()) { |
458 source_uses_[destination->index()] = CountSourceUses(destination); | 467 source_uses_[destination->index()] = CountSourceUses(destination); |
459 } | 468 } |
460 } | 469 } |
461 | 470 |
462 #undef __ | 471 #undef __ |
463 | 472 |
464 } } // namespace v8::internal | 473 } } // namespace v8::internal |
465 | 474 |
466 #endif // V8_TARGET_ARCH_IA32 | 475 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |