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

Side by Side Diff: src/ia32/lithium-codegen-ia32.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 | « no previous file | src/x64/lithium-codegen-x64.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 3737 matching lines...) Expand 10 before | Expand all | Expand 10 after
3748 ExternalReference::address_of_minus_one_half(); 3748 ExternalReference::address_of_minus_one_half();
3749 bool minus_zero_check = 3749 bool minus_zero_check =
3750 instr->hydrogen()->CheckFlag(HValue::kBailoutOnMinusZero); 3750 instr->hydrogen()->CheckFlag(HValue::kBailoutOnMinusZero);
3751 3751
3752 __ movdbl(xmm_scratch, Operand::StaticVariable(one_half)); 3752 __ movdbl(xmm_scratch, Operand::StaticVariable(one_half));
3753 3753
3754 if (CpuFeatures::IsSupported(SSE4_1) && !minus_zero_check) { 3754 if (CpuFeatures::IsSupported(SSE4_1) && !minus_zero_check) {
3755 CpuFeatures::Scope scope(SSE4_1); 3755 CpuFeatures::Scope scope(SSE4_1);
3756 3756
3757 __ addsd(xmm_scratch, input_reg); 3757 __ addsd(xmm_scratch, input_reg);
3758 __ roundsd(xmm_scratch, input_reg, Assembler::kRoundDown); 3758 __ roundsd(xmm_scratch, xmm_scratch, Assembler::kRoundDown);
3759 __ cvttsd2si(output_reg, Operand(xmm_scratch)); 3759 __ cvttsd2si(output_reg, Operand(xmm_scratch));
3760 // Overflow is signalled with minint. 3760 // Overflow is signalled with minint.
3761 __ cmp(output_reg, 0x80000000u); 3761 __ cmp(output_reg, 0x80000000u);
3762 __ RecordComment("D2I conversion overflow"); 3762 __ RecordComment("D2I conversion overflow");
3763 DeoptimizeIf(equal, instr->environment()); 3763 DeoptimizeIf(equal, instr->environment());
3764 } else { 3764 } else {
3765 Label done, round_to_zero, below_one_half, do_not_compensate; 3765 Label done, round_to_zero, below_one_half, do_not_compensate;
3766 __ ucomisd(xmm_scratch, input_reg); 3766 __ ucomisd(xmm_scratch, input_reg);
3767 __ j(above, &below_one_half); 3767 __ j(above, &below_one_half);
3768 3768
(...skipping 2479 matching lines...) Expand 10 before | Expand all | Expand 10 after
6248 FixedArray::kHeaderSize - kPointerSize)); 6248 FixedArray::kHeaderSize - kPointerSize));
6249 __ bind(&done); 6249 __ bind(&done);
6250 } 6250 }
6251 6251
6252 6252
6253 #undef __ 6253 #undef __
6254 6254
6255 } } // namespace v8::internal 6255 } } // namespace v8::internal
6256 6256
6257 #endif // V8_TARGET_ARCH_IA32 6257 #endif // V8_TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « no previous file | src/x64/lithium-codegen-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698