On Fri, Oct 06, 2017 at 01:45:18PM +0100, Tamar Christina wrote: > Hi All, > > this is a minor respin of the patch with the comments addressed. Note this > patch is now 7/8 in the series. > > > Regtested on arm-none-eabi, armeb-none-eabi, > aarch64-none-elf and aarch64_be-none-elf with no issues found. > > Ok for trunk?
OK from my perspective with minor fixups below, but much of this is Arm target specific so will need an Arm maintainer to look at. Any thoughts Kyrill, Ramana, Richard, Nick? Reviewed by: James Greenhalgh <james.greenha...@arm.com> Thanks, James > > gcc/testsuite > 2017-10-06 Tamar Christina <tamar.christ...@arm.com> > > * lib/target-supports.exp > (check_effective_target_arm_v8_2a_dotprod_neon_ok_nocache): New. > (check_effective_target_arm_v8_2a_dotprod_neon_ok): New. > (add_options_for_arm_v8_2a_dotprod_neon): New. > (check_effective_target_arm_v8_2a_dotprod_neon_hw): New. > (check_effective_target_vect_sdot_qi): New. > (check_effective_target_vect_udot_qi): New. These are not New? > * gcc.target/arm/simd/vdot-exec.c: New. > * gcc.target/aarch64/advsimd-intrinsics/vdot-exec.c: New. > * gcc/doc/sourcebuild.texi: Document arm_v8_2a_dotprod_neon. > diff --git a/gcc/doc/sourcebuild.texi b/gcc/doc/sourcebuild.texi > index > 56e1b4eb103ab412b29d6dcd9b556515ebc2ac63..c25b0ba2e1a45ea0ce23955f4e87b3e4a2d7f5b0 > 100644 > --- a/gcc/doc/sourcebuild.texi > +++ b/gcc/doc/sourcebuild.texi > @@ -1684,6 +1684,17 @@ ARM target supports executing instructions from > ARMv8.2 with the FP16 > extension. Some multilibs may be incompatible with these options. > Implies arm_v8_2a_fp16_neon_ok and arm_v8_2a_fp16_scalar_hw. > > +@item arm_v8_2a_dotprod_neon_ok > +@anchor{arm_v8_2a_dotprod_neon_ok} > +ARM target supports options to generate instructions from ARMv8.2 with Armv8.2-A? > +the Dot Product extension. Some multilibs may be incompatible with these > +options. > + > +@item arm_v8_2a_dotprod_neon_hw > +ARM target supports executing instructions from ARMv8.2 with the Dot Likewise. > +Product extension. Some multilibs may be incompatible with these options. > +Implies arm_v8_2a_dotprod_neon_ok. > + > @item arm_prefer_ldrd_strd > ARM target prefers @code{LDRD} and @code{STRD} instructions over > @code{LDM} and @code{STM} instructions. > @@ -2290,6 +2301,11 @@ supported by the target; see the > @ref{arm_v8_2a_fp16_neon_ok,,arm_v8_2a_fp16_neon_ok} effective target > keyword. > > +@item arm_v8_2a_dotprod_neon > +Add options for ARMv8.2 with Adv.SIMD Dot Product support, if this is > +supported by the target; see the > +@ref{arm_v8_2a_dotprod_neon_ok} effective target keyword. > + Likewise. > @item bind_pic_locally > Add the target-specific flags needed to enable functions to bind > locally when using pic/PIC passes in the testsuite. > diff --git a/gcc/testsuite/lib/target-supports.exp > b/gcc/testsuite/lib/target-supports.exp > index > 57f646ce2df5bcd5619870403242e73f6e91ff77..2877f08393ac0de1ff3b3258a56dff1ab1852413 > 100644 > --- a/gcc/testsuite/lib/target-supports.exp > +++ b/gcc/testsuite/lib/target-supports.exp > @@ -4311,6 +4311,48 @@ proc check_effective_target_arm_v8_2a_fp16_neon_ok { } > { > check_effective_target_arm_v8_2a_fp16_neon_ok_nocache] > } > > # Return 1 if the target supports executing ARMv8 NEON instructions, 0 > # otherwise. > > @@ -4448,6 +4490,42 @@ proc check_effective_target_arm_v8_2a_fp16_neon_hw { } > { > } [add_options_for_arm_v8_2a_fp16_neon ""]] > } > > +# Return 1 if the target supports executing AdvSIMD instructions from ARMv8.2 > +# with the Dot Product extension, 0 otherwise. The test is valid for ARM > and for > +# AArch64. > + > +proc check_effective_target_arm_v8_2a_dotprod_neon_hw { } { > + if { ![check_effective_target_arm_v8_2a_dotprod_neon_ok] } { > + return 0; > + } > + return [check_runtime arm_v8_2a_dotprod_neon_hw_available { > + #include "arm_neon.h" > + int > + main (void) > + { > + > + uint32x2_t results = {0,0}; > + uint8x8_t a = {1,1,1,1,2,2,2,2}; > + uint8x8_t b = {2,2,2,2,3,3,3,3}; > + > + #ifdef __ARM_ARCH_ISA_A64 > + asm ("udot %0.2s, %1.8b, %2.8b" > + : "=w"(results) > + : "w"(a), "w"(b) > + : /* No clobbers. */); > + > + #elif __ARM_ARCH >= 8 I don't think this does anything, should it just be else? > + asm ("vudot.u8 %P0, %P1, %P2" > + : "=w"(results) > + : "w"(a), "w"(b) > + : /* No clobbers. */); > + #endif > + > + return (results[0] == 8 && results[1] == 24) ? 1 : 0; > + } > + } [add_options_for_arm_v8_2a_dotprod_neon ""]] > +} > +