Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

resolve test failures and generalize implementation, removing code duplication #20

Merged
merged 11 commits into from
Oct 27, 2023

Conversation

mattkretz
Copy link
Owner

No description provided.

Recognize std::ranges::zip_view as range argument: If it's made up of
simd_execution_ranges, simdize from the original ranges, skipping the
std::ranges::zip mechanism.

To test the std::ranges::zip_view, compile in C++23 mode (if possible).

ChangeLog:

	* Makefile: Determine -std=... flag using latest_std_flag.sh and
	use it instead of gnu++2a.
	* latest_std_flag.sh: New file.
	* testsuite/tests/transform.cc: Ensure no overflow/wrapping on
	sizeof(T) == 1 element types. Try harder to actually hit the
	prologue code. Add zip test case.
	* vir/detail.h: Use constexpr_wrapper instead of
	integral_constant.
	(unroll2): New.
	* vir/simd_execution.h (detail::prologue): Compute
	max_misalignment and pass it to prologue callback (to avoid
	mismatched calculations).
	(detail::simdized_load_and_invoke),
	(detail::simdized_load_flag1_and_invoke): New.
	(detail::simd_transform_prologue): Rewrite for pack of input
	ranges, using simdized_load_and_invoke. Assert correct size
	argument.
	(detail::simd_transform_epilogue): Rewrite for pack of input
	ranges, using simdized_load_and_invoke.
	(detail::transform): Generalized for pack of input ranges from
	two-input vir::transform. Fix prologue call to start with size
	1.
	(detail::simd_transform_reduce_prologue),
	(detail::simd_transform_reduce_epilogue): Replace std::apply
	call with simdized_load_flag1_and_invoke.
	(detail::transform_reduce): Replace std::apply call with
	simdized_load_and_invoke/simdized_load_flag1_and_invoke.
	(vir::transform): Implement using detail::transform. Add
	overload for zip_view input range.
	(std::transform): Implement using vir::detail::transform.
	* vir/simdize.h (vir::resize_simdize_t): New.
ChangeLog:

	* vir/simd_permute.h: Remove unused v8sf alias.
ChangeLog:

	* vir/simd.h: #include <algorithm>.
ChangeLog:

	* vir/simd_execution.h (detail::memory_alignment): Adapted from
	original memory_alignment_v constexpr-if implementation.
	(detail::memory_alignment_v): Implement using memory_alignment.
ChangeLog:

	* vir/detail.h: Make definition of unroll and unroll2
	conditional on VIR_HAVE_CONSTEXPR_WRAPPER.
GCC 11 doesn't like static constexpr automatic variables.

ChangeLog:

	* vir/simd_execution.h: Remove static on constexpr_wrapper
	variables and pass the variable explicitly by value into lambda
	captures or capture as constexpr int by reference and use
	vir::cw explicitly when necessary.
ChangeLog:

	* testsuite/tests/bits/verify.h (test::_S_fuzzyness):
	Explicitly initialize to 0 for non-floating-point T to avoid
	-Wliteral-conversion warning.
This should be more efficient at compile time, too.

ChangeLog:

	* vir/constexpr_wrapper.h (detail::cw_parse): Parse literal
	without calling from_chars (not constexpr in older stdlibs).
ChangeLog:

	* vir/simd_bit.h (simd_bit_cast): If src and dst are trivially
	copyable, use detail::bit_cast. Otherwise, if libstdc++ 12 or
	later is available, call stdx::__proposed::simd_bit_cast.
When compiling with emscripten em++ FE_INEXACT and __STDC_IEC_559__ are
not defined.

ChangeLog:

	* testsuite/tests/math_1arg.cc: Without FE_INEXACT float
	exceptions are not test anyway. Just #ifdef the code.
	* testsuite/tests/operators.cc: If neither __GCC_IEC_559 nor
	__STDC_IEC_559__ are defined assume no IEC60559 compliance.
ChangeLog:

	* testsuite/tests/operator_cvt.cc: Disable a few tests involving
	long when native == fixed_size, these tests are handled already,
	conditional on sizeof(long).
@mattkretz mattkretz marked this pull request as ready for review October 27, 2023 16:36
@mattkretz mattkretz merged commit 5457027 into master Oct 27, 2023
8 checks passed
@mattkretz mattkretz deleted the std-transform-reduce branch October 27, 2023 16:36
@mattkretz mattkretz added this to the v0.3.0 milestone Oct 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant