• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

stillwater-sc / universal / 24864610179
84%
master: 84%

Build:
Build:
LAST BUILD BRANCH: main
DEFAULT BRANCH: master
Ran 24 Apr 2026 12:14AM UTC
Jobs 1
Files 633
Run time 2min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

23 Apr 2026 11:47PM UTC coverage: 84.367% (-0.02%) from 84.39%
24864610179

push

github

web-flow
feat(blockbinary): promote arithmetic operators to constexpr (PR 2 of #713) (#716)

* feat(blockbinary): promote arithmetic operators to constexpr (PR 2 of #713)

Mark blockbinary's arithmetic and bitwise operators constexpr so that posit
convert_<>() and the broader Universal codebase can do constexpr blockbinary
arithmetic. This is the prerequisite for Phase 2 of issue #713 (constexpr
IEEE-754 -> posit conversion) and is independently valuable for any future
code that needs compile-time blockbinary arithmetic.

Operators promoted to constexpr:
  blockbinary::operator+= operator-= operator++ operator-- operator<<=
  operator>>= operator|= operator&= operator^=
  free truncate(...)  free twosComplement(...)
  posit_impl::convert_<>()

Implementation notes:
- The bitsInBlock==64 path of operator+= calls addcarry(), which uses
  platform-specific intrinsics that are not constexpr on MSVC. Dispatch
  via std::is_constant_evaluated() to a portable carry-detection path
  in constexpr context, while keeping the intrinsic for runtime perf.
- The general multi-block path used pointer-arithmetic loops. Rewritten
  as index-based loops, which are constexpr-friendly.
- The two `if (_trace_conversion)` runtime branches in convert_<>() that
  called std::cout were converted to `if constexpr (_trace_conversion)`
  to satisfy the constant-expression requirement.

The following blockbinary operators are intentionally left non-constexpr in
this PR (out of scope; they have separate intrinsic dependencies):
  operator*= (uses mul128), operator/=, operator%=

Tests:
- internal/blockbinary/api/constexpr.cpp expanded with static_assert smoke
  tests covering operator+=, ++, <<=, |=, twosComplement across uint8/uint64
  limbs, single-block and multi-block configurations.
- Verified constexpr posit_impl::convert_<>() compiles and produces bit-
  identical encoding to runtime invocation.

Cross-type regression validation (gcc-13 + clang-18, both -std=c++20):
  blockbinary: bb... (continued)

28 of 38 new or added lines in 3 files covered. (73.68%)

6 existing lines in 1 file now uncovered.

44907 of 53228 relevant lines covered (84.37%)

6505383.69 hits per line

Uncovered Changes

Lines Coverage ∆ File
10
96.07
-1.85% include/sw/universal/internal/blockbinary/blockbinary.hpp

Coverage Regressions

Lines Coverage ∆ File
6
80.58
-1.34% include/sw/universal/number/posit1/specialized/posit_16_1.hpp
Jobs
ID Job ID Ran Files Coverage
1 24864610179.1 24 Apr 2026 12:14AM UTC 633
84.37
GitHub Action Run
Source Files on build 24864610179
  • Tree
  • List 633
  • Changed 6
  • Source Changed 3
  • Coverage Changed 5
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #24864610179
  • 1f9a4af8 on github
  • Prev Build on main (#24863021025)
  • Next Build on main (#24881139213)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc