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

Side by Side Diff: src/assembler.cc

Issue 1584663007: [turbofan] Implement rounding of floats on x64 and ia32 without sse4.1. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: reduced generated code. Created 4 years, 11 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 unified diff | Download patch
« no previous file with comments | « src/assembler.h ('k') | src/compiler/ia32/code-generator-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 (c) 1994-2006 Sun Microsystems Inc. 1 // Copyright (c) 1994-2006 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 131 matching lines...) Expand 10 before | Expand all | Expand 10 after
142 // ----------------------------------------------------------------------------- 142 // -----------------------------------------------------------------------------
143 // Common double constants. 143 // Common double constants.
144 144
145 struct DoubleConstant BASE_EMBEDDED { 145 struct DoubleConstant BASE_EMBEDDED {
146 double min_int; 146 double min_int;
147 double one_half; 147 double one_half;
148 double minus_one_half; 148 double minus_one_half;
149 double negative_infinity; 149 double negative_infinity;
150 double the_hole_nan; 150 double the_hole_nan;
151 double uint32_bias; 151 double uint32_bias;
152 double rounding_limit;
152 }; 153 };
153 154
154 static DoubleConstant double_constants; 155 static DoubleConstant double_constants;
155 156
156 const char* const RelocInfo::kFillerCommentString = "DEOPTIMIZATION PADDING"; 157 const char* const RelocInfo::kFillerCommentString = "DEOPTIMIZATION PADDING";
157 158
158 static bool math_exp_data_initialized = false; 159 static bool math_exp_data_initialized = false;
159 static base::Mutex* math_exp_data_mutex = NULL; 160 static base::Mutex* math_exp_data_mutex = NULL;
160 static double* math_exp_constants_array = NULL; 161 static double* math_exp_constants_array = NULL;
161 static double* math_exp_log_table_array = NULL; 162 static double* math_exp_log_table_array = NULL;
(...skipping 781 matching lines...) Expand 10 before | Expand all | Expand 10 after
943 // Implementation of ExternalReference 944 // Implementation of ExternalReference
944 945
945 void ExternalReference::SetUp() { 946 void ExternalReference::SetUp() {
946 double_constants.min_int = kMinInt; 947 double_constants.min_int = kMinInt;
947 double_constants.one_half = 0.5; 948 double_constants.one_half = 0.5;
948 double_constants.minus_one_half = -0.5; 949 double_constants.minus_one_half = -0.5;
949 double_constants.the_hole_nan = bit_cast<double>(kHoleNanInt64); 950 double_constants.the_hole_nan = bit_cast<double>(kHoleNanInt64);
950 double_constants.negative_infinity = -V8_INFINITY; 951 double_constants.negative_infinity = -V8_INFINITY;
951 double_constants.uint32_bias = 952 double_constants.uint32_bias =
952 static_cast<double>(static_cast<uint32_t>(0xFFFFFFFF)) + 1; 953 static_cast<double>(static_cast<uint32_t>(0xFFFFFFFF)) + 1;
954 // 2^52;
955 double_constants.rounding_limit = 4503599627370496.0;
953 956
954 math_exp_data_mutex = new base::Mutex(); 957 math_exp_data_mutex = new base::Mutex();
955 } 958 }
956 959
957 960
958 void ExternalReference::InitializeMathExpData() { 961 void ExternalReference::InitializeMathExpData() {
959 // Early return? 962 // Early return?
960 if (math_exp_data_initialized) return; 963 if (math_exp_data_initialized) return;
961 964
962 base::LockGuard<base::Mutex> lock_guard(math_exp_data_mutex); 965 base::LockGuard<base::Mutex> lock_guard(math_exp_data_mutex);
(...skipping 307 matching lines...) Expand 10 before | Expand all | Expand 10 after
1270 reinterpret_cast<void*>(&double_constants.the_hole_nan)); 1273 reinterpret_cast<void*>(&double_constants.the_hole_nan));
1271 } 1274 }
1272 1275
1273 1276
1274 ExternalReference ExternalReference::address_of_uint32_bias() { 1277 ExternalReference ExternalReference::address_of_uint32_bias() {
1275 return ExternalReference( 1278 return ExternalReference(
1276 reinterpret_cast<void*>(&double_constants.uint32_bias)); 1279 reinterpret_cast<void*>(&double_constants.uint32_bias));
1277 } 1280 }
1278 1281
1279 1282
1283 ExternalReference ExternalReference::address_of_rounding_limit() {
1284 return ExternalReference(
1285 reinterpret_cast<void*>(&double_constants.rounding_limit));
1286 }
1287
1288
1280 ExternalReference ExternalReference::is_profiling_address(Isolate* isolate) { 1289 ExternalReference ExternalReference::is_profiling_address(Isolate* isolate) {
1281 return ExternalReference(isolate->cpu_profiler()->is_profiling_address()); 1290 return ExternalReference(isolate->cpu_profiler()->is_profiling_address());
1282 } 1291 }
1283 1292
1284 1293
1285 ExternalReference ExternalReference::invoke_function_callback( 1294 ExternalReference ExternalReference::invoke_function_callback(
1286 Isolate* isolate) { 1295 Isolate* isolate) {
1287 Address thunk_address = FUNCTION_ADDR(&InvokeFunctionCallback); 1296 Address thunk_address = FUNCTION_ADDR(&InvokeFunctionCallback);
1288 ExternalReference::Type thunk_type = ExternalReference::PROFILING_API_CALL; 1297 ExternalReference::Type thunk_type = ExternalReference::PROFILING_API_CALL;
1289 ApiFunction thunk_fun(thunk_address); 1298 ApiFunction thunk_fun(thunk_address);
(...skipping 562 matching lines...) Expand 10 before | Expand all | Expand 10 after
1852 1861
1853 1862
1854 void Assembler::DataAlign(int m) { 1863 void Assembler::DataAlign(int m) {
1855 DCHECK(m >= 2 && base::bits::IsPowerOfTwo32(m)); 1864 DCHECK(m >= 2 && base::bits::IsPowerOfTwo32(m));
1856 while ((pc_offset() & (m - 1)) != 0) { 1865 while ((pc_offset() & (m - 1)) != 0) {
1857 db(0); 1866 db(0);
1858 } 1867 }
1859 } 1868 }
1860 } // namespace internal 1869 } // namespace internal
1861 } // namespace v8 1870 } // namespace v8
OLDNEW
« no previous file with comments | « src/assembler.h ('k') | src/compiler/ia32/code-generator-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698