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

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

Issue 8833007: Fix a bug with register use in optimized Math.round. (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
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 3041 matching lines...) Expand 10 before | Expand all | Expand 10 after
3052 3052
3053 // The following conversion will not work with numbers 3053 // The following conversion will not work with numbers
3054 // outside of ]-2^32, 2^32[. 3054 // outside of ]-2^32, 2^32[.
3055 __ cmp(scratch, Operand(HeapNumber::kExponentBias + 32)); 3055 __ cmp(scratch, Operand(HeapNumber::kExponentBias + 32));
3056 DeoptimizeIf(ge, instr->environment()); 3056 DeoptimizeIf(ge, instr->environment());
3057 3057
3058 // Save the original sign for later comparison. 3058 // Save the original sign for later comparison.
3059 __ and_(scratch, result, Operand(HeapNumber::kSignMask)); 3059 __ and_(scratch, result, Operand(HeapNumber::kSignMask));
3060 3060
3061 __ Vmov(double_scratch0(), 0.5); 3061 __ Vmov(double_scratch0(), 0.5);
3062 __ vadd(input, input, double_scratch0()); 3062 __ vadd(double_scratch0(), input, double_scratch0());
3063 3063
3064 // Check sign of the result: if the sign changed, the input 3064 // Check sign of the result: if the sign changed, the input
3065 // value was in ]0.5, 0[ and the result should be -0. 3065 // value was in ]0.5, 0[ and the result should be -0.
3066 __ vmov(result, input.high()); 3066 __ vmov(result, double_scratch0().high());
3067 __ eor(result, result, Operand(scratch), SetCC); 3067 __ eor(result, result, Operand(scratch), SetCC);
3068 if (instr->hydrogen()->CheckFlag(HValue::kBailoutOnMinusZero)) { 3068 if (instr->hydrogen()->CheckFlag(HValue::kBailoutOnMinusZero)) {
3069 DeoptimizeIf(mi, instr->environment()); 3069 DeoptimizeIf(mi, instr->environment());
3070 } else { 3070 } else {
3071 __ mov(result, Operand(0), LeaveCC, mi); 3071 __ mov(result, Operand(0), LeaveCC, mi);
3072 __ b(mi, &done); 3072 __ b(mi, &done);
3073 } 3073 }
3074 3074
3075 __ EmitVFPTruncate(kRoundToMinusInf, 3075 __ EmitVFPTruncate(kRoundToMinusInf,
3076 double_scratch0().low(), 3076 double_scratch0().low(),
3077 input, 3077 double_scratch0(),
3078 result, 3078 result,
3079 scratch); 3079 scratch);
3080 DeoptimizeIf(ne, instr->environment()); 3080 DeoptimizeIf(ne, instr->environment());
3081 __ vmov(result, double_scratch0().low()); 3081 __ vmov(result, double_scratch0().low());
3082 3082
3083 if (instr->hydrogen()->CheckFlag(HValue::kBailoutOnMinusZero)) { 3083 if (instr->hydrogen()->CheckFlag(HValue::kBailoutOnMinusZero)) {
3084 // Test for -0. 3084 // Test for -0.
3085 __ cmp(result, Operand(0)); 3085 __ cmp(result, Operand(0));
3086 __ b(ne, &done); 3086 __ b(ne, &done);
3087 __ bind(&check_sign_on_zero); 3087 __ bind(&check_sign_on_zero);
(...skipping 1641 matching lines...) Expand 10 before | Expand all | Expand 10 after
4729 ASSERT(osr_pc_offset_ == -1); 4729 ASSERT(osr_pc_offset_ == -1);
4730 osr_pc_offset_ = masm()->pc_offset(); 4730 osr_pc_offset_ = masm()->pc_offset();
4731 } 4731 }
4732 4732
4733 4733
4734 4734
4735 4735
4736 #undef __ 4736 #undef __
4737 4737
4738 } } // namespace v8::internal 4738 } } // 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