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

Side by Side Diff: src/assembler.cc

Issue 8831008: Tweaks on Math.pow (ia32 and x64). (Closed) Base URL: https://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/code-stubs-ia32.cc » ('j') | src/ia32/code-stubs-ia32.cc » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 Sun Microsystems Inc. 1 // Copyright (c) 2011 Sun Microsystems Inc.
2 // All Rights Reserved. 2 // All Rights Reserved.
3 // 3 //
4 // Redistribution and use in source and binary forms, with or without 4 // Redistribution and use in source and binary forms, with or without
5 // modification, are permitted provided that the following conditions are 5 // modification, are permitted provided that the following conditions are
6 // met: 6 // met:
7 // 7 //
8 // - Redistributions of source code must retain the above copyright notice, 8 // - Redistributions of source code must retain the above copyright notice,
9 // this list of conditions and the following disclaimer. 9 // this list of conditions and the following disclaimer.
10 // 10 //
(...skipping 1097 matching lines...) Expand 10 before | Expand all | Expand 10 after
1108 m *= m; 1108 m *= m;
1109 n >>= 2; 1109 n >>= 2;
1110 } 1110 }
1111 return p; 1111 return p;
1112 } 1112 }
1113 1113
1114 1114
1115 double power_double_double(double x, double y) { 1115 double power_double_double(double x, double y) {
1116 // The checks for special cases can be dropped in ia32 because it has already 1116 // The checks for special cases can be dropped in ia32 because it has already
1117 // been done in generated code before bailing out here. 1117 // been done in generated code before bailing out here.
1118 #if !defined(V8_TARGET_ARCH_IA32) 1118 if (isnan(y) || ((x == 1 || x == -1) && isinf(y))) return OS::nan_value();
1119 int y_int = static_cast<int>(y);
1120 if (y == y_int) {
1121 return power_double_int(x, y_int); // Returns 1.0 for exponent 0.
1122 }
1123 if (!isinf(x)) {
1124 if (y == 0.5) return sqrt(x + 0.0); // -0 must be converted to +0.
1125 if (y == -0.5) return 1.0 / sqrt(x + 0.0);
1126 }
1127 #endif
1128 if (isnan(y) || ((x == 1 || x == -1) && isinf(y))) {
1129 return OS::nan_value();
1130 }
1131 return pow(x, y); 1119 return pow(x, y);
1132 } 1120 }
1133 1121
1134 1122
1135 ExternalReference ExternalReference::power_double_double_function( 1123 ExternalReference ExternalReference::power_double_double_function(
1136 Isolate* isolate) { 1124 Isolate* isolate) {
1137 return ExternalReference(Redirect(isolate, 1125 return ExternalReference(Redirect(isolate,
1138 FUNCTION_ADDR(power_double_double), 1126 FUNCTION_ADDR(power_double_double),
1139 BUILTIN_FP_FP_CALL)); 1127 BUILTIN_FP_FP_CALL));
1140 } 1128 }
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
1265 assembler_->RecordRelocInfo(RelocInfo::POSITION, state_.current_position); 1253 assembler_->RecordRelocInfo(RelocInfo::POSITION, state_.current_position);
1266 state_.written_position = state_.current_position; 1254 state_.written_position = state_.current_position;
1267 written = true; 1255 written = true;
1268 } 1256 }
1269 1257
1270 // Return whether something was written. 1258 // Return whether something was written.
1271 return written; 1259 return written;
1272 } 1260 }
1273 1261
1274 } } // namespace v8::internal 1262 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | src/ia32/code-stubs-ia32.cc » ('j') | src/ia32/code-stubs-ia32.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698