Skip to content
Permalink
Browse files

8238909: x86_32 fails gtest:power_of_2

Reviewed-by: stefank, redestad
  • Loading branch information
shipilev committed Feb 13, 2020
1 parent d298a05 commit 18b31b1f0230cf345c3a3c613106d8e607fc27cf
Showing with 3 additions and 2 deletions.
  1. +3 −2 src/hotspot/share/utilities/powerOfTwo.hpp
@@ -28,6 +28,7 @@
#include "metaprogramming/enableIf.hpp"
#include "metaprogramming/isIntegral.hpp"
#include "metaprogramming/isSigned.hpp"
#include "utilities/align.hpp"
#include "utilities/count_leading_zeros.hpp"
#include "utilities/debug.hpp"
#include "utilities/globalDefinitions.hpp"
@@ -68,7 +69,7 @@ inline typename EnableIf<IsSigned<T>::value, T>::type round_up_power_of_2(T valu
STATIC_ASSERT(IsIntegral<T>::value);
STATIC_ASSERT(IsSigned<T>::value);
assert(value > 0, "Invalid value");
if (is_power_of_2(value)) {
if (is_power_of_2_t(value)) {
return value;
}
uint32_t lz = count_leading_zeros(value);
@@ -84,7 +85,7 @@ inline typename EnableIf<!IsSigned<T>::value, T>::type round_up_power_of_2(T val
STATIC_ASSERT(IsIntegral<T>::value);
STATIC_ASSERT(!IsSigned<T>::value);
assert(value != 0, "Invalid value");
if (is_power_of_2(value)) {
if (is_power_of_2_t(value)) {
return value;
}
uint32_t lz = count_leading_zeros(value);

0 comments on commit 18b31b1

Please sign in to comment.