Commit d359b54
V3.98: posit v1 to posit v2 transition and adding arm64, PPC, and MINGW as cross-platform targets (#508)
* Incrementing SEMVER v3.98
* Rename posit → posit1, posit2 → posit: make BlockType-based posit the default
Move the old bitset-based posit (2-param template) to posit1/ for backward
compatibility, and promote the new BlockType-based posit2 (3-param template)
to posit/ so that #include <universal/number/posit/posit.hpp> gives consumers
the modern implementation.
Key changes:
- include/sw/universal/number/posit/ now contains the new 3-param posit
- include/sw/universal/number/posit1/ preserves the old 2-param posit
- Math library copied from posit1 into new posit with 3-param signatures
- posit_traits.hpp updated for 3-param, new posit1_traits.hpp for 2-param
- Test directories: static/posit/ (new), static/posit1/ (old)
- sqrt.hpp fixed for blockbinary::bits() → unsigned cast in table lookups
- Verification header decoupled from direct mathlib include
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* Fix quire tests to include posit1 (quire requires old posit)
The quire super-accumulator is only implemented for the old 2-param
posit (now posit1). Update the two quire test files to include
posit1/posit1.hpp instead of posit/posit.hpp.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* Fix posito to use posit1 (depends on old posit internal classes)
posito uses positRegime, positExponent, and positFraction from the old
posit implementation. Update posito.hpp and posito_impl.hpp to include
from posit1/ instead of posit/. Also fix number_system.cpp which
explicitly included posit/posit.hpp alongside posito.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* Fix remaining posit→posit1 include paths for CI
- valid_impl.hpp: use posit1/posit_impl.hpp (valid depends on bitblock)
- exceptions.hpp: add shared include guard to prevent redefinition when
both posit/ and posit1/ exceptions are included in the same TU
- takum, posito conversion tests: use posit1 (they also include posito
which transitively includes posit1, can't mix with new 3-param posit)
- C API: all files updated to use posit1/ paths (posit_c_api.h,
posit_c_macros.h, specialized headers, posit.hpp)
- Conversion tests: rounding, to_integer, to_posit, adapt_integer use
old posit internals (bitblock, value) so need posit1
- BLAS fused solvers: use quire/fdp which only exists in posit1
- Education/tools: quire demos and posit property tools use posit1
CI_LITE: 397/397 tests pass.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* Fix utility headers and mixed-precision for 3-param posit
- error_tracking_traits.hpp: update posit forward declaration and
partial specialization from 2-param to 3-param template
- tracked_shadow.hpp: update posit forward declaration and TrackedPosit
alias to 3-param template
- Tensor CG/DNN files: switch to posit1 (they use quire/fdp solvers)
- Simple mixed-precision files: remove boilerplate quire_exception catch
blocks (std::runtime_error catch covers them)
CI_LITE: 397/397 tests pass.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* Fix benchmark files for posit rename
- gemm.cpp (5 variants): switch to posit1 (uses sw::universal::fdp)
- dot/matvec/posit perf benchmarks (19 files): remove boilerplate
quire_exception catch blocks (std::runtime_error covers them)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* Fix remaining BUILD_ALL failures for posit rename
- education/number/posit/ (15 files): switch to posit1 (use old posit
internals like positRegime, positExponent, positFraction, pretty_print)
- tools/cmd/posit.cpp, float2posit.cpp: switch to posit1 (use bitblock,
internal::value, pretty_print)
- benchmark/performance/posit/performance.cpp: fix POSIT_OLD_GENERATION
include path to posit1, update #else to new posit path
BUILD_ALL: 0 errors. CI_LITE: 397/397 tests pass.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* Fix all BUILD_ALL compilation failures for posit rename
- Switch files using old posit internals (value<>, bitblock, quire, fdp,
pretty_print, info_print, .get(), useed<nbits,es>, positRegime,
positExponent, positFraction, setBitblock) to posit1
- Remove boilerplate quire_exception catch blocks from files using new posit
- Fix posit/posito coexistence: files including posito must use posit1
- Fix posit/valid coexistence: files including valid must use posit1
- Update number_systems.hpp aggregator to use posit1 (full-featured)
- Update datafile.hpp is_posit trait to is_posit1
- Fix enable_if_posit -> enable_if_posit1 in error_vs_cost.cpp
- Fix attention.cpp posit2->posit path
Files affected: 50 across applications/, education/, linalg/,
numeric/, playground/, and include/sw/blas/
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* Disable POSIT_THROW_ARITHMETIC_EXCEPTION in benchmarks and CG solver
Performance benchmarks exercise all values including division by zero,
and the CG solver can encounter divide-by-zero when low-precision posits
cause stalling. Both need arithmetic exceptions disabled.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* original posit applications that have a trivial migration to new posit implementation
* adding missing manipulators to new posit
* completing attribute functions for new posit
* Port quire, FDP, and fused BLAS to new posit
Add bridge functions (convert, posit_to_value, posit_normalize_to) to
posit_impl.hpp that convert between internal::value<>/bitblock<> and
blocktriple<>/blocksignificand<> type systems. Create posit/quire.hpp
and posit/fdp.hpp adapted from posit1 with bt-templated posit-facing
methods. Migrate 19 consumer files from posit1 to new posit. Make fused
solver headers posit-agnostic so IR apps using posito can stay on posit1.
934/934 tests pass on both gcc and clang.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* Migrate remaining posit1 consumer files to new posit
Migrate two_sum.cpp (.get() -> .bits(), minpos free fn -> member fn),
values.cpp, extract.cpp (add using namespace internal), and propq.cpp
to use posit/posit.hpp. Create posit/twoSum.hpp adapted from posit1
with bt-templated signature. 934/934 tests pass on gcc and clang.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* Rewrite education files to use blocktriple instead of internal::value
Replace internal::value<> and internal::bitblock<> with blocktriple<> in
values.cpp and extract.cpp. The blocktriple type is the modern replacement
for the legacy value<> type system.
- values.cpp: ValidateValue -> ValidateBlocktriple, replace round_to<>
demo with precision-across-sizes demo showing significand degradation
- extract.cpp: replace extract_fp_components/bitblock/value chain with
blocktriple for IEEE display and direct posit assignment for conversion
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* quire and fdp migration plan
* change and session log for Feb 12, 2026
* WIP: fixing up the posit API
* Fix inverted operator>(literal, posit) and missing bt template args
All 13 operator>(literal_type lhs, posit rhs) free functions had an
inverted comparison: returned lhs < rhs instead of rhs < lhs. Also
fix check_inward_projection_range calls missing the bt template arg
in float2posit.cpp and conversion.cpp.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* Rewrite atomic fused operators to blocktriple and extract quire from posit.hpp
Eliminates the last value<> dependency from the posit arithmetic pipeline.
fma/fam/fmma now use blocktriple<> exclusively with extract-and-reconstruct
helpers for chaining operations across operator types. Quire/fdp moved to
standalone opt-in headers; 25+ consumer files updated with explicit includes.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* code hygiene
* Add ARM64 and MinGW-w64 cross-compilation CI targets
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* Fix long double decoder and manipulators for ARM64 128-bit quad precision
On aarch64-linux-gnu-g++, long double is IEEE 754 binary128 (same as
POWER), not 80-bit x87 extended. The long_double_decoder union lacked
the upper/fraction split fields, and gcc_long_double.hpp fell through
to the x86 code path referencing the nonexistent bit63 member.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* Fix extract_fp_components redefinition on MinGW where uint64_t is unsigned long long
On MinGW-w64, uint64_t and unsigned long long are the same type, so
the overload in gcc_long_double.hpp clashes with the one already
provided by extract_fp_components.hpp. Guard with !_WIN32.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* Fix C API test linking for MinGW cross-compilation
The posit_c_api_pure library was only linked under if(UNIX) or
if(MSVC). MinGW cross-compilation sets CMAKE_SYSTEM_NAME=Windows,
so neither condition matched and the library was never linked.
Always link the library; only add -lm on UNIX.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* Use target-based add_test() for cross-compilation compatibility
The old add_test() calls used a manual path via RUNTIME_OUTPUT_DIRECTORY
which was never set, and didn't include .exe suffix for Windows targets.
Switch to add_test(NAME ... COMMAND ...) which lets CMake resolve the
correct executable path and automatically prepend the crosscompiling
emulator (wine for MinGW, qemu for ARM/RISC-V/POWER).
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* Static link GCC/C++ runtime in MinGW toolchain for Wine compatibility
Wine can't find libgcc_s_seh-1.dll and libstdc++-6.dll at runtime.
Adding -static to linker flags embeds the runtime into each executable.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* Fix MinGW GCC optimizer bugs causing lns and floatcascade test failures
Two MinGW-specific GCC bugs caused 5 test failures in the CI:
1. LNS sign bit loss (4 tests): GCC's IPA ICF incorrectly folds
different lns<nbits> setbit template instantiation fragments after
function splitting. When lns<4> and lns<8> are in the same TU,
the 8-bit version loses all sign bits. Fix: -fno-ipa-icf
2. floatcascade multiplication precision (1 test): MinGW's software
std::fma() has subtle precision errors for some inputs (off by
1-2 ULPs), breaking the error-free transformations that
floatcascade relies on for quad-double precision. Fix: -mfma
to use hardware FMA3 instructions instead.
Both workarounds are applied via CMAKE_CXX_FLAGS_INIT in the MinGW
toolchain file. All 390 CI_LITE tests now pass under MinGW+Wine.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* changelog and session log for ARM64/MinGW cross-compilation CI
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* blocktriple and quire conversion plan
---------
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>1 parent 1cc5e96 commit d359b54
File tree
340 files changed
+12549
-8447
lines changed- .github/workflows
- applications
- accuracy
- optimization
- pde
- science
- approximation/chebyshev
- mixed-precision/attention
- performance
- chaos
- ir
- precision
- floating-point
- math
- numeric
- reproducibility/blas
- benchmark
- accuracy/blas
- energy/blas
- performance
- arithmetic/posit
- blas
- range/blas
- reproducibility/blas
- c_api
- pure_c
- posit
- test/posit
- shim
- posit
- test/posit
- cmake/toolchains
- docs
- plans
- sessions
- education
- number/posit
- quire
- ranges
- tables
- include/sw
- blas
- ext
- solvers
- modifiers
- serialization
- solvers
- universal
- adapters
- native
- nonconstexpr
- number
- posit1
- math
- specialized
- posit2
- posito
- posit
- math
- valid
- zfpblock
- traits
- utility
- verification
- linalg
- blas
- vmath
- mixedprecision
- approximation
- integration
- interpolation
- optimization
- roots
- tensor
- cg
- dnn
- numeric
- fpbench
- functions
- utils
- playground
- static
- conversions
- posit1
- api
- arithmetic
- complex
- arithmetic
- math
- conversion
- logic
- math
- specialized
- posit2
- arithmetic
- posito
- arithmetic
- conversion
- posit
- api
- arithmetic
- conversion
- logic
- quire
- api
- arithmetic
- takum/conversion
- utility
- tools/cmd
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
340 files changed
+12549
-8447
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
| 5 | + | |
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| |||
63 | 63 | | |
64 | 64 | | |
65 | 65 | | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
66 | 80 | | |
67 | 81 | | |
68 | 82 | | |
| |||
90 | 104 | | |
91 | 105 | | |
92 | 106 | | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
93 | 121 | | |
94 | 122 | | |
95 | 123 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
12 | 73 | | |
13 | 74 | | |
14 | 75 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
23 | | - | |
| 23 | + | |
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
| |||
521 | 521 | | |
522 | 522 | | |
523 | 523 | | |
524 | | - | |
| 524 | + | |
525 | 525 | | |
526 | | - | |
| 526 | + | |
527 | 527 | | |
528 | 528 | | |
529 | 529 | | |
| |||
539 | 539 | | |
540 | 540 | | |
541 | 541 | | |
542 | | - | |
| 542 | + | |
543 | 543 | | |
544 | | - | |
| 544 | + | |
545 | 545 | | |
546 | 546 | | |
547 | 547 | | |
| |||
958 | 958 | | |
959 | 959 | | |
960 | 960 | | |
961 | | - | |
962 | | - | |
| 961 | + | |
| 962 | + | |
963 | 963 | | |
964 | 964 | | |
965 | 965 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| 11 | + | |
11 | 12 | | |
12 | 13 | | |
13 | 14 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
13 | | - | |
14 | | - | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
15 | 16 | | |
16 | 17 | | |
17 | 18 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
10 | 11 | | |
| 12 | + | |
11 | 13 | | |
12 | 14 | | |
13 | 15 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
166 | 166 | | |
167 | 167 | | |
168 | 168 | | |
169 | | - | |
170 | | - | |
171 | | - | |
172 | | - | |
173 | 169 | | |
174 | 170 | | |
175 | 171 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
66 | 66 | | |
67 | 67 | | |
68 | 68 | | |
69 | | - | |
70 | | - | |
71 | | - | |
72 | | - | |
73 | 69 | | |
74 | 70 | | |
75 | 71 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
49 | 49 | | |
50 | 50 | | |
51 | 51 | | |
52 | | - | |
53 | | - | |
54 | | - | |
55 | | - | |
56 | 52 | | |
57 | 53 | | |
58 | 54 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
44 | 44 | | |
45 | 45 | | |
46 | 46 | | |
47 | | - | |
48 | | - | |
49 | | - | |
50 | | - | |
51 | 47 | | |
52 | 48 | | |
53 | 49 | | |
| |||
0 commit comments