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

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

Issue 8833010: Merge r10190 to 3.6 branch: Fix a bug with register use in optimized Math.round. (Closed) Base URL: http://v8.googlecode.com/svn/branches/3.6/
Patch Set: Created 9 years 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/ia32/lithium-codegen-ia32.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 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 2974 matching lines...) Expand 10 before | Expand all | Expand 10 after
2985 2985
2986 // The following conversion will not work with numbers 2986 // The following conversion will not work with numbers
2987 // outside of ]-2^32, 2^32[. 2987 // outside of ]-2^32, 2^32[.
2988 __ cmp(scratch, Operand(HeapNumber::kExponentBias + 32)); 2988 __ cmp(scratch, Operand(HeapNumber::kExponentBias + 32));
2989 DeoptimizeIf(ge, instr->environment()); 2989 DeoptimizeIf(ge, instr->environment());
2990 2990
2991 // Save the original sign for later comparison. 2991 // Save the original sign for later comparison.
2992 __ and_(scratch, result, Operand(HeapNumber::kSignMask)); 2992 __ and_(scratch, result, Operand(HeapNumber::kSignMask));
2993 2993
2994 __ Vmov(double_scratch0(), 0.5); 2994 __ Vmov(double_scratch0(), 0.5);
2995 __ vadd(input, input, double_scratch0()); 2995 __ vadd(double_scratch0(), input, double_scratch0());
2996 2996
2997 // Check sign of the result: if the sign changed, the input 2997 // Check sign of the result: if the sign changed, the input
2998 // value was in ]0.5, 0[ and the result should be -0. 2998 // value was in ]0.5, 0[ and the result should be -0.
2999 __ vmov(result, input.high()); 2999 __ vmov(result, double_scratch0().high());
3000 __ eor(result, result, Operand(scratch), SetCC); 3000 __ eor(result, result, Operand(scratch), SetCC);
3001 if (instr->hydrogen()->CheckFlag(HValue::kBailoutOnMinusZero)) { 3001 if (instr->hydrogen()->CheckFlag(HValue::kBailoutOnMinusZero)) {
3002 DeoptimizeIf(mi, instr->environment()); 3002 DeoptimizeIf(mi, instr->environment());
3003 } else { 3003 } else {
3004 __ mov(result, Operand(0), LeaveCC, mi); 3004 __ mov(result, Operand(0), LeaveCC, mi);
3005 __ b(mi, &done); 3005 __ b(mi, &done);
3006 } 3006 }
3007 3007
3008 __ EmitVFPTruncate(kRoundToMinusInf, 3008 __ EmitVFPTruncate(kRoundToMinusInf,
3009 double_scratch0().low(), 3009 double_scratch0().low(),
3010 input, 3010 double_scratch0(),
3011 result, 3011 result,
3012 scratch); 3012 scratch);
3013 DeoptimizeIf(ne, instr->environment()); 3013 DeoptimizeIf(ne, instr->environment());
3014 __ vmov(result, double_scratch0().low()); 3014 __ vmov(result, double_scratch0().low());
3015 3015
3016 if (instr->hydrogen()->CheckFlag(HValue::kBailoutOnMinusZero)) { 3016 if (instr->hydrogen()->CheckFlag(HValue::kBailoutOnMinusZero)) {
3017 // Test for -0. 3017 // Test for -0.
3018 __ cmp(result, Operand(0)); 3018 __ cmp(result, Operand(0));
3019 __ b(ne, &done); 3019 __ b(ne, &done);
3020 __ bind(&check_sign_on_zero); 3020 __ bind(&check_sign_on_zero);
(...skipping 1489 matching lines...) Expand 10 before | Expand all | Expand 10 after
4510 ASSERT(osr_pc_offset_ == -1); 4510 ASSERT(osr_pc_offset_ == -1);
4511 osr_pc_offset_ = masm()->pc_offset(); 4511 osr_pc_offset_ = masm()->pc_offset();
4512 } 4512 }
4513 4513
4514 4514
4515 4515
4516 4516
4517 #undef __ 4517 #undef __
4518 4518
4519 } } // namespace v8::internal 4519 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | src/ia32/lithium-codegen-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698