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

Unified Diff: src/arm/macro-assembler-arm.cc

Issue 12544025: ARM: Tweak ECMAToInt32VFP to address regression on Nexus 4 (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Address nits 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/arm/macro-assembler-arm.cc
diff --git a/src/arm/macro-assembler-arm.cc b/src/arm/macro-assembler-arm.cc
index 0c21731770829628404c961b41f058fe45d45b75..c60e6bbf7e9eae6d1040e912123ac611df4e12cc 100644
--- a/src/arm/macro-assembler-arm.cc
+++ b/src/arm/macro-assembler-arm.cc
@@ -2531,7 +2531,15 @@ void MacroAssembler::ECMAToInt32VFP(Register result,
!scratch.is(input_low));
ASSERT(!double_input.is(double_scratch));
- Label overflow, out_of_range, negate, done;
+ Label out_of_range, negate, done;
+
+ vcvt_s32_f64(double_scratch.low(), double_input);
+ vmov(result, double_scratch.low());
+
+ // If result is not saturated (0x7fffffff or 0x80000000), we are done.
+ sub(scratch, result, Operand(1));
+ cmp(scratch, Operand(0x7ffffffe));
+ b(lt, &done);
vmov(input_low, input_high, double_input);
Ubfx(scratch, input_high,
@@ -2539,20 +2547,9 @@ void MacroAssembler::ECMAToInt32VFP(Register result,
// Load scratch with exponent - 1. This is faster than loading
// with exponent because Bias + 1 = 1024 which is an *ARM* immediate value.
sub(scratch, scratch, Operand(HeapNumber::kExponentBias + 1));
- // Compare exponent with 31 (compare exponent - 1 with 30).
- cmp(scratch, Operand(30));
- b(ge, &overflow);
- // Exponent is less than 31 so vcvt will never saturate.
- // So, just return the result.
- vcvt_s32_f64(double_scratch.low(), double_input);
- vmov(result, double_scratch.low());
- b(&done);
-
- bind(&overflow);
// If exponent is greater than or equal to 84, the 32 less significant
// bits are 0s (2^84 = 1, 52 significant bits, 32 uncoded bits),
// the result is 0.
- // This test also catch Nan and infinities which also return 0.
// Compare exponent with 84 (compare exponent - 1 with 83).
cmp(scratch, Operand(83));
b(ge, &out_of_range);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698