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

Side by Side Diff: src/assembler.cc

Issue 2065503002: [builtins] Introduce proper Float64Atan and Float64Atan2 operators. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: [WIP] Fix GCC/Win32. Created 4 years, 6 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/base/ieee754.h » ('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 1305 matching lines...) Expand 10 before | Expand all | Expand 10 after
1316 static void f64_asin_wrapper(double* param) { 1316 static void f64_asin_wrapper(double* param) {
1317 WriteDoubleValue(param, std::asin(ReadDoubleValue(param))); 1317 WriteDoubleValue(param, std::asin(ReadDoubleValue(param)));
1318 } 1318 }
1319 1319
1320 ExternalReference ExternalReference::f64_asin_wrapper_function( 1320 ExternalReference ExternalReference::f64_asin_wrapper_function(
1321 Isolate* isolate) { 1321 Isolate* isolate) {
1322 return ExternalReference(Redirect(isolate, FUNCTION_ADDR(f64_asin_wrapper))); 1322 return ExternalReference(Redirect(isolate, FUNCTION_ADDR(f64_asin_wrapper)));
1323 } 1323 }
1324 1324
1325 static void f64_atan_wrapper(double* param) { 1325 static void f64_atan_wrapper(double* param) {
1326 WriteDoubleValue(param, std::atan(ReadDoubleValue(param))); 1326 WriteDoubleValue(param, base::ieee754::atan(ReadDoubleValue(param)));
1327 } 1327 }
1328 1328
1329 ExternalReference ExternalReference::f64_atan_wrapper_function( 1329 ExternalReference ExternalReference::f64_atan_wrapper_function(
1330 Isolate* isolate) { 1330 Isolate* isolate) {
1331 return ExternalReference(Redirect(isolate, FUNCTION_ADDR(f64_atan_wrapper))); 1331 return ExternalReference(Redirect(isolate, FUNCTION_ADDR(f64_atan_wrapper)));
1332 } 1332 }
1333 1333
1334 static void f64_cos_wrapper(double* param) { 1334 static void f64_cos_wrapper(double* param) {
1335 WriteDoubleValue(param, std::cos(ReadDoubleValue(param))); 1335 WriteDoubleValue(param, std::cos(ReadDoubleValue(param)));
1336 } 1336 }
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
1385 static const double kPiDividedBy4 = 0.78539816339744830962; 1385 static const double kPiDividedBy4 = 0.78539816339744830962;
1386 if (std::isinf(x) && std::isinf(y)) { 1386 if (std::isinf(x) && std::isinf(y)) {
1387 // Make sure that the result in case of two infinite arguments 1387 // Make sure that the result in case of two infinite arguments
1388 // is a multiple of Pi / 4. The sign of the result is determined 1388 // is a multiple of Pi / 4. The sign of the result is determined
1389 // by the first argument (x) and the sign of the second argument 1389 // by the first argument (x) and the sign of the second argument
1390 // determines the multiplier: one or three. 1390 // determines the multiplier: one or three.
1391 int multiplier = (x < 0) ? -1 : 1; 1391 int multiplier = (x < 0) ? -1 : 1;
1392 if (y < 0) multiplier *= 3; 1392 if (y < 0) multiplier *= 3;
1393 WriteDoubleValue(param0, multiplier * kPiDividedBy4); 1393 WriteDoubleValue(param0, multiplier * kPiDividedBy4);
1394 } else { 1394 } else {
1395 WriteDoubleValue(param0, std::atan2(x, y)); 1395 WriteDoubleValue(param0, base::ieee754::atan2(x, y));
1396 } 1396 }
1397 } 1397 }
1398 1398
1399 ExternalReference ExternalReference::f64_atan2_wrapper_function( 1399 ExternalReference ExternalReference::f64_atan2_wrapper_function(
1400 Isolate* isolate) { 1400 Isolate* isolate) {
1401 return ExternalReference(Redirect(isolate, FUNCTION_ADDR(f64_atan2_wrapper))); 1401 return ExternalReference(Redirect(isolate, FUNCTION_ADDR(f64_atan2_wrapper)));
1402 } 1402 }
1403 1403
1404 static void f64_mod_wrapper(double* param0, double* param1) { 1404 static void f64_mod_wrapper(double* param0, double* param1) {
1405 WriteDoubleValue(param0, 1405 WriteDoubleValue(param0,
(...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after
1641 isolate->regexp_stack()->memory_address()); 1641 isolate->regexp_stack()->memory_address());
1642 } 1642 }
1643 1643
1644 ExternalReference ExternalReference::address_of_regexp_stack_memory_size( 1644 ExternalReference ExternalReference::address_of_regexp_stack_memory_size(
1645 Isolate* isolate) { 1645 Isolate* isolate) {
1646 return ExternalReference(isolate->regexp_stack()->memory_size_address()); 1646 return ExternalReference(isolate->regexp_stack()->memory_size_address());
1647 } 1647 }
1648 1648
1649 #endif // V8_INTERPRETED_REGEXP 1649 #endif // V8_INTERPRETED_REGEXP
1650 1650
1651 ExternalReference ExternalReference::ieee754_atan_function(Isolate* isolate) {
1652 return ExternalReference(
1653 Redirect(isolate, FUNCTION_ADDR(base::ieee754::atan), BUILTIN_FP_CALL));
1654 }
1655
1656 ExternalReference ExternalReference::ieee754_atan2_function(Isolate* isolate) {
1657 return ExternalReference(Redirect(
1658 isolate, FUNCTION_ADDR(base::ieee754::atan2), BUILTIN_FP_FP_CALL));
1659 }
1660
1651 ExternalReference ExternalReference::ieee754_log_function(Isolate* isolate) { 1661 ExternalReference ExternalReference::ieee754_log_function(Isolate* isolate) {
1652 return ExternalReference( 1662 return ExternalReference(
1653 Redirect(isolate, FUNCTION_ADDR(base::ieee754::log), BUILTIN_FP_CALL)); 1663 Redirect(isolate, FUNCTION_ADDR(base::ieee754::log), BUILTIN_FP_CALL));
1654 } 1664 }
1655 1665
1656 ExternalReference ExternalReference::ieee754_log1p_function(Isolate* isolate) { 1666 ExternalReference ExternalReference::ieee754_log1p_function(Isolate* isolate) {
1657 return ExternalReference( 1667 return ExternalReference(
1658 Redirect(isolate, FUNCTION_ADDR(base::ieee754::log1p), BUILTIN_FP_CALL)); 1668 Redirect(isolate, FUNCTION_ADDR(base::ieee754::log1p), BUILTIN_FP_CALL));
1659 } 1669 }
1660 1670
(...skipping 456 matching lines...) Expand 10 before | Expand all | Expand 10 after
2117 2127
2118 2128
2119 void Assembler::DataAlign(int m) { 2129 void Assembler::DataAlign(int m) {
2120 DCHECK(m >= 2 && base::bits::IsPowerOfTwo32(m)); 2130 DCHECK(m >= 2 && base::bits::IsPowerOfTwo32(m));
2121 while ((pc_offset() & (m - 1)) != 0) { 2131 while ((pc_offset() & (m - 1)) != 0) {
2122 db(0); 2132 db(0);
2123 } 2133 }
2124 } 2134 }
2125 } // namespace internal 2135 } // namespace internal
2126 } // namespace v8 2136 } // namespace v8
OLDNEW
« no previous file with comments | « src/assembler.h ('k') | src/base/ieee754.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698