Repository navigation
Added freestanding mode - #74
Open
danieltowner wants to merge 2 commits into
Open
danieltowner wants to merge 2 commits into
danieltowner wants to merge 2 commits into
Conversation
danieltowner
force-pushed
the
freestanding_mode
branch
from
November 20, 2026 17:39
cf7ba1e to
ef8654c
Compare
danieltowner
changed the base branch from
complex_like
to
freestanding_bounds_check
November 20, 2026 17:40
omalyshe
reviewed
Nov 20, 2026
There was a problem hiding this comment.
🟡 Changes recommended
Critical freestanding header parsing and baseline x86-64 probe failures remain, alongside a test-only intrinsic-header workaround and missing verification that exercised operations require no runtime support.
4 open issues
What changed in this PR
Introduces freestanding support for xvec’s SIMD API by separating runtime-dependent features from core vector operations.
Changes:
- Gates stream output, standard complex integration, and runtime-backed math behind
__STDC_HOSTED__. - Preserves custom complex-type support through
complex_traits. - Adds a freestanding compilation probe and documents the new mode.
| File | Description |
|---|---|
test/freestanding/include.cpp |
Adds compilation probes for vector operations and custom complex types. |
test/CMakeLists.txt |
Registers the freestanding object-build test. |
include/xvec/x86/x86_impl.hpp |
Removes the direct <complex> include. |
include/xvec/simd |
Gates <ostream> and removes the direct <complex> include. |
include/xvec/generic/generic_impl.hpp |
Gates <cmath> and generic math implementations. |
include/xvec/detail/utilities.hpp |
Gates standard complex support while retaining custom traits. |
include/xvec/detail/std_rebind.hpp |
Removes the direct <complex> include. |
include/xvec/detail/std_math.hpp |
Gates transcendental functions and their exports. |
include/xvec/detail/std_complex.hpp |
Removes the direct <complex> include. |
include/xvec/detail/mask.hpp |
Gates stream dependencies and mask output. |
CHANGELOG.md |
Documents freestanding mode and custom complex support. |
Review effort: Balanced
| return _Vp([=](auto i) { return typename _Vp::value_type(doOp(v[i])); }); | ||
| } | ||
|
|
||
| #endif // __STDC_HOSTED__ |
|
|
||
| add_library(FreestandingInclude OBJECT EXCLUDE_FROM_ALL freestanding/include.cpp) | ||
| target_include_directories(FreestandingInclude PRIVATE "${XVEC_ROOT_DIR}/include") | ||
| target_compile_options(FreestandingInclude PRIVATE -ffreestanding) |
|
|
||
| enable_testing() | ||
|
|
||
| add_library(FreestandingInclude OBJECT EXCLUDE_FROM_ALL freestanding/include.cpp) |
| @@ -0,0 +1,34 @@ | |||
| // Checks that <xvec/simd> compiles and basic operations instantiate with -ffreestanding. | |||
| #if defined(__GNUC__) && !defined(__clang__) | |||
| #define _MM_MALLOC_H_INCLUDED // GCC's mm_malloc.h needs hosted malloc/free. | |||
danieltowner
force-pushed
the
freestanding_mode
branch
2 times, most recently
from
November 21, 2026 17:34
b39f359 to
c2c7082
Compare
Allows the library to be used without any runtime support libraries. The main restriction is no maths/complex/iostream support. Note that complex-like behaviour can be restored using custom complex vlaues and defining a suitable `complex_trait` specialisation.
danieltowner
force-pushed
the
freestanding_mode
branch
from
November 21, 2026 17:35
c2c7082 to
78fa72e
Compare
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


Allows the library to be used without any runtime support libraries. The main restriction is no maths/complex/iostream support. Note that complex-like behaviour can be restored using custom complex vlaues and defining a suitable
complex_traitspecialisation.