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

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

Issue 553843002: Replace our home-grown BitCast with bit_cast from Chrome/Google3. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 3 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/x64/lithium-gap-resolver-x64.cc ('k') | src/x87/code-stubs-x87.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 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/v8.h" 5 #include "src/v8.h"
6 6
7 #if V8_TARGET_ARCH_X64 7 #if V8_TARGET_ARCH_X64
8 8
9 #include "src/base/bits.h" 9 #include "src/base/bits.h"
10 #include "src/base/division-by-constant.h" 10 #include "src/base/division-by-constant.h"
(...skipping 3377 matching lines...) Expand 10 before | Expand all | Expand 10 after
3388 3388
3389 bind(&maybe_nan); 3389 bind(&maybe_nan);
3390 // Could be NaN or Infinity. If fraction is not zero, it's NaN, otherwise 3390 // Could be NaN or Infinity. If fraction is not zero, it's NaN, otherwise
3391 // it's an Infinity, and the non-NaN code path applies. 3391 // it's an Infinity, and the non-NaN code path applies.
3392 j(greater, &is_nan, Label::kNear); 3392 j(greater, &is_nan, Label::kNear);
3393 cmpl(FieldOperand(maybe_number, HeapNumber::kValueOffset), Immediate(0)); 3393 cmpl(FieldOperand(maybe_number, HeapNumber::kValueOffset), Immediate(0));
3394 j(zero, &not_nan); 3394 j(zero, &not_nan);
3395 bind(&is_nan); 3395 bind(&is_nan);
3396 // Convert all NaNs to the same canonical NaN value when they are stored in 3396 // Convert all NaNs to the same canonical NaN value when they are stored in
3397 // the double array. 3397 // the double array.
3398 Set(kScratchRegister, BitCast<uint64_t>( 3398 Set(kScratchRegister,
3399 FixedDoubleArray::canonical_not_the_hole_nan_as_double())); 3399 bit_cast<uint64_t>(
3400 FixedDoubleArray::canonical_not_the_hole_nan_as_double()));
3400 movq(xmm_scratch, kScratchRegister); 3401 movq(xmm_scratch, kScratchRegister);
3401 jmp(&have_double_value, Label::kNear); 3402 jmp(&have_double_value, Label::kNear);
3402 3403
3403 bind(&smi_value); 3404 bind(&smi_value);
3404 // Value is a smi. convert to a double and store. 3405 // Value is a smi. convert to a double and store.
3405 // Preserve original value. 3406 // Preserve original value.
3406 SmiToInteger32(kScratchRegister, maybe_number); 3407 SmiToInteger32(kScratchRegister, maybe_number);
3407 Cvtlsi2sd(xmm_scratch, kScratchRegister); 3408 Cvtlsi2sd(xmm_scratch, kScratchRegister);
3408 movsd(FieldOperand(elements, index, times_8, 3409 movsd(FieldOperand(elements, index, times_8,
3409 FixedDoubleArray::kHeaderSize - elements_offset), 3410 FixedDoubleArray::kHeaderSize - elements_offset),
(...skipping 1969 matching lines...) Expand 10 before | Expand all | Expand 10 after
5379 if (mag.shift > 0) sarl(rdx, Immediate(mag.shift)); 5380 if (mag.shift > 0) sarl(rdx, Immediate(mag.shift));
5380 movl(rax, dividend); 5381 movl(rax, dividend);
5381 shrl(rax, Immediate(31)); 5382 shrl(rax, Immediate(31));
5382 addl(rdx, rax); 5383 addl(rdx, rax);
5383 } 5384 }
5384 5385
5385 5386
5386 } } // namespace v8::internal 5387 } } // namespace v8::internal
5387 5388
5388 #endif // V8_TARGET_ARCH_X64 5389 #endif // V8_TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « src/x64/lithium-gap-resolver-x64.cc ('k') | src/x87/code-stubs-x87.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698