Description
Building FastNoise2 with the FastSIMD ARM backends enabled fails with GCC 14 when compiling the generated FastSIMD_FastNoise_AARCH64.cpp and FastSIMD_FastNoise_NEON.cpp translation units.
The error appears to come from FastSIMD/ToolSet/ARM/NEON.h, where FS::Cast<int32_t>(...) on a Mask<32> returns a native uint32x4_t, but GCC 14 does not implicitly convert that to FS::Register<int, 4, ...>.
Environment
- OS: Linux
- Compiler: GCC / G++ 14
- C++ standard: GNU++17
- Build type: Release
- Relevant flags:
-O2
-DNDEBUG
-flto=auto
-ffast-math
-DFASTSIMD_IS_RELAXED=1
-DFASTSIMD_STATIC_LIB
- Target/features involved:
FastSIMD::FeatureSet::AARCH64
FastSIMD::FeatureSet::NEON
Actual result
The build fails while compiling both ARM SIMD backends:
FastSIMD_FastNoise_AARCH64.cpp
FastSIMD_FastNoise_NEON.cpp
FAILED: src/CMakeFiles/FastSIMD_FastNoise.dir/fastsimd/FastSIMD_FastNoise/FastSIMD_FastNoise_AARCH64.cpp.o
<compiler> \
-DFASTSIMD_EXPORT \
-DFASTSIMD_IS_RELAXED=1 \
-DFASTSIMD_LIBRARY_NAME=FastSIMD_FastNoise \
-DFASTSIMD_STATIC_LIB \
-I<build-dir>/src/fastsimd/FastSIMD_FastNoise/include \
-I<source-dir>/include \
-I<build-dir>/_deps/fastsimd-src/include \
-O2 -g -DNDEBUG \
-flto=auto \
-Wno-ignored-attributes \
-Wno-nan-infinity-disabled \
-ffast-math \
-std=gnu++17 \
-c <build-dir>/src/fastsimd/FastSIMD_FastNoise/FastSIMD_FastNoise_AARCH64.cpp
In file included from <build-dir>/_deps/fastsimd-src/include/FastSIMD/ToolSet/ARM/ARM.h:4,
from <build-dir>/_deps/fastsimd-src/include/FastSIMD/ToolSet.h:31,
from <build-dir>/_deps/fastsimd-src/dispatch/impl/DispatchClassImpl.h:2,
from <build-dir>/src/fastsimd/FastSIMD_FastNoise/FastSIMD_FastNoise_AARCH64.cpp:7:
<build-dir>/_deps/fastsimd-src/include/FastSIMD/ToolSet/ARM/NEON.h:
In instantiation of
'FS::Register<U, 4, SIMD> FS::Cast(const Register<T, 4, SIMD>&, TypeDummy<U>)
[with U = int;
T = Mask<32, false>;
FastSIMD::FeatureSet SIMD = FastSIMD::FeatureSet::AARCH64;
<template-parameter-1-4> = __Uint32x4_t]':
<build-dir>/_deps/fastsimd-src/include/FastSIMD/ToolSet/Generic/Functions.h:121:42:
required from
'FS::Register<T, N, SIMD> FS::impl::Cast(const FS::Register<U, N, SIMD>&, FS::TypeDummy<U>)
[with U = int;
T = FS::Mask<32, false>;
long unsigned int N = 8;
FastSIMD::FeatureSet SIMD = FastSIMD::FeatureSet::AARCH64]'
<source-dir>/include/FastNoise/Generators/DomainWarpSimplex.inl:569:47:
required from
'void FastNoise::ApplyOrthogonalGradientMatrixVectorProductSimplex(...)
[with FastSIMD::FeatureSet SIMD = FastSIMD::FeatureSet::AARCH64;
int32v = FS::Register<int, 8>;
float32v = FS::Register<float, 8>]'
<source-dir>/include/FastNoise/Generators/DomainWarpSimplex.inl:569:47:
indexPositive |= FS::Cast<int32_t>( singleNonExtraCase );
~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~
<build-dir>/_deps/fastsimd-src/include/FastSIMD/ToolSet/ARM/NEON.h:39:31:
error: could not convert
'(& a)->FS::Register<FS::Mask<32, false>, 4, FastSIMD::FeatureSet::AARCH64, void>::GetNative()'
from
'FS::Register<FS::Mask<32, false>, 4, FastSIMD::FeatureSet::AARCH64, void>::NativeType'
{aka 'uint32x4_t'}
to
'FS::Register<int, 4, FastSIMD::FeatureSet::AARCH64, void>'
39 | return a.GetNative();
| ~~~~~~~~~~~^~
| |
| uint32x4_t
The same error also occurs for the NEON backend:
FAILED: src/CMakeFiles/FastSIMD_FastNoise.dir/fastsimd/FastSIMD_FastNoise/FastSIMD_FastNoise_NEON.cpp.o
<compiler> \
-DFASTSIMD_EXPORT \
-DFASTSIMD_IS_RELAXED=1 \
-DFASTSIMD_LIBRARY_NAME=FastSIMD_FastNoise \
-DFASTSIMD_STATIC_LIB \
-I<build-dir>/src/fastsimd/FastSIMD_FastNoise/include \
-I<source-dir>/include \
-I<build-dir>/_deps/fastsimd-src/include \
-O2 -g -DNDEBUG \
-flto=auto \
-Wno-ignored-attributes \
-Wno-nan-infinity-disabled \
-ffast-math \
-std=gnu++17 \
-c <build-dir>/src/fastsimd/FastSIMD_FastNoise/FastSIMD_FastNoise_NEON.cpp
In file included from <build-dir>/_deps/fastsimd-src/include/FastSIMD/ToolSet/ARM/ARM.h:4,
from <build-dir>/_deps/fastsimd-src/include/FastSIMD/ToolSet.h:31,
from <build-dir>/_deps/fastsimd-src/dispatch/impl/DispatchClassImpl.h:2,
from <build-dir>/src/fastsimd/FastSIMD_FastNoise/FastSIMD_FastNoise_NEON.cpp:7:
<build-dir>/_deps/fastsimd-src/include/FastSIMD/ToolSet/ARM/NEON.h:
In instantiation of
'FS::Register<U, 4, SIMD> FS::Cast(const Register<T, 4, SIMD>&, TypeDummy<U>)
[with U = int;
T = Mask<32, false>;
FastSIMD::FeatureSet SIMD = FastSIMD::FeatureSet::NEON;
<template-parameter-1-4> = __Uint32x4_t]':
<source-dir>/include/FastNoise/Generators/DomainWarpSimplex.inl:569:47:
required from
'void FastNoise::ApplyOrthogonalGradientMatrixVectorProductSimplex(...)
[with FastSIMD::FeatureSet SIMD = FastSIMD::FeatureSet::NEON;
int32v = FS::Register<int, 8>;
float32v = FS::Register<float, 8>]'
<source-dir>/include/FastNoise/Generators/DomainWarpSimplex.inl:569:47:
indexPositive |= FS::Cast<int32_t>( singleNonExtraCase );
~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~
<build-dir>/_deps/fastsimd-src/include/FastSIMD/ToolSet/ARM/NEON.h:39:31:
error: could not convert
'(& a)->FS::Register<FS::Mask<32, false>, 4, FastSIMD::FeatureSet::NEON, void>::GetNative()'
from
'FS::Register<FS::Mask<32, false>, 4, FastSIMD::FeatureSet::NEON, void>::NativeType'
{aka 'uint32x4_t'}
to
'FS::Register<int, 4, FastSIMD::FeatureSet::NEON, void>'
39 | return a.GetNative();
| ~~~~~~~~~~~^~
| |
| uint32x4_t
A similar failure also occurs for Mask<32> without the false template parameter:
<build-dir>/_deps/fastsimd-src/include/FastSIMD/ToolSet/ARM/NEON.h:39:31:
error: could not convert
'(& a)->FS::Register<FS::Mask<32>, 4, FastSIMD::FeatureSet::NEON, void>::GetNative()'
from
'FS::Register<FS::Mask<32>, 4, FastSIMD::FeatureSet::NEON, void>::NativeType'
{aka 'uint32x4_t'}
to
'FS::Register<int, 4, FastSIMD::FeatureSet::NEON, void>'
There is also this compiler note, which may be unrelated:
cc1plus: note: unrecognized command-line option '-Wno-nan-infinity-disabled' may have been intended to silence earlier diagnostics
Expected result
The ARM/NEON FastSIMD backends should compile successfully with GCC 14.
Suspected cause
The problematic code seems to be in:
FastSIMD/ToolSet/ARM/NEON.h:39
where the implementation returns:
For Mask<32> / Mask<32, false>, GetNative() returns uint32x4_t, but the function return type is:
FS::Register<int, 4, SIMD>
GCC 14 rejects the implicit conversion from the unsigned native NEON vector type to the signed integer Register.
The failure is triggered through calls such as:
indexPositive |= FS::Cast<int32_t>( singleNonExtraCase );
indexA |= FS::Cast<int32_t>( equal );
in:
FastNoise/Generators/DomainWarpSimplex.inl
Description
Building FastNoise2 with the FastSIMD ARM backends enabled fails with GCC 14 when compiling the generated
FastSIMD_FastNoise_AARCH64.cppandFastSIMD_FastNoise_NEON.cpptranslation units.The error appears to come from
FastSIMD/ToolSet/ARM/NEON.h, whereFS::Cast<int32_t>(...)on aMask<32>returns a nativeuint32x4_t, but GCC 14 does not implicitly convert that toFS::Register<int, 4, ...>.Environment
-O2-DNDEBUG-flto=auto-ffast-math-DFASTSIMD_IS_RELAXED=1-DFASTSIMD_STATIC_LIBFastSIMD::FeatureSet::AARCH64FastSIMD::FeatureSet::NEONActual result
The build fails while compiling both ARM SIMD backends:
FastSIMD_FastNoise_AARCH64.cppFastSIMD_FastNoise_NEON.cppThe same error also occurs for the
NEONbackend:A similar failure also occurs for
Mask<32>without thefalsetemplate parameter:There is also this compiler note, which may be unrelated:
Expected result
The ARM/NEON FastSIMD backends should compile successfully with GCC 14.
Suspected cause
The problematic code seems to be in:
where the implementation returns:
return a.GetNative();For
Mask<32>/Mask<32, false>,GetNative()returnsuint32x4_t, but the function return type is:GCC 14 rejects the implicit conversion from the unsigned native NEON vector type to the signed integer
Register.The failure is triggered through calls such as:
in: