File tree Expand file tree Collapse file tree 3 files changed +6
-8
lines changed
src/__support/fixed_point Expand file tree Collapse file tree 3 files changed +6
-8
lines changed Original file line number Diff line number Diff line change @@ -185,9 +185,10 @@ countls(T f) {
185185 using BitType = typename FXRep::StorageType;
186186 using FXBits = FXBits<T>;
187187
188- if constexpr (FXRep::SIGN_LEN > 0 )
188+ if constexpr (FXRep::SIGN_LEN > 0 ) {
189189 if (f < 0 )
190190 f = bit_not (f);
191+ }
191192
192193 BitType value_bits = FXBits (f).get_bits ();
193194 return cpp::countl_zero (value_bits) - FXRep::SIGN_LEN;
Original file line number Diff line number Diff line change @@ -83,7 +83,7 @@ foreach(suffix IN ITEMS hr r lr hk k lk uhr ur ulr uhk uk ulk)
8383 SRCS
8484 countls${suffix} _test.cpp
8585 COMPILE_OPTIONS
86- -O3
86+ ${libc_opt_high_flag}
8787 DEPENDS
8888 libc.src.stdfix.countls${suffix}
8989 libc.src.__support.fixed_point.fx_rep
Original file line number Diff line number Diff line change @@ -36,21 +36,18 @@ template <typename T> class CountlsTest : public LIBC_NAMESPACE::testing::Test {
3636 // bits according to ISO/IEC TR 18037.
3737 EXPECT_EQ (is_signed ? 0 : FXRep::VALUE_LEN, func (min));
3838
39- if (10 <= static_cast <int >(max)) {
39+ if (10 <= static_cast <int >(max))
4040 EXPECT_EQ (FXRep::INTEGRAL_LEN - 4 , func (10 ));
41- }
4241
43- if (static_cast <int >(min) <= -10 ) {
42+ if (static_cast <int >(min) <= -10 )
4443 EXPECT_EQ (FXRep::INTEGRAL_LEN - 4 , func (-10 ));
45- }
4644
4745 if constexpr (is_signed) {
4846 EXPECT_EQ (FXRep::VALUE_LEN, func (-zero));
4947 EXPECT_EQ (FXRep::VALUE_LEN, func (-eps));
5048 EXPECT_EQ (FXRep::INTEGRAL_LEN + 1 , func (-one_half));
51- if (FXRep::FRACTION_LEN >= 2 ) {
49+ if (FXRep::FRACTION_LEN >= 2 )
5250 EXPECT_EQ (FXRep::INTEGRAL_LEN + 2 , func (-one_fourth));
53- }
5451 }
5552 }
5653};
You can’t perform that action at this time.
0 commit comments