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

Fix clang support #21

Merged
merged 14 commits into from
Nov 2, 2023
Merged

Fix clang support #21

merged 14 commits into from
Nov 2, 2023

Commits on Nov 2, 2023

  1. Document constexpr_wrapper

    ChangeLog:
    
    	* README.md: Add a section about constexpr_wrapper.
    mattkretz committed Nov 2, 2023
    Configuration menu
    Copy the full SHA
    3743fe1 View commit details
    Browse the repository at this point in the history
  2. Don't use always-inline attribute with Clang

    Clang warns about and doesn't use the always_inline attribute on
    lambdas. Therefore only define the macro if __clang__ is not defined.
    
    ChangeLog:
    
    	* vir/detail.h: Guard VIR_LAMBDA_ALWAYS_INLINE with not
    	__clang__.
    mattkretz committed Nov 2, 2023
    Configuration menu
    Copy the full SHA
    5032f7b View commit details
    Browse the repository at this point in the history
  3. Fix simd_policy implementation for Clang

    Clang and GCC disagree about whether the decltype of an NTTP is const or
    not. This made it work on GCC but not on Clang. Avoid the issue by using
    types as simd_policy options instead of NTTPs.
    
    ChangeLog:
    
    	* vir/simd_execution.h (simd_policy): Refactor to type-based
    	options instead of NTTPs.
    mattkretz committed Nov 2, 2023
    Configuration menu
    Copy the full SHA
    0851859 View commit details
    Browse the repository at this point in the history
  4. Work around Clang not allowing less-equal in constant expressions

    ChangeLog:
    
    	* vir/simd_execution.h: Replace a + b <= c with a + b - 1 < c.
    mattkretz committed Nov 2, 2023
    Configuration menu
    Copy the full SHA
    b25b2cf View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    74003aa View commit details
    Browse the repository at this point in the history
  6. Don't trigger Clang bug in libstdc++'s zip_view implementation

    ChangeLog:
    
    	* testsuite/tests/transform.cc: #ifdef zip_view test for
    	__clang_major__ <= 17.
    	Remove unused lambda captures.
    mattkretz committed Nov 2, 2023
    Configuration menu
    Copy the full SHA
    91166a6 View commit details
    Browse the repository at this point in the history
  7. Disable irrelevant Clang warnings

    * We don't need warnings about self-assignment when testing that
    self-assignment works.
    * The GCC-compatible method of PCH inclusion triggers a -Wdeprecated
    warning, which isn't helpful. Turning it off.
    mattkretz committed Nov 2, 2023
    Configuration menu
    Copy the full SHA
    b90cdf9 View commit details
    Browse the repository at this point in the history
  8. Use (better) guard for IEC559 code and constants

    Clang doesn't defined __GCC_IEC_559, so we need to look at
    __STDC_IEC_559__. This is already implemented as COMPLETE_IEC559_SUPPORT
    in test_values.h, which we can reuse in the tests. For completeness,
    don't define named constants when their use is #ifdef'ed out.
    
    ChangeLog:
    
    	* testsuite/tests/fpclassify.cc: Guard IEC559 special values
    	with COMPLETE_IEC559_SUPPORT.
    	* testsuite/tests/frexp.cc: Likewise.
    mattkretz committed Nov 2, 2023
    Configuration menu
    Copy the full SHA
    2015a03 View commit details
    Browse the repository at this point in the history
  9. Disable simd execution policy for Clang < 17 and GCC >= 13

    Clang < 17 cannot include <ranges> from GCC 13 in C++23 mode without
    breaking.
    
    ChangeLog:
    
    	* vir/simd_execution.h: Guard against incompatible Clang and
    	<ranges> header.
    mattkretz committed Nov 2, 2023
    Configuration menu
    Copy the full SHA
    630c97d View commit details
    Browse the repository at this point in the history
  10. Fix simdize'd load&store on non-power-of-2 vir::stdx::simd

    The problem didn't trigger with the libstdc++ stdx::simd because of the
    padding induced by alignment requirements, which then hit the sizeof
    condition. This is different for the array-based vir::stdx::simd
    implementation.
    
    ChangeLog:
    
    	* vir/simdize.h: Move static_assert for power-of-2 number of
    	elements into constexpr-if condition.
    mattkretz committed Nov 2, 2023
    Configuration menu
    Copy the full SHA
    dfc1b1e View commit details
    Browse the repository at this point in the history
  11. Print __PRETTY_FUNCTION__ of test function not helper lambda

    On test failure, the COMPARE and ULP_COMPARE functions use
    __PRETTY_FUNCTION__ to print the function where the failure happened.
    As an implementation detail the macros internally use a directly invoked
    lambda. If __PRETTY_FUNCTION__ is inside that lambda then the compiler
    may emit the name of the lambda instead of the calling function. To get
    to see the latter, pass __PRETTY_FUNCTION__ as function argument to the
    lambda.
    
    ChangeLog:
    
    	* testsuite/tests/bits/verify.h (COMPARE, ULP_COMPARE): Move
    	__PRETTY_FUNCTION__ from inside the lambda to the lambda
    	arguments.
    mattkretz committed Nov 2, 2023
    Configuration menu
    Copy the full SHA
    a5eba09 View commit details
    Browse the repository at this point in the history
  12. Default to -Wall -Wextra -Wpedantic

    This way CI also tests these without depending on custom TESTFLAGS (or
    similar).
    
    ChangeLog:
    
    	* Makefile: Add -Wall -Wextra -Wpedantic to the beginning of
    	CXXFLAGS
    	* vir/detail.h: Ignore -Wpedantic when uttering __int128.
    	* vir/simd_execution.h: Remove stray semicolon.
    mattkretz committed Nov 2, 2023
    Configuration menu
    Copy the full SHA
    3bdabd9 View commit details
    Browse the repository at this point in the history
  13. Disable permuting loads and stores for Clang 17

    Clang 17 miscompiles a vinsertps call in some tests. It's fairly
    impossible to debug where this comes from. Any help from the compiler
    via e.g. -Og or -fsanitize makes the bug go away.
    
    ChangeLog:
    
    	* vir/detail.h (VIR_HAVE_WORKING_SHUFFLEVECTOR): Renamed from
    	VIR_HAVE_BUILTIN_SHUFFLEVECTOR. False for Clang 17.
    	* vir/simd_permute.h: Rename to VIR_HAVE_BUILTIN_SHUFFLEVECTOR.
    	* vir/simdize.h: Likewise.
    mattkretz committed Nov 2, 2023
    Configuration menu
    Copy the full SHA
    099475f View commit details
    Browse the repository at this point in the history
  14. Fix literals longer than one char and add literals tests

    ChangeLog:
    
    	* vir/constexpr_wrapper.h: Comparing arrays of different size is
    	ill-formed; check for size and subscript value instead.
    	* vir/test_constexpr_wrapper.cpp: Test all kinds of literals.
    mattkretz committed Nov 2, 2023
    Configuration menu
    Copy the full SHA
    387fe24 View commit details
    Browse the repository at this point in the history