On Tue, Jun 27, 2023 at 07:23:32AM +0100, Richard Sandiford wrote: > Andrew Carlotti via Gcc-patches <gcc-patches@gcc.gnu.org> writes: > > Many intrinsics currently depend on both an architecture version and a > > feature, despite the corresponding instructions being available within > > GCC at lower architecture versions. > > > > LLVM has already removed these explicit architecture version > > dependences; this patch does the same for GCC, as well as removing an > > unecessary simd dependency for the scalar fp16 intrinsics. > > > > Binutils does not support all of these architecture+feature combinations > > yet, but this is an existing problem that is already reachable from GCC. > > For example, compiling the test gcc.target/aarch64/usadv16qi-dotprod.c > > with -O3 -march=armv8-a+dotprod has resulted in an assembler error since > > GCC 10. I intend to patch this in binutils. > > > > This patch retains explicit architecture version dependencies for > > features that do not currently have a separate feature flag. > > > > Ok for master, and backport to GCC 13? > > > > gcc/ChangeLog: > > > > * config/aarch64/aarch64.h (TARGET_MEMTAG): Remove armv8.5 > > dependency. > > * config/aarch64/arm_acle.h: Remove unnecessary armv8.x > > dependencies from target pragmas. > > * config/aarch64/arm_fp16.h (target): Likewise. > > The change to this file is a bit different from the others, > since it's removing an implicit dependency on +simd, rather > than a dependency on an architecture level. I think it'd be > worth mentioning that explicitly in the changelog. > > OK with that change, thanks. > > (Arguably we should add +nosimd to many of the other pragmas in > arm_acle.h, but that's logically a separate patch.) > > Richard
Actually, I think I should just remove the +nosimd from the patch, because +fp16 doesn't enable simd (unlike +bf16, which has simd as an 'explicit on' implication). Aside from +bf16, the only other feature with simd as an 'explicit on' is +rdma. However, there appear to be no non-simd rdma instructions, so +nothing+rdma+nosimd is effectively the same as +nothing. > > ... > > > > diff --git a/gcc/config/aarch64/arm_fp16.h b/gcc/config/aarch64/arm_fp16.h > > index > > a8fa4dbbdfe1bab4aa604bb311ef66d4e1de18ac..84b2ed66f9ba19fba6ccd8be33940d7239bfa22e > > 100644 > > --- a/gcc/config/aarch64/arm_fp16.h > > +++ b/gcc/config/aarch64/arm_fp16.h > > @@ -30,7 +30,7 @@ > > #include <stdint.h> > > > > #pragma GCC push_options > > -#pragma GCC target ("arch=armv8.2-a+fp16") > > +#pragma GCC target ("+nothing+fp16+nosimd") > > > > typedef __fp16 float16_t; > >