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

Side by Side Diff: src/x64/lithium-codegen-x64.cc

Issue 12388015: Fix math.round with SSE4.1. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 9 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/ia32/lithium-codegen-ia32.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 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 3525 matching lines...) Expand 10 before | Expand all | Expand 10 after
3536 3536
3537 bool minus_zero_check = 3537 bool minus_zero_check =
3538 instr->hydrogen()->CheckFlag(HValue::kBailoutOnMinusZero); 3538 instr->hydrogen()->CheckFlag(HValue::kBailoutOnMinusZero);
3539 3539
3540 __ movq(kScratchRegister, one_half, RelocInfo::NONE64); 3540 __ movq(kScratchRegister, one_half, RelocInfo::NONE64);
3541 __ movq(xmm_scratch, kScratchRegister); 3541 __ movq(xmm_scratch, kScratchRegister);
3542 3542
3543 if (CpuFeatures::IsSupported(SSE4_1) && !minus_zero_check) { 3543 if (CpuFeatures::IsSupported(SSE4_1) && !minus_zero_check) {
3544 CpuFeatures::Scope scope(SSE4_1); 3544 CpuFeatures::Scope scope(SSE4_1);
3545 __ addsd(xmm_scratch, input_reg); 3545 __ addsd(xmm_scratch, input_reg);
3546 __ roundsd(xmm_scratch, input_reg, Assembler::kRoundDown); 3546 __ roundsd(xmm_scratch, xmm_scratch, Assembler::kRoundDown);
3547 __ cvttsd2si(output_reg, xmm_scratch); 3547 __ cvttsd2si(output_reg, xmm_scratch);
3548 // Overflow is signalled with minint. 3548 // Overflow is signalled with minint.
3549 __ cmpl(output_reg, Immediate(0x80000000)); 3549 __ cmpl(output_reg, Immediate(0x80000000));
3550 __ RecordComment("D2I conversion overflow"); 3550 __ RecordComment("D2I conversion overflow");
3551 DeoptimizeIf(equal, instr->environment()); 3551 DeoptimizeIf(equal, instr->environment());
3552 } else { 3552 } else {
3553 Label done, round_to_zero, below_one_half, do_not_compensate; 3553 Label done, round_to_zero, below_one_half, do_not_compensate;
3554 __ ucomisd(xmm_scratch, input_reg); 3554 __ ucomisd(xmm_scratch, input_reg);
3555 __ j(above, &below_one_half); 3555 __ j(above, &below_one_half);
3556 3556
(...skipping 2265 matching lines...) Expand 10 before | Expand all | Expand 10 after
5822 FixedArray::kHeaderSize - kPointerSize)); 5822 FixedArray::kHeaderSize - kPointerSize));
5823 __ bind(&done); 5823 __ bind(&done);
5824 } 5824 }
5825 5825
5826 5826
5827 #undef __ 5827 #undef __
5828 5828
5829 } } // namespace v8::internal 5829 } } // namespace v8::internal
5830 5830
5831 #endif // V8_TARGET_ARCH_X64 5831 #endif // V8_TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « src/ia32/lithium-codegen-ia32.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698