This was disabled explicitly in recent commit
232c948674cff1b4b72c2d6b3acfa7342d096dd1 to prevent using
the <compare> header from STL.
Now, re-enabling by implementing an ETL version of it in compare.h
* Simplify noexcept containing ETL_NOT_USING_EXCEPTIONS
* Revert some format
---------
Co-authored-by: John Wellbelove <jwellbelove@users.noreply.github.com>
Co-authored-by: Roland Reichwein <Roland.Reichwein@bmw.de>
This was disabled explicitly in recent commit
232c948674cff1b4b72c2d6b3acfa7342d096dd1 to prevent using
the <compare> header from STL.
Now, re-enabling by implementing an ETL version of it in compare.h
* Help the compiler optimize unaligned_type.
This fixes a regression in 266b0f99 when the type was made constexpr. When
switching to a loop to construct the value the compiler was unable to detect
what was going on. We now unroll the loop at compile time into what's
essentially a hand rolled shift and OR operation which the compiler detects
and replaces with a byte swap. Tested on gcc (x86+arm) and clang (x86).
Introduce a static value_from which can be used to convert a value from an
existing buffer. There were previously three options for this, all bad or
awkward in different ways:
- val = etl::be_uint32_t(address)
Copies to temporary storage.
- val = *reinterpret_cast<const etl::be_uint32_t*>(address);
Unreadable.
- etl::be_uint32_t::copy_store_to_value(address, output);
Requires an output parameter.
The new addition is:
- val = etl::be_uint32_t::value_from(address);
Additionally, update the documentation with value_from and the missing,
existing constructors.
* Please clang-format.
---------
Co-authored-by: John Wellbelove <jwellbelove@users.noreply.github.com>
* feat: add clamped_value utility
* style: format clamped_value include list
* feat: enhance clamped_value with runtime bounds and comparison operators and DRY up the implementation
* refactor: call set in runtime ctor
instead of duplicated the clamping logic
* Add C++20 floating-point clamped_value support
* Document and stress clamped_value edge cases
* Change ETL_NOEXCEPT_IF(ETL_NOT_USING_EXCEPTIONS) to ETL_NOEXCEPT
* Change ETL_NOEXCEPT_IF(ETL_NOT_USING_EXCEPTIONS) to ETL_NOEXCEPT
* Revert changes
---------
Co-authored-by: John Wellbelove <jwellbelove@users.noreply.github.com>
Dispatch only the argument types which are actually stated. For everything
else, don't generate the code anymore.
Detemplatize parse_format_spec().
Collapse long double and double to double on targets where they are
same size. This helps prevent duplicate code generation.
Even without ETL_USE_TYPE_TRAITS_BUILTINS in the profile, we get
compiler builtins detected. Makes detection more consistent now.
Previously, some type trait builtins were detected automatically,
and some others needed to be activated via ETL_USE_TYPE_TRAITS_BUILTINS
in the profile explicitly.
Replaces: #1174
Co-authored-by: John Wellbelove <jwellbelove@users.noreply.github.com>
Further, switching internal member from array_view to span to
be closer to standard, and more constexpr friendly.
Also adjusting to C++11 template syntax.
Co-authored-by: John Wellbelove <jwellbelove@users.noreply.github.com>
Besides, remove unused ASAN_OPTIONS from github workflows.
Further, activate sanitizers for C++23 workflows, at the places
where we also activated -O3 optimization. Not activating everywhere
for CI efficiency reasons for now.
Note that the sanitizers are activated on clang C++23 workflows
only, since there is a remaining issue with GCC in delegate_cpp11.