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 314 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
325 __ xorps(dst, dst); | 325 __ xorps(dst, dst); |
326 } else { | 326 } else { |
327 __ push(Immediate(upper)); | 327 __ push(Immediate(upper)); |
328 __ push(Immediate(lower)); | 328 __ push(Immediate(lower)); |
329 __ movdbl(dst, Operand(esp, 0)); | 329 __ movdbl(dst, Operand(esp, 0)); |
330 __ add(esp, Immediate(kDoubleSize)); | 330 __ add(esp, Immediate(kDoubleSize)); |
331 } | 331 } |
332 } else { | 332 } else { |
333 __ push(Immediate(upper)); | 333 __ push(Immediate(upper)); |
334 __ push(Immediate(lower)); | 334 __ push(Immediate(lower)); |
335 if (cgen_->X87StackNonEmpty()) { | 335 X87Register dst = cgen_->ToX87Register(destination); |
336 cgen_->PopX87(); | 336 cgen_->X87Mov(dst, MemOperand(esp, 0)); |
337 } | |
338 cgen_->PushX87DoubleOperand(MemOperand(esp, 0)); | |
339 __ add(esp, Immediate(kDoubleSize)); | 337 __ add(esp, Immediate(kDoubleSize)); |
340 } | 338 } |
341 } else { | 339 } else { |
342 ASSERT(destination->IsStackSlot()); | 340 ASSERT(destination->IsStackSlot()); |
343 Operand dst = cgen_->ToOperand(destination); | 341 Operand dst = cgen_->ToOperand(destination); |
344 if (cgen_->IsSmi(constant_source)) { | 342 if (cgen_->IsSmi(constant_source)) { |
345 __ Set(dst, cgen_->ToSmiImmediate(constant_source)); | 343 __ Set(dst, cgen_->ToSmiImmediate(constant_source)); |
346 } else if (cgen_->IsInteger32(constant_source)) { | 344 } else if (cgen_->IsInteger32(constant_source)) { |
347 __ Set(dst, cgen_->ToInteger32Immediate(constant_source)); | 345 __ Set(dst, cgen_->ToInteger32Immediate(constant_source)); |
348 } else { | 346 } else { |
(...skipping 11 matching lines...) Expand all Loading... |
360 XMMRegister dst = cgen_->ToDoubleRegister(destination); | 358 XMMRegister dst = cgen_->ToDoubleRegister(destination); |
361 __ movaps(dst, src); | 359 __ movaps(dst, src); |
362 } else { | 360 } else { |
363 ASSERT(destination->IsDoubleStackSlot()); | 361 ASSERT(destination->IsDoubleStackSlot()); |
364 Operand dst = cgen_->ToOperand(destination); | 362 Operand dst = cgen_->ToOperand(destination); |
365 __ movdbl(dst, src); | 363 __ movdbl(dst, src); |
366 } | 364 } |
367 } else { | 365 } else { |
368 // load from the register onto the stack, store in destination, which must | 366 // load from the register onto the stack, store in destination, which must |
369 // be a double stack slot in the non-SSE2 case. | 367 // be a double stack slot in the non-SSE2 case. |
370 ASSERT(source->index() == 0); // source is on top of the stack | |
371 ASSERT(destination->IsDoubleStackSlot()); | 368 ASSERT(destination->IsDoubleStackSlot()); |
372 Operand dst = cgen_->ToOperand(destination); | 369 Operand dst = cgen_->ToOperand(destination); |
373 cgen_->ReadX87Operand(dst); | 370 X87Register src = cgen_->ToX87Register(source); |
| 371 cgen_->X87Mov(dst, src); |
374 } | 372 } |
375 } else if (source->IsDoubleStackSlot()) { | 373 } else if (source->IsDoubleStackSlot()) { |
376 if (CpuFeatures::IsSupported(SSE2)) { | 374 if (CpuFeatures::IsSupported(SSE2)) { |
377 CpuFeatureScope scope(cgen_->masm(), SSE2); | 375 CpuFeatureScope scope(cgen_->masm(), SSE2); |
378 ASSERT(destination->IsDoubleRegister() || | 376 ASSERT(destination->IsDoubleRegister() || |
379 destination->IsDoubleStackSlot()); | 377 destination->IsDoubleStackSlot()); |
380 Operand src = cgen_->ToOperand(source); | 378 Operand src = cgen_->ToOperand(source); |
381 if (destination->IsDoubleRegister()) { | 379 if (destination->IsDoubleRegister()) { |
382 XMMRegister dst = cgen_->ToDoubleRegister(destination); | 380 XMMRegister dst = cgen_->ToDoubleRegister(destination); |
383 __ movdbl(dst, src); | 381 __ movdbl(dst, src); |
(...skipping 12 matching lines...) Expand all Loading... |
396 Operand src0 = cgen_->ToOperand(source); | 394 Operand src0 = cgen_->ToOperand(source); |
397 Operand src1 = cgen_->HighOperand(source); | 395 Operand src1 = cgen_->HighOperand(source); |
398 Operand dst0 = cgen_->ToOperand(destination); | 396 Operand dst0 = cgen_->ToOperand(destination); |
399 Operand dst1 = cgen_->HighOperand(destination); | 397 Operand dst1 = cgen_->HighOperand(destination); |
400 __ mov(tmp, src0); // Then use tmp to copy source to destination. | 398 __ mov(tmp, src0); // Then use tmp to copy source to destination. |
401 __ mov(dst0, tmp); | 399 __ mov(dst0, tmp); |
402 __ mov(tmp, src1); | 400 __ mov(tmp, src1); |
403 __ mov(dst1, tmp); | 401 __ mov(dst1, tmp); |
404 } else { | 402 } else { |
405 Operand src = cgen_->ToOperand(source); | 403 Operand src = cgen_->ToOperand(source); |
406 if (cgen_->X87StackNonEmpty()) { | 404 X87Register dst = cgen_->ToX87Register(destination); |
407 cgen_->PopX87(); | 405 cgen_->X87Mov(dst, src); |
408 } | |
409 cgen_->PushX87DoubleOperand(src); | |
410 } | 406 } |
411 } | 407 } |
412 } else { | 408 } else { |
413 UNREACHABLE(); | 409 UNREACHABLE(); |
414 } | 410 } |
415 | 411 |
416 RemoveMove(index); | 412 RemoveMove(index); |
417 } | 413 } |
418 | 414 |
419 | 415 |
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
544 } else if (destination->IsRegister()) { | 540 } else if (destination->IsRegister()) { |
545 source_uses_[destination->index()] = CountSourceUses(destination); | 541 source_uses_[destination->index()] = CountSourceUses(destination); |
546 } | 542 } |
547 } | 543 } |
548 | 544 |
549 #undef __ | 545 #undef __ |
550 | 546 |
551 } } // namespace v8::internal | 547 } } // namespace v8::internal |
552 | 548 |
553 #endif // V8_TARGET_ARCH_IA32 | 549 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |