From bc5b58464ce52097efdb53c8019ba048e7ee3ba8 Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Fri, 22 Sep 2023 12:47:29 -0700 Subject: Shift the appropriate type --- common/alcomplex.cpp | 8 ++++---- common/alnumeric.h | 10 ++++++++-- 2 files changed, 12 insertions(+), 6 deletions(-) (limited to 'common') diff --git a/common/alcomplex.cpp b/common/alcomplex.cpp index ee990a39..dad62d0a 100644 --- a/common/alcomplex.cpp +++ b/common/alcomplex.cpp @@ -127,8 +127,8 @@ complex_fft(const al::span> buffer, const al::type_identity_t /* Iterative form of Danielson-Lanczos lemma */ for(size_t i{0};i < log2_size;++i) { - const size_t step2{1u << i}; - const size_t step{2u << i}; + const size_t step2{1_uz << i}; + const size_t step{2_uz << i}; /* The first iteration of the inner loop would have u=1, which we * can simplify to remove a number of complex multiplies. */ @@ -172,8 +172,8 @@ complex_fft(const al::span> buffer, const al::type_identity_t const Real pi{al::numbers::pi_v * sign}; for(size_t i{0};i < log2_size;++i) { - const size_t step2{1u << i}; - const size_t step{2u << i}; + const size_t step2{1_uz << i}; + const size_t step{2_uz << i}; for(size_t k{0};k < fftsize;k+=step) { std::complex temp{buffer[k+step2]}; diff --git a/common/alnumeric.h b/common/alnumeric.h index 620a9bcb..759dbc12 100644 --- a/common/alnumeric.h +++ b/common/alnumeric.h @@ -5,6 +5,7 @@ #include #include #include +#include #ifdef HAVE_INTRIN_H #include #endif @@ -17,8 +18,13 @@ #include "opthelpers.h" -inline constexpr int64_t operator "" _i64(unsigned long long int n) noexcept { return static_cast(n); } -inline constexpr uint64_t operator "" _u64(unsigned long long int n) noexcept { return static_cast(n); } +constexpr auto operator "" _i64(unsigned long long n) noexcept { return static_cast(n); } +constexpr auto operator "" _u64(unsigned long long n) noexcept { return static_cast(n); } + +constexpr auto operator "" _z(unsigned long long n) noexcept +{ return static_cast>(n); } +constexpr auto operator "" _uz(unsigned long long n) noexcept { return static_cast(n); } +constexpr auto operator "" _zu(unsigned long long n) noexcept { return static_cast(n); } constexpr inline float minf(float a, float b) noexcept -- cgit v1.2.3