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

Side by Side Diff: src/assembler.cc

Issue 866843003: Contribution of PowerPC port (continuation of 422063005) - AIX Common1 (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Address second set of comments Created 5 years, 10 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
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 1423 matching lines...) Expand 10 before | Expand all | Expand 10 after
1434 m *= m; 1434 m *= m;
1435 if ((n & 2) != 0) p *= m; 1435 if ((n & 2) != 0) p *= m;
1436 m *= m; 1436 m *= m;
1437 n >>= 2; 1437 n >>= 2;
1438 } 1438 }
1439 return p; 1439 return p;
1440 } 1440 }
1441 1441
1442 1442
1443 double power_double_double(double x, double y) { 1443 double power_double_double(double x, double y) {
1444 #if defined(__MINGW64_VERSION_MAJOR) && \ 1444 #if (defined(__MINGW64_VERSION_MAJOR) && \
1445 (!defined(__MINGW64_VERSION_RC) || __MINGW64_VERSION_RC < 1) 1445 (!defined(__MINGW64_VERSION_RC) || __MINGW64_VERSION_RC < 1)) || \
1446 // MinGW64 has a custom implementation for pow. This handles certain 1446 defined(V8_OS_AIX)
1447 // MinGW64 and AIX have a custom implementation for pow. This handles certain
1447 // special cases that are different. 1448 // special cases that are different.
1448 if ((x == 0.0 || std::isinf(x)) && std::isfinite(y)) { 1449 if ((x == 0.0 || std::isinf(x)) && y != 0.0 && std::isfinite(y)) {
1449 double f; 1450 double f;
1450 if (std::modf(y, &f) != 0.0) { 1451 double result = ((x == 0.0) ^ (y > 0)) ? V8_INFINITY : 0;
1451 return ((x == 0.0) ^ (y > 0)) ? V8_INFINITY : 0; 1452 /* retain sign if odd integer exponent */
1452 } 1453 return ((std::modf(y, &f) == 0.0) && (static_cast<int64_t>(y) & 1))
1454 ? copysign(result, x)
1455 : result;
1453 } 1456 }
1454 1457
1455 if (x == 2.0) { 1458 if (x == 2.0) {
1456 int y_int = static_cast<int>(y); 1459 int y_int = static_cast<int>(y);
1457 if (y == y_int) { 1460 if (y == y_int) {
1458 return std::ldexp(1.0, y_int); 1461 return std::ldexp(1.0, y_int);
1459 } 1462 }
1460 } 1463 }
1461 #endif 1464 #endif
1462 1465
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after
1588 assembler_->RecordRelocInfo(RelocInfo::POSITION, state_.current_position); 1591 assembler_->RecordRelocInfo(RelocInfo::POSITION, state_.current_position);
1589 state_.written_position = state_.current_position; 1592 state_.written_position = state_.current_position;
1590 written = true; 1593 written = true;
1591 } 1594 }
1592 1595
1593 // Return whether something was written. 1596 // Return whether something was written.
1594 return written; 1597 return written;
1595 } 1598 }
1596 1599
1597 } } // namespace v8::internal 1600 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « include/v8config.h ('k') | src/base/atomicops.h » ('j') | src/serialize.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698