| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| //===-- Implementation header for kbits -------------------------*- C++ -*-===// | ||
| // | ||
| // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | ||
| // See https://llvm.org/LICENSE.txt for license information. | ||
| // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | ||
| // | ||
| //===----------------------------------------------------------------------===// | ||
|
|
||
| #ifndef LLVM_LIBC_SRC_STDFIX_KBITS_H | ||
| #define LLVM_LIBC_SRC_STDFIX_KBITS_H | ||
|
|
||
| #include "include/llvm-libc-macros/stdfix-macros.h" | ||
| #include "include/llvm-libc-types/stdfix-types.h" | ||
| #include "src/__support/macros/config.h" | ||
|
|
||
| namespace LIBC_NAMESPACE_DECL { | ||
|
|
||
| accum kbits(int_k_t x); | ||
|
|
||
| } // namespace LIBC_NAMESPACE_DECL | ||
|
|
||
| #endif // LLVM_LIBC_SRC_STDFIX_KBITS_H |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| //===-- Implementation of lkbits function ---------------------------------===// | ||
| // | ||
| // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | ||
| // See https://llvm.org/LICENSE.txt for license information. | ||
| // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | ||
| // | ||
| //===----------------------------------------------------------------------===// | ||
|
|
||
| #include "lkbits.h" | ||
| #include "src/__support/common.h" | ||
| #include "src/__support/fixed_point/fx_bits.h" | ||
| #include "src/__support/macros/config.h" | ||
|
|
||
| namespace LIBC_NAMESPACE_DECL { | ||
| LLVM_LIBC_FUNCTION(long accum, lkbits, (int_lk_t x)) { | ||
| return cpp::bit_cast<long accum, int_lk_t>(x); | ||
| } | ||
|
|
||
| } // namespace LIBC_NAMESPACE_DECL |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| //===-- Implementation header for lkbits ------------------------*- C++ -*-===// | ||
| // | ||
| // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | ||
| // See https://llvm.org/LICENSE.txt for license information. | ||
| // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | ||
| // | ||
| //===----------------------------------------------------------------------===// | ||
|
|
||
| #ifndef LLVM_LIBC_SRC_STDFIX_LKBITS_H | ||
| #define LLVM_LIBC_SRC_STDFIX_LKBITS_H | ||
|
|
||
| #include "include/llvm-libc-macros/stdfix-macros.h" | ||
| #include "include/llvm-libc-types/stdfix-types.h" | ||
| #include "src/__support/macros/config.h" | ||
|
|
||
| namespace LIBC_NAMESPACE_DECL { | ||
|
|
||
| long accum lkbits(int_lk_t x); | ||
|
|
||
| } // namespace LIBC_NAMESPACE_DECL | ||
|
|
||
| #endif // LLVM_LIBC_SRC_STDFIX_LKBITS_H |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| //===-- Implementation of lrbits function ---------------------------------===// | ||
| // | ||
| // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | ||
| // See https://llvm.org/LICENSE.txt for license information. | ||
| // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | ||
| // | ||
| //===----------------------------------------------------------------------===// | ||
|
|
||
| #include "lrbits.h" | ||
| #include "src/__support/common.h" | ||
| #include "src/__support/fixed_point/fx_bits.h" | ||
| #include "src/__support/macros/config.h" | ||
|
|
||
| namespace LIBC_NAMESPACE_DECL { | ||
| LLVM_LIBC_FUNCTION(long fract, lrbits, (int_lr_t x)) { | ||
| return cpp::bit_cast<long fract, int_lr_t>(x); | ||
| } | ||
|
|
||
| } // namespace LIBC_NAMESPACE_DECL |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| //===-- Implementation header for lrbits ------------------------*- C++ -*-===// | ||
| // | ||
| // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | ||
| // See https://llvm.org/LICENSE.txt for license information. | ||
| // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | ||
| // | ||
| //===----------------------------------------------------------------------===// | ||
|
|
||
| #ifndef LLVM_LIBC_SRC_STDFIX_LRBITS_H | ||
| #define LLVM_LIBC_SRC_STDFIX_LRBITS_H | ||
|
|
||
| #include "include/llvm-libc-macros/stdfix-macros.h" | ||
| #include "include/llvm-libc-types/stdfix-types.h" | ||
| #include "src/__support/macros/config.h" | ||
|
|
||
| namespace LIBC_NAMESPACE_DECL { | ||
|
|
||
| long fract lrbits(int_lr_t x); | ||
|
|
||
| } // namespace LIBC_NAMESPACE_DECL | ||
|
|
||
| #endif // LLVM_LIBC_SRC_STDFIX_LRBITS_H |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| //===-- Implementation of rbits function ----------------------------------===// | ||
| // | ||
| // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | ||
| // See https://llvm.org/LICENSE.txt for license information. | ||
| // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | ||
| // | ||
| //===----------------------------------------------------------------------===// | ||
|
|
||
| #include "rbits.h" | ||
| #include "src/__support/common.h" | ||
| #include "src/__support/fixed_point/fx_bits.h" | ||
| #include "src/__support/macros/config.h" | ||
|
|
||
| namespace LIBC_NAMESPACE_DECL { | ||
| LLVM_LIBC_FUNCTION(fract, rbits, (int_r_t x)) { | ||
| return cpp::bit_cast<fract, int_r_t>(x); | ||
| } | ||
|
|
||
| } // namespace LIBC_NAMESPACE_DECL |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| //===-- Implementation header for rbits -------------------------*- C++ -*-===// | ||
| // | ||
| // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | ||
| // See https://llvm.org/LICENSE.txt for license information. | ||
| // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | ||
| // | ||
| //===----------------------------------------------------------------------===// | ||
|
|
||
| #ifndef LLVM_LIBC_SRC_STDFIX_RBITS_H | ||
| #define LLVM_LIBC_SRC_STDFIX_RBITS_H | ||
|
|
||
| #include "include/llvm-libc-macros/stdfix-macros.h" | ||
| #include "include/llvm-libc-types/stdfix-types.h" | ||
| #include "src/__support/macros/config.h" | ||
|
|
||
| namespace LIBC_NAMESPACE_DECL { | ||
|
|
||
| fract rbits(int_r_t x); | ||
|
|
||
| } // namespace LIBC_NAMESPACE_DECL | ||
|
|
||
| #endif // LLVM_LIBC_SRC_STDFIX_RBITS_H |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| //===-- Implementation of uhkbits function --------------------------------===// | ||
| // | ||
| // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | ||
| // See https://llvm.org/LICENSE.txt for license information. | ||
| // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | ||
| // | ||
| //===----------------------------------------------------------------------===// | ||
|
|
||
| #include "uhkbits.h" | ||
| #include "src/__support/common.h" | ||
| #include "src/__support/fixed_point/fx_bits.h" | ||
| #include "src/__support/macros/config.h" | ||
|
|
||
| namespace LIBC_NAMESPACE_DECL { | ||
| LLVM_LIBC_FUNCTION(unsigned short accum, uhkbits, (uint_uhk_t x)) { | ||
| return cpp::bit_cast<unsigned short accum, uint_uhk_t>(x); | ||
| } | ||
|
|
||
| } // namespace LIBC_NAMESPACE_DECL |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| //===-- Implementation header for uhkbits -----------------------*- C++ -*-===// | ||
| // | ||
| // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | ||
| // See https://llvm.org/LICENSE.txt for license information. | ||
| // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | ||
| // | ||
| //===----------------------------------------------------------------------===// | ||
|
|
||
| #ifndef LLVM_LIBC_SRC_STDFIX_UHKBITS_H | ||
| #define LLVM_LIBC_SRC_STDFIX_UHKBITS_H | ||
|
|
||
| #include "include/llvm-libc-macros/stdfix-macros.h" | ||
| #include "include/llvm-libc-types/stdfix-types.h" | ||
| #include "src/__support/macros/config.h" | ||
|
|
||
| namespace LIBC_NAMESPACE_DECL { | ||
|
|
||
| unsigned short accum uhkbits(uint_uhk_t x); | ||
|
|
||
| } // namespace LIBC_NAMESPACE_DECL | ||
|
|
||
| #endif // LLVM_LIBC_SRC_STDFIX_UHKBITS_H |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| //===-- Implementation of uhrbits function --------------------------------===// | ||
| // | ||
| // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | ||
| // See https://llvm.org/LICENSE.txt for license information. | ||
| // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | ||
| // | ||
| //===----------------------------------------------------------------------===// | ||
|
|
||
| #include "uhrbits.h" | ||
| #include "src/__support/common.h" | ||
| #include "src/__support/fixed_point/fx_bits.h" | ||
| #include "src/__support/macros/config.h" | ||
|
|
||
| namespace LIBC_NAMESPACE_DECL { | ||
| LLVM_LIBC_FUNCTION(unsigned short fract, uhrbits, (uint_uhr_t x)) { | ||
| return cpp::bit_cast<unsigned short fract, uint_uhr_t>(x); | ||
| } | ||
|
|
||
| } // namespace LIBC_NAMESPACE_DECL |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| //===-- Implementation header for uhrbits -----------------------*- C++ -*-===// | ||
| // | ||
| // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | ||
| // See https://llvm.org/LICENSE.txt for license information. | ||
| // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | ||
| // | ||
| //===----------------------------------------------------------------------===// | ||
|
|
||
| #ifndef LLVM_LIBC_SRC_STDFIX_UHRBITS_H | ||
| #define LLVM_LIBC_SRC_STDFIX_UHRBITS_H | ||
|
|
||
| #include "include/llvm-libc-macros/stdfix-macros.h" | ||
| #include "include/llvm-libc-types/stdfix-types.h" | ||
| #include "src/__support/macros/config.h" | ||
|
|
||
| namespace LIBC_NAMESPACE_DECL { | ||
|
|
||
| unsigned short fract uhrbits(uint_uhr_t x); | ||
|
|
||
| } // namespace LIBC_NAMESPACE_DECL | ||
|
|
||
| #endif // LLVM_LIBC_SRC_STDFIX_UHRBITS_H |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| //===-- Implementation of ukbits function ---------------------------------===// | ||
| // | ||
| // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | ||
| // See https://llvm.org/LICENSE.txt for license information. | ||
| // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | ||
| // | ||
| //===----------------------------------------------------------------------===// | ||
|
|
||
| #include "ukbits.h" | ||
| #include "src/__support/common.h" | ||
| #include "src/__support/fixed_point/fx_bits.h" | ||
| #include "src/__support/macros/config.h" | ||
|
|
||
| namespace LIBC_NAMESPACE_DECL { | ||
| LLVM_LIBC_FUNCTION(unsigned accum, ukbits, (uint_uk_t x)) { | ||
| return cpp::bit_cast<unsigned accum, uint_uk_t>(x); | ||
| } | ||
|
|
||
| } // namespace LIBC_NAMESPACE_DECL |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| //===-- Implementation header for ukbits ------------------------*- C++ -*-===// | ||
| // | ||
| // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | ||
| // See https://llvm.org/LICENSE.txt for license information. | ||
| // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | ||
| // | ||
| //===----------------------------------------------------------------------===// | ||
|
|
||
| #ifndef LLVM_LIBC_SRC_STDFIX_UKBITS_H | ||
| #define LLVM_LIBC_SRC_STDFIX_UKBITS_H | ||
|
|
||
| #include "include/llvm-libc-macros/stdfix-macros.h" | ||
| #include "include/llvm-libc-types/stdfix-types.h" | ||
| #include "src/__support/macros/config.h" | ||
|
|
||
| namespace LIBC_NAMESPACE_DECL { | ||
|
|
||
| unsigned accum ukbits(uint_uk_t x); | ||
|
|
||
| } // namespace LIBC_NAMESPACE_DECL | ||
|
|
||
| #endif // LLVM_LIBC_SRC_STDFIX_UKBITS_H |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| //===-- Implementation of ulkbits function --------------------------------===// | ||
| // | ||
| // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | ||
| // See https://llvm.org/LICENSE.txt for license information. | ||
| // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | ||
| // | ||
| //===----------------------------------------------------------------------===// | ||
|
|
||
| #include "ulkbits.h" | ||
| #include "src/__support/common.h" | ||
| #include "src/__support/fixed_point/fx_bits.h" | ||
| #include "src/__support/macros/config.h" | ||
|
|
||
| namespace LIBC_NAMESPACE_DECL { | ||
| LLVM_LIBC_FUNCTION(unsigned long accum, ulkbits, (uint_ulk_t x)) { | ||
| return cpp::bit_cast<unsigned long accum, uint_ulk_t>(x); | ||
| } | ||
|
|
||
| } // namespace LIBC_NAMESPACE_DECL |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| //===-- Implementation header for ulkbits -----------------------*- C++ -*-===// | ||
| // | ||
| // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | ||
| // See https://llvm.org/LICENSE.txt for license information. | ||
| // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | ||
| // | ||
| //===----------------------------------------------------------------------===// | ||
|
|
||
| #ifndef LLVM_LIBC_SRC_STDFIX_ULKBITS_H | ||
| #define LLVM_LIBC_SRC_STDFIX_ULKBITS_H | ||
|
|
||
| #include "include/llvm-libc-macros/stdfix-macros.h" | ||
| #include "include/llvm-libc-types/stdfix-types.h" | ||
| #include "src/__support/macros/config.h" | ||
|
|
||
| namespace LIBC_NAMESPACE_DECL { | ||
|
|
||
| unsigned long accum ulkbits(uint_ulk_t x); | ||
|
|
||
| } // namespace LIBC_NAMESPACE_DECL | ||
|
|
||
| #endif // LLVM_LIBC_SRC_STDFIX_ULKBITS_H |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| //===-- Implementation of ulrbits function --------------------------------===// | ||
| // | ||
| // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | ||
| // See https://llvm.org/LICENSE.txt for license information. | ||
| // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | ||
| // | ||
| //===----------------------------------------------------------------------===// | ||
|
|
||
| #include "ulrbits.h" | ||
| #include "src/__support/common.h" | ||
| #include "src/__support/fixed_point/fx_bits.h" | ||
| #include "src/__support/macros/config.h" | ||
|
|
||
| namespace LIBC_NAMESPACE_DECL { | ||
| LLVM_LIBC_FUNCTION(unsigned long fract, ulrbits, (uint_ulr_t x)) { | ||
| return cpp::bit_cast<unsigned long fract, uint_ulr_t>(x); | ||
| } | ||
|
|
||
| } // namespace LIBC_NAMESPACE_DECL |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| //===-- Implementation header for ulrbits -----------------------*- C++ -*-===// | ||
| // | ||
| // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | ||
| // See https://llvm.org/LICENSE.txt for license information. | ||
| // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | ||
| // | ||
| //===----------------------------------------------------------------------===// | ||
|
|
||
| #ifndef LLVM_LIBC_SRC_STDFIX_ULRBITS_H | ||
| #define LLVM_LIBC_SRC_STDFIX_ULRBITS_H | ||
|
|
||
| #include "include/llvm-libc-macros/stdfix-macros.h" | ||
| #include "include/llvm-libc-types/stdfix-types.h" | ||
| #include "src/__support/macros/config.h" | ||
|
|
||
| namespace LIBC_NAMESPACE_DECL { | ||
|
|
||
| unsigned long fract ulrbits(uint_ulr_t x); | ||
|
|
||
| } // namespace LIBC_NAMESPACE_DECL | ||
|
|
||
| #endif // LLVM_LIBC_SRC_STDFIX_ULRBITS_H |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| //===-- Implementation of urbits function ---------------------------------===// | ||
| // | ||
| // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | ||
| // See https://llvm.org/LICENSE.txt for license information. | ||
| // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | ||
| // | ||
| //===----------------------------------------------------------------------===// | ||
|
|
||
| #include "urbits.h" | ||
| #include "src/__support/common.h" | ||
| #include "src/__support/fixed_point/fx_bits.h" | ||
| #include "src/__support/macros/config.h" | ||
|
|
||
| namespace LIBC_NAMESPACE_DECL { | ||
| LLVM_LIBC_FUNCTION(unsigned fract, urbits, (uint_ur_t x)) { | ||
| return cpp::bit_cast<unsigned fract, uint_ur_t>(x); | ||
| } | ||
|
|
||
| } // namespace LIBC_NAMESPACE_DECL |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| //===-- Implementation header for urbits ------------------------*- C++ -*-===// | ||
| // | ||
| // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | ||
| // See https://llvm.org/LICENSE.txt for license information. | ||
| // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | ||
| // | ||
| //===----------------------------------------------------------------------===// | ||
|
|
||
| #ifndef LLVM_LIBC_SRC_STDFIX_URBITS_H | ||
| #define LLVM_LIBC_SRC_STDFIX_URBITS_H | ||
|
|
||
| #include "include/llvm-libc-macros/stdfix-macros.h" | ||
| #include "include/llvm-libc-types/stdfix-types.h" | ||
| #include "src/__support/macros/config.h" | ||
|
|
||
| namespace LIBC_NAMESPACE_DECL { | ||
|
|
||
| unsigned fract urbits(uint_ur_t x); | ||
|
|
||
| } // namespace LIBC_NAMESPACE_DECL | ||
|
|
||
| #endif // LLVM_LIBC_SRC_STDFIX_URBITS_H |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,55 @@ | ||
| //===-- Utility class to test int to fixed point conversions ----*- C++ -*-===// | ||
| // | ||
| // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | ||
| // See https://llvm.org/LICENSE.txt for license information. | ||
| // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | ||
| // | ||
| //===----------------------------------------------------------------------===// | ||
|
|
||
| #include "test/UnitTest/Test.h" | ||
|
|
||
| #include "include/llvm-libc-types/stdfix-types.h" | ||
| #include "src/__support/CPP/bit.h" | ||
| #include "src/__support/fixed_point/fx_bits.h" | ||
|
|
||
| template <typename T, typename XType> | ||
| class FxBitsTest : public LIBC_NAMESPACE::testing::Test { | ||
| using FXRep = LIBC_NAMESPACE::fixed_point::FXRep<T>; | ||
| static constexpr T zero = FXRep::ZERO(); | ||
| static constexpr T min = FXRep::MIN(); | ||
| static constexpr T max = FXRep::MAX(); | ||
| static constexpr T half = static_cast<T>(0.5); | ||
| static constexpr T quarter = static_cast<T>(0.25); | ||
| static constexpr T one = | ||
| (FXRep::INTEGRAL_LEN > 0) ? static_cast<T>(1) : FXRep::MAX(); | ||
| static constexpr T eps = FXRep::EPS(); | ||
| constexpr XType get_one_or_saturated_fraction() { | ||
| if (FXRep::INTEGRAL_LEN > 0) { | ||
| return static_cast<XType>(static_cast<XType>(0x1) << FXRep::FRACTION_LEN); | ||
| } else { | ||
| return static_cast<XType>( | ||
| LIBC_NAMESPACE::mask_trailing_ones<typename FXRep::StorageType, | ||
| FXRep::FRACTION_LEN>()); | ||
| } | ||
| } | ||
|
|
||
| public: | ||
| typedef T (*FxBitsFunc)(XType); | ||
|
|
||
| void test_special_numbers(FxBitsFunc func) { | ||
| EXPECT_EQ(zero, func(0)); | ||
| EXPECT_EQ(eps, func(0x1)); | ||
| // x.1000... | ||
| EXPECT_EQ(half, func(static_cast<XType>(0x1) << (FXRep::FRACTION_LEN - 1))); | ||
| // Occupy the bit to the left of the fixed point for Accum types | ||
| // Saturate fraction portion for Fract types | ||
| EXPECT_EQ(one, func(get_one_or_saturated_fraction())); | ||
| } | ||
| }; | ||
|
|
||
| #define LIST_FXBITS_TEST(Name, T, XType, func) \ | ||
| using LlvmLibc##Name##BitsTest = FxBitsTest<T, XType>; \ | ||
| TEST_F(LlvmLibc##Name##BitsTest, SpecialNumbers) { \ | ||
| test_special_numbers(&func); \ | ||
| } \ | ||
| static_assert(true, "Require semicolon.") |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| //===-- Unittests for hkbits ----------------------------------------------===// | ||
| // | ||
| // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | ||
| // See https://llvm.org/LICENSE.txt for license information. | ||
| // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | ||
| // | ||
| //===----------------------------------------------------------------------===// | ||
|
|
||
| #include "FxBitsTest.h" | ||
| #include "src/stdfix/hkbits.h" | ||
|
|
||
| LIST_FXBITS_TEST(hk, short accum, int_hk_t, LIBC_NAMESPACE::hkbits); |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| //===-- Unittests for hrbits ----------------------------------------------===// | ||
| // | ||
| // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | ||
| // See https://llvm.org/LICENSE.txt for license information. | ||
| // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | ||
| // | ||
| //===----------------------------------------------------------------------===// | ||
|
|
||
| #include "FxBitsTest.h" | ||
| #include "src/stdfix/hrbits.h" | ||
|
|
||
| LIST_FXBITS_TEST(hr, short fract, int_hr_t, LIBC_NAMESPACE::hrbits); |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| //===-- Unittests for kbits -----------------------------------------------===// | ||
| // | ||
| // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | ||
| // See https://llvm.org/LICENSE.txt for license information. | ||
| // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | ||
| // | ||
| //===----------------------------------------------------------------------===// | ||
|
|
||
| #include "FxBitsTest.h" | ||
| #include "src/stdfix/kbits.h" | ||
|
|
||
| LIST_FXBITS_TEST(k, accum, int_k_t, LIBC_NAMESPACE::kbits); |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| //===-- Unittests for lkbits ----------------------------------------------===// | ||
| // | ||
| // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | ||
| // See https://llvm.org/LICENSE.txt for license information. | ||
| // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | ||
| // | ||
| //===----------------------------------------------------------------------===// | ||
|
|
||
| #include "FxBitsTest.h" | ||
| #include "src/stdfix/lkbits.h" | ||
|
|
||
| LIST_FXBITS_TEST(lk, long accum, int_lk_t, LIBC_NAMESPACE::lkbits); |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| //===-- Unittests for lrbits ----------------------------------------------===// | ||
| // | ||
| // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | ||
| // See https://llvm.org/LICENSE.txt for license information. | ||
| // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | ||
| // | ||
| //===----------------------------------------------------------------------===// | ||
|
|
||
| #include "FxBitsTest.h" | ||
| #include "src/stdfix/lrbits.h" | ||
|
|
||
| LIST_FXBITS_TEST(lr, long fract, int_lr_t, LIBC_NAMESPACE::lrbits); |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| //===-- Unittests for rbits -----------------------------------------------===// | ||
| // | ||
| // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | ||
| // See https://llvm.org/LICENSE.txt for license information. | ||
| // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | ||
| // | ||
| //===----------------------------------------------------------------------===// | ||
|
|
||
| #include "FxBitsTest.h" | ||
| #include "src/stdfix/rbits.h" | ||
|
|
||
| LIST_FXBITS_TEST(r, fract, int_r_t, LIBC_NAMESPACE::rbits); |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| //===-- Unittests for uhkbits ---------------------------------------------===// | ||
| // | ||
| // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | ||
| // See https://llvm.org/LICENSE.txt for license information. | ||
| // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | ||
| // | ||
| //===----------------------------------------------------------------------===// | ||
|
|
||
| #include "FxBitsTest.h" | ||
| #include "src/stdfix/uhkbits.h" | ||
|
|
||
| LIST_FXBITS_TEST(uhk, unsigned short accum, uint_uhk_t, | ||
| LIBC_NAMESPACE::uhkbits); |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| //===-- Unittests for uhrbits ---------------------------------------------===// | ||
| // | ||
| // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | ||
| // See https://llvm.org/LICENSE.txt for license information. | ||
| // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | ||
| // | ||
| //===----------------------------------------------------------------------===// | ||
|
|
||
| #include "FxBitsTest.h" | ||
| #include "src/stdfix/uhrbits.h" | ||
|
|
||
| LIST_FXBITS_TEST(uhr, unsigned short fract, uint_uhr_t, | ||
| LIBC_NAMESPACE::uhrbits); |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| //===-- Unittests for ukbits ----------------------------------------------===// | ||
| // | ||
| // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | ||
| // See https://llvm.org/LICENSE.txt for license information. | ||
| // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | ||
| // | ||
| //===----------------------------------------------------------------------===// | ||
|
|
||
| #include "FxBitsTest.h" | ||
| #include "src/stdfix/ukbits.h" | ||
|
|
||
| LIST_FXBITS_TEST(uk, unsigned accum, uint_uk_t, LIBC_NAMESPACE::ukbits); |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| //===-- Unittests for ulkbits ---------------------------------------------===// | ||
| // | ||
| // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | ||
| // See https://llvm.org/LICENSE.txt for license information. | ||
| // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | ||
| // | ||
| //===----------------------------------------------------------------------===// | ||
|
|
||
| #include "FxBitsTest.h" | ||
| #include "src/stdfix/ulkbits.h" | ||
|
|
||
| LIST_FXBITS_TEST(ulk, unsigned long accum, uint_ulk_t, LIBC_NAMESPACE::ulkbits); |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| //===-- Unittests for ulrbits ---------------------------------------------===// | ||
| // | ||
| // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | ||
| // See https://llvm.org/LICENSE.txt for license information. | ||
| // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | ||
| // | ||
| //===----------------------------------------------------------------------===// | ||
|
|
||
| #include "FxBitsTest.h" | ||
| #include "src/stdfix/ulrbits.h" | ||
|
|
||
| LIST_FXBITS_TEST(ulr, unsigned long fract, uint_ulr_t, LIBC_NAMESPACE::ulrbits); |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| //===-- Unittests for urbits ----------------------------------------------===// | ||
| // | ||
| // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | ||
| // See https://llvm.org/LICENSE.txt for license information. | ||
| // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | ||
| // | ||
| //===----------------------------------------------------------------------===// | ||
|
|
||
| #include "FxBitsTest.h" | ||
| #include "src/stdfix/urbits.h" | ||
|
|
||
| LIST_FXBITS_TEST(ur, unsigned fract, uint_ur_t, LIBC_NAMESPACE::urbits); |