mirror of
https://github.com/DrasLorus/CORDIC_Rotate_APFX.git
synced 2024-11-12 16:13:17 +01:00
GCC now compiles AND evaluates constexpr during compilation.
This commit is contained in:
parent
9e21f49577
commit
e3f9a2e1e5
2 changed files with 6 additions and 5 deletions
|
@ -25,7 +25,7 @@ class CCordicRotateRomHalfPi {
|
|||
static_assert(TNStages > 1, "2 stages of CORDIC is the minimum.");
|
||||
|
||||
public:
|
||||
static constexpr const CRomGeneratorConst<TIn_W, TNStages, Tq> & rom_cordic = CRomGeneratorConst<TIn_W, TNStages, Tq>();
|
||||
static constexpr const CRomGeneratorConst<TIn_W, TNStages, Tq> & rom_cordic{};
|
||||
|
||||
static constexpr unsigned In_W = TIn_W;
|
||||
static constexpr unsigned In_I = TIn_I;
|
||||
|
|
|
@ -317,9 +317,10 @@ TEST_CASE("ROM-based Cordic constexpr are evaluated during compilation.", "[CORD
|
|||
double results_re[n_lines];
|
||||
double results_im[n_lines];
|
||||
|
||||
constexpr complex<int64_t> res = cordic.cordic(value_in, angle);
|
||||
static_assert(res == cordic.cordic(value_in, angle), "Test");
|
||||
REQUIRE_FALSE(res == cordic.cordic(complex<int64_t>(1, 0), angle));
|
||||
REQUIRE(res == cordic.cordic(value_in, angle));
|
||||
constexpr complex<int64_t> res1 = cordic.cordic(value_in, angle);
|
||||
constexpr complex<int64_t> res2 = cordic.cordic(value_in, angle);
|
||||
static_assert(res1 == res2, "Test");
|
||||
REQUIRE_FALSE(res1 == cordic.cordic(complex<int64_t>(1, 0), angle));
|
||||
REQUIRE(res1 == cordic.cordic(value_in, angle));
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue