Changeset 243544 in webkit
- Timestamp:
- Mar 27, 2019, 9:12:22 AM (7 years ago)
- Location:
- trunk
- Files:
-
- 4 edited
-
LayoutTests/ChangeLog (modified) (1 diff)
-
LayoutTests/platform/win/TestExpectations (modified) (1 diff)
-
Source/WTF/ChangeLog (modified) (1 diff)
-
Source/WTF/wtf/MathExtras.h (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r243539 r243544 1 2019-03-27 Per Arne Vollan <pvollan@apple.com> 2 3 Layout Test js/math-clz32.html is failing 4 https://bugs.webkit.org/show_bug.cgi?id=196209 5 6 Reviewed by Ross Kirsling. 7 8 * platform/win/TestExpectations: 9 1 10 2019-03-26 Simon Fraser <simon.fraser@apple.com> 2 11 -
trunk/LayoutTests/platform/win/TestExpectations
r243515 r243544 4304 4304 webkit.org/b/195461 http/tests/referrer-policy-iframe/unsafe-url/cross-origin-http.https.html [ Failure ] 4305 4305 4306 webkit.org/b/196209 js/math-clz32.html [ Failure ] -
trunk/Source/WTF/ChangeLog
r243524 r243544 1 2019-03-27 Per Arne Vollan <pvollan@apple.com> 2 3 Layout Test js/math-clz32.html is failing 4 https://bugs.webkit.org/show_bug.cgi?id=196209 5 6 Reviewed by Ross Kirsling. 7 8 Use the correct number of loop iterations when counting leading zeros. Also, the 9 count was off by one for the Win64 case. 10 11 * wtf/MathExtras.h: 12 (WTF::clz): 13 1 14 2019-03-26 Keith Rollin <krollin@apple.com> 2 15 -
trunk/Source/WTF/wtf/MathExtras.h
r243429 r243544 620 620 { 621 621 constexpr unsigned bitSize = sizeof(T) * CHAR_BIT; 622 constexpr unsigned bitSize64 = sizeof(uint64_t) * CHAR_BIT;623 622 624 623 using UT = typename std::make_unsigned<T>::type; … … 626 625 627 626 #if COMPILER(GCC_COMPATIBLE) 627 constexpr unsigned bitSize64 = sizeof(uint64_t) * CHAR_BIT; 628 628 if (uValue) 629 629 return __builtin_clzll(uValue) - (bitSize64 - bitSize); … … 635 635 unsigned long ret = 0; 636 636 if (_BitScanReverse64(&ret, uValue)) 637 return bitSize - ret;637 return bitSize - 1 - ret; 638 638 return bitSize; 639 639 #else 640 640 unsigned zeroCount = 0; 641 for (int i = bitSize64 - 1; i >= 0; i--) { 642 if (!(static_cast<uint64_t>(uValue) >> i)) 643 zeroCount++; 644 else 641 for (int i = bitSize - 1; i >= 0; i--) { 642 if (uValue >> i) 645 643 break; 644 zeroCount++; 646 645 } 647 646 return zeroCount;
Note:
See TracChangeset
for help on using the changeset viewer.