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

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

Issue 8832005: Merge r10190 to 3.7 branch: Fix a bug with register use in optimized Math.round. (Closed) Base URL: http://v8.googlecode.com/svn/branches/3.7/
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 3035 matching lines...) Expand 10 before | Expand all | Expand 10 after
3046 3046
3047 // The following conversion will not work with numbers 3047 // The following conversion will not work with numbers
3048 // outside of ]-2^32, 2^32[. 3048 // outside of ]-2^32, 2^32[.
3049 __ cmp(scratch, Operand(HeapNumber::kExponentBias + 32)); 3049 __ cmp(scratch, Operand(HeapNumber::kExponentBias + 32));
3050 DeoptimizeIf(ge, instr->environment()); 3050 DeoptimizeIf(ge, instr->environment());
3051 3051
3052 // Save the original sign for later comparison. 3052 // Save the original sign for later comparison.
3053 __ and_(scratch, result, Operand(HeapNumber::kSignMask)); 3053 __ and_(scratch, result, Operand(HeapNumber::kSignMask));
3054 3054
3055 __ Vmov(double_scratch0(), 0.5); 3055 __ Vmov(double_scratch0(), 0.5);
3056 __ vadd(input, input, double_scratch0()); 3056 __ vadd(double_scratch0(), input, double_scratch0());
3057 3057
3058 // Check sign of the result: if the sign changed, the input 3058 // Check sign of the result: if the sign changed, the input
3059 // value was in ]0.5, 0[ and the result should be -0. 3059 // value was in ]0.5, 0[ and the result should be -0.
3060 __ vmov(result, input.high()); 3060 __ vmov(result, double_scratch0().high());
3061 __ eor(result, result, Operand(scratch), SetCC); 3061 __ eor(result, result, Operand(scratch), SetCC);
3062 if (instr->hydrogen()->CheckFlag(HValue::kBailoutOnMinusZero)) { 3062 if (instr->hydrogen()->CheckFlag(HValue::kBailoutOnMinusZero)) {
3063 DeoptimizeIf(mi, instr->environment()); 3063 DeoptimizeIf(mi, instr->environment());
3064 } else { 3064 } else {
3065 __ mov(result, Operand(0), LeaveCC, mi); 3065 __ mov(result, Operand(0), LeaveCC, mi);
3066 __ b(mi, &done); 3066 __ b(mi, &done);
3067 } 3067 }
3068 3068
3069 __ EmitVFPTruncate(kRoundToMinusInf, 3069 __ EmitVFPTruncate(kRoundToMinusInf,
3070 double_scratch0().low(), 3070 double_scratch0().low(),
3071 input, 3071 double_scratch0(),
3072 result, 3072 result,
3073 scratch); 3073 scratch);
3074 DeoptimizeIf(ne, instr->environment()); 3074 DeoptimizeIf(ne, instr->environment());
3075 __ vmov(result, double_scratch0().low()); 3075 __ vmov(result, double_scratch0().low());
3076 3076
3077 if (instr->hydrogen()->CheckFlag(HValue::kBailoutOnMinusZero)) { 3077 if (instr->hydrogen()->CheckFlag(HValue::kBailoutOnMinusZero)) {
3078 // Test for -0. 3078 // Test for -0.
3079 __ cmp(result, Operand(0)); 3079 __ cmp(result, Operand(0));
3080 __ b(ne, &done); 3080 __ b(ne, &done);
3081 __ bind(&check_sign_on_zero); 3081 __ bind(&check_sign_on_zero);
(...skipping 1617 matching lines...) Expand 10 before | Expand all | Expand 10 after
4699 ASSERT(osr_pc_offset_ == -1); 4699 ASSERT(osr_pc_offset_ == -1);
4700 osr_pc_offset_ = masm()->pc_offset(); 4700 osr_pc_offset_ = masm()->pc_offset();
4701 } 4701 }
4702 4702
4703 4703
4704 4704
4705 4705
4706 #undef __ 4706 #undef __
4707 4707
4708 } } // namespace v8::internal 4708 } } // 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