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

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: Created 5 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
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 1440 matching lines...) Expand 10 before | Expand all | Expand 10 after
1451 return ((x == 0.0) ^ (y > 0)) ? V8_INFINITY : 0; 1451 return ((x == 0.0) ^ (y > 0)) ? V8_INFINITY : 0;
1452 } 1452 }
1453 } 1453 }
1454 1454
1455 if (x == 2.0) { 1455 if (x == 2.0) {
1456 int y_int = static_cast<int>(y); 1456 int y_int = static_cast<int>(y);
1457 if (y == y_int) { 1457 if (y == y_int) {
1458 return std::ldexp(1.0, y_int); 1458 return std::ldexp(1.0, y_int);
1459 } 1459 }
1460 } 1460 }
1461 #elif V8_OS_AIX
Sven Panne 2015/01/27 11:47:05 Can we merge this with the case above? If I see th
michael_dawson 2015/01/29 00:08:29 It looks like there are a few other differences in
Sven Panne 2015/01/29 09:54:33 We don't test MINGW builds, either, it was just pa
michael_dawson 2015/01/29 18:21:58 ok will do
1462 // AIX has a custom implementation for pow. This handles certain
1463 // special cases that are different.
1464 if ((x == 0.0 || std::isinf(x)) && y != 0.0 && std::isfinite(y)) {
1465 double f;
1466 double result = ((x == 0.0) ^ (y > 0)) ? V8_INFINITY : 0;
1467 /* retain sign if odd integer exponent */
1468 return ((modf(y, &f) == 0.0) && (static_cast<int64_t>(y) & 1))
1469 ? copysign(result, x)
1470 : result;
1471 }
1472
1473 if (x == 2.0) {
1474 int y_int = static_cast<int>(y);
1475 if (y == y_int) return ldexp(1.0, y_int);
1476 }
1461 #endif 1477 #endif
1462 1478
1463 // The checks for special cases can be dropped in ia32 because it has already 1479 // The checks for special cases can be dropped in ia32 because it has already
1464 // been done in generated code before bailing out here. 1480 // been done in generated code before bailing out here.
1465 if (std::isnan(y) || ((x == 1 || x == -1) && std::isinf(y))) { 1481 if (std::isnan(y) || ((x == 1 || x == -1) && std::isinf(y))) {
1466 return std::numeric_limits<double>::quiet_NaN(); 1482 return std::numeric_limits<double>::quiet_NaN();
1467 } 1483 }
1468 return std::pow(x, y); 1484 return std::pow(x, y);
1469 } 1485 }
1470 1486
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
1588 assembler_->RecordRelocInfo(RelocInfo::POSITION, state_.current_position); 1604 assembler_->RecordRelocInfo(RelocInfo::POSITION, state_.current_position);
1589 state_.written_position = state_.current_position; 1605 state_.written_position = state_.current_position;
1590 written = true; 1606 written = true;
1591 } 1607 }
1592 1608
1593 // Return whether something was written. 1609 // Return whether something was written.
1594 return written; 1610 return written;
1595 } 1611 }
1596 1612
1597 } } // namespace v8::internal 1613 } } // namespace v8::internal
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698