Hi Kyrill, On 12/18/2019 02:13 PM, Kyrill Tkachov wrote: > Hi Mihail, > > On 11/8/19 4:52 PM, Mihail Ionescu wrote: >> Hi, >> >> This patch adds CLI and multilib support for Armv8.1-M MVE to the Arm >> backend. >> Two new option added for v8.1-m.main: "+mve" for integer MVE >> instructions only >> and "+mve.fp" for both integer and single-precision/half-precision >> floating-point MVE. >> The patch also maps the Armv8.1-M multilib variants to the >> corresponding v8-M ones. >> >> >> >> gcc/ChangeLog: >> >> 2019-11-08  Mihail Ionescu  >> 2019-11-08  Andre Vieira >> >>         * config/arm/arm-cpus.in (mve, mve_float): New features. >>         (dsp, mve, mve.fp): New options. >>         * config/arm/arm.h (TARGET_HAVE_MVE, TARGET_HAVE_MVE_FLOAT): >> Define. >>         * config/arm/t-rmprofile: Map v8.1-M multilibs to v8-M. >> >> >> gcc/testsuite/ChangeLog: >> >> 2019-11-08  Mihail Ionescu  >> 2019-11-08  Andre Vieira >> >>         * testsuite/gcc.target/arm/multilib.exp: Add v8.1-M entries. >> >> >> Is this ok for trunk? > > > This is ok, but please document the new options in invoke.texi. > Here it is with the updated invoke.texi and ChangeLog. gcc/ChangeLog: 2019-12-18 Mihail Ionescu 2019-12-18 Andre Vieira * config/arm/arm-cpus.in (mve, mve_float): New features. (dsp, mve, mve.fp): New options. * config/arm/arm.h (TARGET_HAVE_MVE, TARGET_HAVE_MVE_FLOAT): Define. * config/arm/t-rmprofile: Map v8.1-M multilibs to v8-M. * doc/invoke.texi: Document the armv8.1-m mve and dsp options. gcc/testsuite/ChangeLog: 2019-12-18 Mihail Ionescu 2019-12-18 Andre Vieira * testsuite/gcc.target/arm/multilib.exp: Add v8.1-M entries. Thanks, Mihail > Thanks, > > Kyrill > > >> >> Best regards, >> >> Mihail >> >> >> ###############     Attachment also inlined for ease of reply >> ############### >> >> >> diff --git a/gcc/config/arm/arm-cpus.in b/gcc/config/arm/arm-cpus.in >> index >> 59aad8f62ee5186cc87d3cefaf40ba2ce049012d..c2f016c75e2d8dd06890295321232bef61cbd234 >> 100644 >> --- a/gcc/config/arm/arm-cpus.in >> +++ b/gcc/config/arm/arm-cpus.in >> @@ -194,6 +194,10 @@ define feature sb >>  # v8-A architectures, added by default from v8.5-A >>  define feature predres >> >> +# M-profile Vector Extension feature bits >> +define feature mve >> +define feature mve_float >> + >>  # Feature groups.  Conventionally all (or mostly) upper case. >>  # ALL_FPU lists all the feature bits associated with the floating-point >>  # unit; these will all be removed if the floating-point unit is disabled >> @@ -654,9 +658,12 @@ begin arch armv8.1-m.main >>   base 8M_MAIN >>   isa ARMv8_1m_main >>  # fp => FPv5-sp-d16; fp.dp => FPv5-d16 >> + option dsp add armv7em >>   option fp add FPv5 fp16 >>   option fp.dp add FPv5 FP_DBL fp16 >>   option nofp remove ALL_FP >> + option mve add mve armv7em >> + option mve.fp add mve FPv5 fp16 mve_float armv7em >>  end arch armv8.1-m.main >> >>  begin arch iwmmxt >> diff --git a/gcc/config/arm/arm.h b/gcc/config/arm/arm.h >> index >> 64c292f2862514fb600a4faeaddfeacb2b69180b..9ec38c6af1b84fc92e20e30e8f07ce5360a966c1 >> 100644 >> --- a/gcc/config/arm/arm.h >> +++ b/gcc/config/arm/arm.h >> @@ -310,6 +310,12 @@ emission of floating point pcs attributes.  */ >>     instructions (most are floating-point related).  */ >>  #define TARGET_HAVE_FPCXT_CMSE  (arm_arch8_1m_main) >> >> +#define TARGET_HAVE_MVE (bitmap_bit_p (arm_active_target.isa, \ >> +                                      isa_bit_mve)) >> + >> +#define TARGET_HAVE_MVE_FLOAT (bitmap_bit_p (arm_active_target.isa, \ >> + isa_bit_mve_float)) >> + >>  /* Nonzero if integer division instructions supported.  */ >>  #define TARGET_IDIV     ((TARGET_ARM && arm_arch_arm_hwdiv)     \ >>                           || (TARGET_THUMB && arm_arch_thumb_hwdiv)) >> diff --git a/gcc/config/arm/t-rmprofile b/gcc/config/arm/t-rmprofile >> index >> 807e69eaf78625f422e2d7ef5936c5c80c5b9073..62e27fd284b21524896430176d64ff5b08c6e0ef >> 100644 >> --- a/gcc/config/arm/t-rmprofile >> +++ b/gcc/config/arm/t-rmprofile >> @@ -54,7 +54,7 @@ MULTILIB_REQUIRED     += >> mthumb/march=armv8-m.main+fp.dp/mfloat-abi=softfp >>  # Arch Matches >>  MULTILIB_MATCHES        += march?armv6s-m=march?armv6-m >> >> -# Map all v8-m.main+dsp FP variants down the the variant without DSP. >> +# Map all v8-m.main+dsp FP variants down to the variant without DSP. >>  MULTILIB_MATCHES        += march?armv8-m.main=march?armv8-m.main+dsp \ >>                             $(foreach FP, +fp +fp.dp, \ >> march?armv8-m.main$(FP)=march?armv8-m.main+dsp$(FP)) >> @@ -66,3 +66,18 @@ MULTILIB_MATCHES     += >> march?armv7e-m+fp=march?armv7e-m+fpv5 >>  MULTILIB_REUSE          += $(foreach ARCH, armv6s-m armv7-m armv7e-m >> armv8-m\.base armv8-m\.main, \ >> mthumb/march.$(ARCH)/mfloat-abi.soft=mthumb/march.$(ARCH)/mfloat-abi.softfp) >> >> >> +# Map v8.1-M to v8-M. >> +MULTILIB_MATCHES       += march?armv8-m.main=march?armv8.1-m.main >> +MULTILIB_MATCHES       += march?armv8-m.main=march?armv8.1-m.main+dsp >> +MULTILIB_MATCHES       += march?armv8-m.main=march?armv8.1-m.main+mve >> + >> +v8_1m_sp_variants = +fp +dsp+fp +mve.fp >> +v8_1m_dp_variants = +fp.dp +dsp+fp.dp +fp.dp+mve +fp.dp+mve.fp >> + >> +# Map all v8.1-m.main FP sp variants down to v8-m. >> +MULTILIB_MATCHES += $(foreach FP, $(v8_1m_sp_variants), \ >> + march?armv8-m.main+fp=march?armv8.1-m.main$(FP)) >> + >> +# Map all v8.1-m.main FP dp variants down to v8-m. >> +MULTILIB_MATCHES += $(foreach FP, $(v8_1m_dp_variants), \ >> + march?armv8-m.main+fp.dp=march?armv8.1-m.main$(FP)) >> diff --git a/gcc/testsuite/gcc.target/arm/multilib.exp >> b/gcc/testsuite/gcc.target/arm/multilib.exp >> index >> dcea829965eb15e372401e6389df5a1403393ecb..63cca118da2578253740fcd95421eae9ddf219bd >> 100644 >> --- a/gcc/testsuite/gcc.target/arm/multilib.exp >> +++ b/gcc/testsuite/gcc.target/arm/multilib.exp >> @@ -775,6 +775,27 @@ if {[multilib_config "rmprofile"] } { >>          {-march=armv8-r+fp.sp -mfpu=auto -mfloat-abi=hard} >> "thumb/v7-r+fp.sp/hard" >>          {-march=armv8-r+crc+fp.sp -mfpu=auto -mfloat-abi=softfp} >> "thumb/v7-r+fp.sp/softfp" >>          {-march=armv8-r+crc+fp.sp -mfpu=auto -mfloat-abi=hard} >> "thumb/v7-r+fp.sp/hard" >> +       {-march=armv8.1-m.main -mfpu=auto -mfloat-abi=soft} >> "thumb/v8-m.main/nofp" >> +       {-march=armv8.1-m.main+dsp -mfpu=auto -mfloat-abi=soft} >> "thumb/v8-m.main/nofp" >> +       {-march=armv8.1-m.main+dsp+fp -mfpu=auto -mfloat-abi=soft} >> "thumb/v8-m.main/nofp" >> +       {-march=armv8.1-m.main+dsp+fp.dp -mfpu=auto -mfloat-abi=soft} >> "thumb/v8-m.main/nofp" >> +       {-march=armv8.1-m.main -mfpu=auto -mfloat-abi=softfp} >> "thumb/v8-m.main/nofp" >> +       {-march=armv8.1-m.main+dsp -mfpu=auto -mfloat-abi=softfp} >> "thumb/v8-m.main/nofp" >> +       {-march=armv8.1-m.main+dsp+fp -mfpu=auto -mfloat-abi=softfp} >> "thumb/v8-m.main+fp/softfp" >> +       {-march=armv8.1-m.main+dsp+fp.dp -mfpu=auto >> -mfloat-abi=softfp} "thumb/v8-m.main+dp/softfp" >> +       {-march=armv8.1-m.main+dsp+fp -mfpu=auto -mfloat-abi=hard} >> "thumb/v8-m.main+fp/hard" >> +       {-march=armv8.1-m.main+dsp+fp.dp -mfpu=auto -mfloat-abi=hard} >> "thumb/v8-m.main+dp/hard" >> +       {-march=armv8.1-m.main+mve -mfpu=auto -mfloat-abi=soft} >> "thumb/v8-m.main/nofp" >> +       {-march=armv8.1-m.main+mve.fp -mfpu=auto -mfloat-abi=soft} >> "thumb/v8-m.main/nofp" >> +       {-march=armv8.1-m.main+mve -mfpu=auto -mfloat-abi=softfp} >> "thumb/v8-m.main/nofp" >> +       {-march=armv8.1-m.main+mve.fp -mfpu=auto -mfloat-abi=softfp} >> "thumb/v8-m.main+fp/softfp" >> +       {-march=armv8.1-m.main+mve.fp -mfpu=auto -mfloat-abi=hard} >> "thumb/v8-m.main+fp/hard" >> +       {-march=armv8.1-m.main+mve+fp.dp -mfpu=auto -mfloat-abi=soft} >> "thumb/v8-m.main/nofp" >> +       {-march=armv8.1-m.main+mve.fp+fp.dp -mfpu=auto >> -mfloat-abi=soft} "thumb/v8-m.main/nofp" >> +       {-march=armv8.1-m.main+mve+fp.dp -mfpu=auto >> -mfloat-abi=softfp} "thumb/v8-m.main+dp/softfp" >> +       {-march=armv8.1-m.main+mve.fp+fp.dp -mfpu=auto >> -mfloat-abi=softfp} "thumb/v8-m.main+dp/softfp" >> +       {-march=armv8.1-m.main+mve+fp.dp -mfpu=auto -mfloat-abi=hard} >> "thumb/v8-m.main+dp/hard" >> +       {-march=armv8.1-m.main+mve.fp+fp.dp -mfpu=auto >> -mfloat-abi=hard} "thumb/v8-m.main+dp/hard" >>      } { >>          check_multi_dir $opts $dir >>      } >>