Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(178)

Side by Side Diff: src/ia32/macro-assembler-ia32.cc

Issue 27156004: Properly export uin32_bias double constant. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/code-stubs.cc ('k') | src/serialize.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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 427 matching lines...) Expand 10 before | Expand all | Expand 10 after
438 438
439 bind(&lost_precision_pop); 439 bind(&lost_precision_pop);
440 fstp(0); 440 fstp(0);
441 jmp(lost_precision, Label::kNear); 441 jmp(lost_precision, Label::kNear);
442 } 442 }
443 } 443 }
444 bind(&done); 444 bind(&done);
445 } 445 }
446 446
447 447
448
449 static double kUint32Bias =
450 static_cast<double>(static_cast<uint32_t>(0xFFFFFFFF)) + 1;
451
452
453 void MacroAssembler::LoadUint32(XMMRegister dst, 448 void MacroAssembler::LoadUint32(XMMRegister dst,
454 Register src, 449 Register src,
455 XMMRegister scratch) { 450 XMMRegister scratch) {
456 ASSERT(!Serializer::enabled());
457 Label done; 451 Label done;
458 cmp(src, Immediate(0)); 452 cmp(src, Immediate(0));
459 movdbl(scratch, 453 ExternalReference uint32_bias =
460 Operand(reinterpret_cast<int32_t>(&kUint32Bias), RelocInfo::NONE32)); 454 ExternalReference::address_of_uint32_bias();
455 movdbl(scratch, Operand::StaticVariable(uint32_bias));
461 Cvtsi2sd(dst, src); 456 Cvtsi2sd(dst, src);
462 j(not_sign, &done, Label::kNear); 457 j(not_sign, &done, Label::kNear);
463 addsd(dst, scratch); 458 addsd(dst, scratch);
464 bind(&done); 459 bind(&done);
465 } 460 }
466 461
467 462
468 void MacroAssembler::LoadUint32NoSSE2(Register src) { 463 void MacroAssembler::LoadUint32NoSSE2(Register src) {
469 ASSERT(!Serializer::enabled());
470 Label done; 464 Label done;
471 push(src); 465 push(src);
472 fild_s(Operand(esp, 0)); 466 fild_s(Operand(esp, 0));
473 cmp(src, Immediate(0)); 467 cmp(src, Immediate(0));
474 j(not_sign, &done, Label::kNear); 468 j(not_sign, &done, Label::kNear);
475 fld_d(Operand(reinterpret_cast<int32_t>(&kUint32Bias), RelocInfo::NONE32)); 469 ExternalReference uint32_bias =
470 ExternalReference::address_of_uint32_bias();
471 fld_d(Operand::StaticVariable(uint32_bias));
476 faddp(1); 472 faddp(1);
477 bind(&done); 473 bind(&done);
478 add(esp, Immediate(kPointerSize)); 474 add(esp, Immediate(kPointerSize));
479 } 475 }
480 476
481 477
482 void MacroAssembler::RecordWriteArray(Register object, 478 void MacroAssembler::RecordWriteArray(Register object,
483 Register value, 479 Register value,
484 Register index, 480 Register index,
485 SaveFPRegsMode save_fp, 481 SaveFPRegsMode save_fp,
(...skipping 3042 matching lines...) Expand 10 before | Expand all | Expand 10 after
3528 j(greater, &no_memento_available); 3524 j(greater, &no_memento_available);
3529 cmp(MemOperand(scratch_reg, -AllocationMemento::kSize), 3525 cmp(MemOperand(scratch_reg, -AllocationMemento::kSize),
3530 Immediate(isolate()->factory()->allocation_memento_map())); 3526 Immediate(isolate()->factory()->allocation_memento_map()));
3531 bind(&no_memento_available); 3527 bind(&no_memento_available);
3532 } 3528 }
3533 3529
3534 3530
3535 } } // namespace v8::internal 3531 } } // namespace v8::internal
3536 3532
3537 #endif // V8_TARGET_ARCH_IA32 3533 #endif // V8_TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « src/code-stubs.cc ('k') | src/serialize.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698