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

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

Build:
Build:
LAST BUILD BRANCH: main
DEFAULT BRANCH: master
Ran 24 Apr 2026 09:23AM 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

24 Apr 2026 08:55AM UTC coverage: 84.371% (+0.004%) from 84.367%
24881139213

push

github

web-flow
feat(posit): enable constexpr IEEE-754 construction (Phase 2 of #713) (#717)

* feat(posit): enable constexpr IEEE-754 construction (Phase 2 of #713)

Phase 2 completes constexpr posit construction from numeric literals.
Float, double, and (where supported) long double inputs can now be used
in constant expressions:

  constexpr posit<32, 2> pi(3.14);     // now works
  constexpr posit<32, 2> npi(-3.14);   // now works
  constexpr posit<8,  0> pi8(3.14);    // now works
  constexpr posit<64, 3> big(1.0e100); // now works

Implementation:

1. encode_positive_with_scale_and_fraction(scale, frac, num_fbits, sat):
   Generalizes the integer-only encoder from Phase 1 to accept a separate
   scale and fraction-bit width. Handles negative scale via Euclidean
   division so the regime/exponent split works for sub-1.0 values. Handles
   negative regime (k<0) with the proper "(-k) zeros + 1 terminator"
   layout. encode_positive_uint64 is now a thin wrapper that derives
   scale = find_msb(v) - 1.

2. convert_ieee754 rewritten:
   - extractFields() (bit-cast based, BIT_CAST_CONSTEXPR) replaces frexp
   - Raw-exponent NaN/Inf check (rawExp == eallset) replaces std::isnan
     and std::isinf
   - Subnormals normalized via find_msb on rawFrac to produce a 1.frac'
     representation with scale = msb_pos - bias - fbits
   - For nbits <= 64: route to encode_positive_with_scale_and_fraction
     (sign applied via uint64 two's complement)
   - For nbits > 64: route to convert_<>() with a blocksignificand
     (convert_<>() became constexpr in PR #716)
   - Function marked BIT_CAST_CONSTEXPR (constexpr where __builtin_bit_cast
     is constexpr - gcc, clang, MSVC modern)

Tests:
- static/tapered/posit/api/api.cpp gets a "constexpr IEEE-754 construction"
  block covering posit<{8,16,32,64},{0,1,2,3}> from float and double, plus
  a subnormal float case (1e-40f) that exercises find_msb normalization.

Cross-compiler regression validation (gcc-13 + clang-18, -std=c++20):
... (continued)

96 of 100 new or added lines in 1 file covered. (96.0%)

12 existing lines in 2 files now uncovered.

44942 of 53267 relevant lines covered (84.37%)

6452764.52 hits per line

Uncovered Changes

Lines Coverage ∆ File
4
94.25
1.08% include/sw/universal/number/posit/posit_impl.hpp

Coverage Regressions

Lines Coverage ∆ File
10
31.43
-3.57% include/sw/universal/verification/test_suite_randoms.hpp
2
89.8
-0.57% include/sw/universal/number/posito/posito_impl.hpp
Jobs
ID Job ID Ran Files Coverage
1 24881139213.1 24 Apr 2026 09:23AM UTC 633
84.37
GitHub Action Run
Source Files on build 24881139213
  • Tree
  • List 633
  • Changed 3
  • Source Changed 1
  • Coverage Changed 3
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #24881139213
  • a943617c on github
  • Prev Build on main (#24864610179)
  • Next Build on main (#24907312588)
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