[1/2,ARC,QuarkSE] Update

Message ID 20180521102029.13464-1-claziss@gmail.com
State New
Headers show
Series
  • [1/2,ARC,QuarkSE] Update
Related show

Commit Message

Claudiu Zissulescu May 21, 2018, 10:20 a.m.
From: claziss <claziss@synopsys.com>


QuarkSE has lp_count width set to 16 bits. Update the compiler to
consider it.

Ok to apply?
Claudiu

gcc/
2017-07-11  Claudiu Zissulescu  <claziss@synopsys.com>

	* config/arc/arc-arch.h (arc_extras): New enum.
	(arc_cpu_t): Add field extra.
	(arc_cpu_types): Consider the extras.
	* config/arc/arc-cpus.def: Add extras info.
	* config/arc/arc-opts.h (processor_type): Consider extra field.
	* config/arc/arc.c (arc_override_options): Handle extra field.
---
 gcc/config/arc/arc-arch.h   | 19 ++++++++++++---
 gcc/config/arc/arc-cpus.def | 59 ++++++++++++++++++++++++---------------------
 gcc/config/arc/arc-opts.h   |  2 +-
 gcc/config/arc/arc.c        | 10 ++++++++
 4 files changed, 57 insertions(+), 33 deletions(-)

-- 
2.14.3

Comments

Andrew Burgess June 4, 2018, 9:42 p.m. | #1
* Claudiu Zissulescu <claziss@gmail.com> [2018-05-21 13:20:28 +0300]:

> From: claziss <claziss@synopsys.com>

> 

> QuarkSE has lp_count width set to 16 bits. Update the compiler to

> consider it.

> 

> Ok to apply?

> Claudiu

> 

> gcc/

> 2017-07-11  Claudiu Zissulescu  <claziss@synopsys.com>

> 

> 	* config/arc/arc-arch.h (arc_extras): New enum.

> 	(arc_cpu_t): Add field extra.

> 	(arc_cpu_types): Consider the extras.

> 	* config/arc/arc-cpus.def: Add extras info.

> 	* config/arc/arc-opts.h (processor_type): Consider extra field.

> 	* config/arc/arc.c (arc_override_options): Handle extra field.


The field name 'extra' seems a little vague.  Can this field ever be
used for more than just lp_count size?  Would a name related more to
lp_count be better?  Or if the intention is that other flags might get
added, maybe there's a name that could suggest that usage?

As a minimum maybe the comment on the new field could describe what
the field is for?

Thanks,
Andrew


> ---

>  gcc/config/arc/arc-arch.h   | 19 ++++++++++++---

>  gcc/config/arc/arc-cpus.def | 59 ++++++++++++++++++++++++---------------------

>  gcc/config/arc/arc-opts.h   |  2 +-

>  gcc/config/arc/arc.c        | 10 ++++++++

>  4 files changed, 57 insertions(+), 33 deletions(-)

> 

> diff --git a/gcc/config/arc/arc-arch.h b/gcc/config/arc/arc-arch.h

> index 01f95946623..f90be66e200 100644

> --- a/gcc/config/arc/arc-arch.h

> +++ b/gcc/config/arc/arc-arch.h

> @@ -79,6 +79,14 @@ enum arc_tune_attr

>      ARC_TUNE_ARCHS4XD_SLOW

>    };

>  

> +/* Extra options for a processor.  */

> +

> +enum arc_extras

> +{

> +  HAS_NONE,

> +  HAS_LPCOUNT_16

> +};

> +

>  /* CPU specific properties.  */

>  

>  typedef struct

> @@ -95,6 +103,9 @@ typedef struct

>    /* Specific flags.  */

>    const unsigned long long flags;

>  

> +  /* Extra value.  */

> +  enum arc_extras extra;

> +

>    /* Tune value.  */

>    enum arc_tune_attr tune;

>  

> @@ -112,12 +123,12 @@ const arc_arch_t arc_arch_types[] =

>  

>  const arc_cpu_t arc_cpu_types[] =

>    {

> -    {"none", NULL, PROCESSOR_NONE, 0, ARC_TUNE_NONE},

> -#define ARC_CPU(NAME, ARCH, FLAGS, TUNE)	\

> -    {#NAME, &arc_arch_types [BASE_ARCH_##ARCH], PROCESSOR_##NAME, FLAGS, ARC_TUNE_##TUNE },

> +    {"none", NULL, PROCESSOR_NONE, 0, HAS_NONE, ARC_TUNE_NONE},

> +#define ARC_CPU(NAME, ARCH, FLAGS, EXTRA, TUNE)				\

> +    {#NAME, &arc_arch_types [BASE_ARCH_##ARCH], PROCESSOR_##NAME, FLAGS, HAS_##EXTRA, ARC_TUNE_##TUNE },

>  #include "arc-cpus.def"

>  #undef ARC_CPU

> -    {NULL, NULL, PROCESSOR_NONE, 0, ARC_TUNE_NONE}

> +    {NULL, NULL, PROCESSOR_NONE, 0, HAS_NONE, ARC_TUNE_NONE}

>    };

>  

>  /* Currently selected cpu type.  */

> diff --git a/gcc/config/arc/arc-cpus.def b/gcc/config/arc/arc-cpus.def

> index 4aa422f1a39..eea83917b42 100644

> --- a/gcc/config/arc/arc-cpus.def

> +++ b/gcc/config/arc/arc-cpus.def

> @@ -43,36 +43,39 @@

>  	  as defined in arc-options.def file, and allowed by arc-arches.def

>  	  file.  The specific hardware flags are enumerated without using

>  	  spaces between the '|' character and consequtive flags.

> +   EXTRA  Extra hardware flags, different than the ones in

> +	  arc-arches.def.  Here we can specify the width of lp_count,

> +	  for example.

>     TUNE	  Tune value for the given configuration, otherwise NONE.  */

>  

> -ARC_CPU (em,	    em, 0, NONE)

> -ARC_CPU (em_mini,   em, FL_RF16, NONE)

> -ARC_CPU (arcem,	    em, FL_MPYOPT_2|FL_CD|FL_BS, NONE)

> -ARC_CPU (em4,	    em, FL_CD, NONE)

> -ARC_CPU (em4_dmips, em, FL_MPYOPT_2|FL_CD|FL_DIVREM|FL_NORM|FL_SWAP|FL_BS, NONE)

> -ARC_CPU (em4_fpus,  em, FL_MPYOPT_2|FL_CD|FL_DIVREM|FL_NORM|FL_SWAP|FL_BS|FL_FPU_FPUS, NONE)

> -ARC_CPU (em4_fpuda, em, FL_MPYOPT_2|FL_CD|FL_DIVREM|FL_NORM|FL_SWAP|FL_BS|FL_FPU_FPUDA, NONE)

> -ARC_CPU (quarkse_em, em, FL_MPYOPT_3|FL_CD|FL_DIVREM|FL_NORM|FL_SWAP|FL_BS|FL_FPX_QUARK|FL_SPFP|FL_DPFP, NONE)

> -

> -ARC_CPU (hs,	     hs, 0, NONE)

> -ARC_CPU (archs,	     hs, FL_MPYOPT_2|FL_DIVREM|FL_LL64, NONE)

> -ARC_CPU (hs34,	     hs, FL_MPYOPT_2, NONE)

> -ARC_CPU (hs38,	     hs, FL_MPYOPT_9|FL_DIVREM|FL_LL64, NONE)

> -ARC_CPU (hs38_linux, hs, FL_MPYOPT_9|FL_DIVREM|FL_LL64|FL_FPU_FPUD_ALL, NONE)

> -ARC_CPU (hs4x,  hs, FL_MPYOPT_9|FL_DIVREM|FL_LL64, ARCHS4X)

> -ARC_CPU (hs4xd, hs, FL_MPYOPT_9|FL_DIVREM|FL_LL64, ARCHS4XD)

> -

> -ARC_CPU (arc600,          6xx, FL_BS, ARC600)

> -ARC_CPU (arc600_norm,     6xx, FL_BS|FL_NORM, ARC600)

> -ARC_CPU (arc600_mul64,    6xx, FL_BS|FL_NORM|FL_MUL64, ARC600)

> -ARC_CPU (arc600_mul32x16, 6xx, FL_BS|FL_NORM|FL_MUL32x16, ARC600)

> -ARC_CPU (arc601,	  6xx, 0, ARC600)

> -ARC_CPU (arc601_norm,	  6xx, FL_NORM, ARC600)

> -ARC_CPU (arc601_mul64,	  6xx, FL_NORM|FL_MUL64, ARC600)

> -ARC_CPU (arc601_mul32x16, 6xx, FL_NORM|FL_MUL32x16, ARC600)

> -

> -ARC_CPU (arc700, 700, 0, ARC700_4_2_STD)

> -ARC_CPU (nps400, 700, 0, ARC700_4_2_STD)

> +ARC_CPU (em,	    em, 0, NONE, NONE)

> +ARC_CPU (em_mini,   em, FL_RF16, NONE, NONE)

> +ARC_CPU (arcem,	    em, FL_MPYOPT_2|FL_CD|FL_BS, NONE, NONE)

> +ARC_CPU (em4,	    em, FL_CD, NONE, NONE)

> +ARC_CPU (em4_dmips, em, FL_MPYOPT_2|FL_CD|FL_DIVREM|FL_NORM|FL_SWAP|FL_BS, NONE, NONE)

> +ARC_CPU (em4_fpus,  em, FL_MPYOPT_2|FL_CD|FL_DIVREM|FL_NORM|FL_SWAP|FL_BS|FL_FPU_FPUS, NONE, NONE)

> +ARC_CPU (em4_fpuda, em, FL_MPYOPT_2|FL_CD|FL_DIVREM|FL_NORM|FL_SWAP|FL_BS|FL_FPU_FPUDA, NONE, NONE)

> +ARC_CPU (quarkse_em, em, FL_MPYOPT_3|FL_CD|FL_DIVREM|FL_NORM|FL_SWAP|FL_BS|FL_FPX_QUARK|FL_SPFP|FL_DPFP, LPCOUNT_16, NONE)

> +

> +ARC_CPU (hs,         hs, 0, NONE, NONE)

> +ARC_CPU (archs,	     hs, FL_MPYOPT_2|FL_DIVREM|FL_LL64, NONE, NONE)

> +ARC_CPU (hs34,	     hs, FL_MPYOPT_2, NONE, NONE)

> +ARC_CPU (hs38,	     hs, FL_MPYOPT_9|FL_DIVREM|FL_LL64, NONE, NONE)

> +ARC_CPU (hs38_linux, hs, FL_MPYOPT_9|FL_DIVREM|FL_LL64|FL_FPU_FPUD_ALL, NONE, NONE)

> +ARC_CPU (hs4x,  hs, FL_MPYOPT_9|FL_DIVREM|FL_LL64, NONE, ARCHS4X)

> +ARC_CPU (hs4xd, hs, FL_MPYOPT_9|FL_DIVREM|FL_LL64, NONE, ARCHS4XD)

> +

> +ARC_CPU (arc600,          6xx, FL_BS, NONE, ARC600)

> +ARC_CPU (arc600_norm,     6xx, FL_BS|FL_NORM, NONE, ARC600)

> +ARC_CPU (arc600_mul64,    6xx, FL_BS|FL_NORM|FL_MUL64, NONE, ARC600)

> +ARC_CPU (arc600_mul32x16, 6xx, FL_BS|FL_NORM|FL_MUL32x16, NONE, ARC600)

> +ARC_CPU (arc601,	  6xx, 0, NONE, ARC600)

> +ARC_CPU (arc601_norm,	  6xx, FL_NORM, NONE, ARC600)

> +ARC_CPU (arc601_mul64,	  6xx, FL_NORM|FL_MUL64, NONE, ARC600)

> +ARC_CPU (arc601_mul32x16, 6xx, FL_NORM|FL_MUL32x16, NONE, ARC600)

> +

> +ARC_CPU (arc700, 700, 0, NONE, ARC700_4_2_STD)

> +ARC_CPU (nps400, 700, 0, NONE, ARC700_4_2_STD)

>  

>  /* Local Variables: */

>  /* mode: c */

> diff --git a/gcc/config/arc/arc-opts.h b/gcc/config/arc/arc-opts.h

> index 838e59b0bf3..3a7b7042de0 100644

> --- a/gcc/config/arc/arc-opts.h

> +++ b/gcc/config/arc/arc-opts.h

> @@ -24,7 +24,7 @@

>  enum processor_type

>  {

>    PROCESSOR_NONE = 0,

> -#define ARC_CPU(NAME, ARCH, FLAGS, TUNE)  PROCESSOR_##NAME,

> +#define ARC_CPU(NAME, ARCH, FLAGS, EXTRA, TUNE)  PROCESSOR_##NAME,

>  #include "arc-cpus.def"

>  #undef ARC_CPU

>    PROCESSOR_generic

> diff --git a/gcc/config/arc/arc.c b/gcc/config/arc/arc.c

> index 03a2f4223c0..56715a8f61d 100644

> --- a/gcc/config/arc/arc.c

> +++ b/gcc/config/arc/arc.c

> @@ -1256,6 +1256,16 @@ arc_override_options (void)

>  #undef ARC_OPTX

>  #undef ARC_OPT

>  

> +  /* Set extras.  */

> +  switch (arc_selected_cpu->extra)

> +    {

> +    case HAS_LPCOUNT_16:

> +      arc_lpcwidth = 16;

> +      break;

> +    default:

> +      break;

> +    }

> +

>    /* Set Tune option.  */

>    if (arc_tune == ARC_TUNE_NONE)

>      arc_tune = (enum arc_tune_attr) arc_selected_cpu->tune;

> -- 

> 2.14.3

>
Claudiu Zissulescu June 12, 2018, 11:53 a.m. | #2
Hi,

The purpose of this field is to hold all other possible configurations which doesn't fit in the general scheme. The LP_COUNT width is an example, other can be the information about register banks used for interrupts.
I will add extra comments in the sources.

Thanks,
Claudiu
________________________________________
From: Andrew Burgess [andrew.burgess@embecosm.com]

Sent: Monday, June 04, 2018 11:42 PM
To: Claudiu Zissulescu
Cc: gcc-patches@gcc.gnu.org; Francois.Bedard@synopsys.com; claziss@synopsys.comq; claziss
Subject: Re: [PATCH 1/2] [ARC][QuarkSE] Update

* Claudiu Zissulescu <claziss@gmail.com> [2018-05-21 13:20:28 +0300]:

> From: claziss <claziss@synopsys.com>

>

> QuarkSE has lp_count width set to 16 bits. Update the compiler to

> consider it.

>

> Ok to apply?

> Claudiu

>

> gcc/

> 2017-07-11  Claudiu Zissulescu  <claziss@synopsys.com>

>

>       * config/arc/arc-arch.h (arc_extras): New enum.

>       (arc_cpu_t): Add field extra.

>       (arc_cpu_types): Consider the extras.

>       * config/arc/arc-cpus.def: Add extras info.

>       * config/arc/arc-opts.h (processor_type): Consider extra field.

>       * config/arc/arc.c (arc_override_options): Handle extra field.


The field name 'extra' seems a little vague.  Can this field ever be
used for more than just lp_count size?  Would a name related more to
lp_count be better?  Or if the intention is that other flags might get
added, maybe there's a name that could suggest that usage?

As a minimum maybe the comment on the new field could describe what
the field is for?

Thanks,
Andrew


> ---

>  gcc/config/arc/arc-arch.h   | 19 ++++++++++++---

>  gcc/config/arc/arc-cpus.def | 59 ++++++++++++++++++++++++---------------------

>  gcc/config/arc/arc-opts.h   |  2 +-

>  gcc/config/arc/arc.c        | 10 ++++++++

>  4 files changed, 57 insertions(+), 33 deletions(-)

>

> diff --git a/gcc/config/arc/arc-arch.h b/gcc/config/arc/arc-arch.h

> index 01f95946623..f90be66e200 100644

> --- a/gcc/config/arc/arc-arch.h

> +++ b/gcc/config/arc/arc-arch.h

> @@ -79,6 +79,14 @@ enum arc_tune_attr

>      ARC_TUNE_ARCHS4XD_SLOW

>    };

>

> +/* Extra options for a processor.  */

> +

> +enum arc_extras

> +{

> +  HAS_NONE,

> +  HAS_LPCOUNT_16

> +};

> +

>  /* CPU specific properties.  */

>

>  typedef struct

> @@ -95,6 +103,9 @@ typedef struct

>    /* Specific flags.  */

>    const unsigned long long flags;

>

> +  /* Extra value.  */

> +  enum arc_extras extra;

> +

>    /* Tune value.  */

>    enum arc_tune_attr tune;

>

> @@ -112,12 +123,12 @@ const arc_arch_t arc_arch_types[] =

>

>  const arc_cpu_t arc_cpu_types[] =

>    {

> -    {"none", NULL, PROCESSOR_NONE, 0, ARC_TUNE_NONE},

> -#define ARC_CPU(NAME, ARCH, FLAGS, TUNE)     \

> -    {#NAME, &arc_arch_types [BASE_ARCH_##ARCH], PROCESSOR_##NAME, FLAGS, ARC_TUNE_##TUNE },

> +    {"none", NULL, PROCESSOR_NONE, 0, HAS_NONE, ARC_TUNE_NONE},

> +#define ARC_CPU(NAME, ARCH, FLAGS, EXTRA, TUNE)                              \

> +    {#NAME, &arc_arch_types [BASE_ARCH_##ARCH], PROCESSOR_##NAME, FLAGS, HAS_##EXTRA, ARC_TUNE_##TUNE },

>  #include "arc-cpus.def"

>  #undef ARC_CPU

> -    {NULL, NULL, PROCESSOR_NONE, 0, ARC_TUNE_NONE}

> +    {NULL, NULL, PROCESSOR_NONE, 0, HAS_NONE, ARC_TUNE_NONE}

>    };

>

>  /* Currently selected cpu type.  */

> diff --git a/gcc/config/arc/arc-cpus.def b/gcc/config/arc/arc-cpus.def

> index 4aa422f1a39..eea83917b42 100644

> --- a/gcc/config/arc/arc-cpus.def

> +++ b/gcc/config/arc/arc-cpus.def

> @@ -43,36 +43,39 @@

>         as defined in arc-options.def file, and allowed by arc-arches.def

>         file.  The specific hardware flags are enumerated without using

>         spaces between the '|' character and consequtive flags.

> +   EXTRA  Extra hardware flags, different than the ones in

> +       arc-arches.def.  Here we can specify the width of lp_count,

> +       for example.

>     TUNE        Tune value for the given configuration, otherwise NONE.  */

>

> -ARC_CPU (em,     em, 0, NONE)

> -ARC_CPU (em_mini,   em, FL_RF16, NONE)

> -ARC_CPU (arcem,          em, FL_MPYOPT_2|FL_CD|FL_BS, NONE)

> -ARC_CPU (em4,            em, FL_CD, NONE)

> -ARC_CPU (em4_dmips, em, FL_MPYOPT_2|FL_CD|FL_DIVREM|FL_NORM|FL_SWAP|FL_BS, NONE)

> -ARC_CPU (em4_fpus,  em, FL_MPYOPT_2|FL_CD|FL_DIVREM|FL_NORM|FL_SWAP|FL_BS|FL_FPU_FPUS, NONE)

> -ARC_CPU (em4_fpuda, em, FL_MPYOPT_2|FL_CD|FL_DIVREM|FL_NORM|FL_SWAP|FL_BS|FL_FPU_FPUDA, NONE)

> -ARC_CPU (quarkse_em, em, FL_MPYOPT_3|FL_CD|FL_DIVREM|FL_NORM|FL_SWAP|FL_BS|FL_FPX_QUARK|FL_SPFP|FL_DPFP, NONE)

> -

> -ARC_CPU (hs,      hs, 0, NONE)

> -ARC_CPU (archs,           hs, FL_MPYOPT_2|FL_DIVREM|FL_LL64, NONE)

> -ARC_CPU (hs34,            hs, FL_MPYOPT_2, NONE)

> -ARC_CPU (hs38,            hs, FL_MPYOPT_9|FL_DIVREM|FL_LL64, NONE)

> -ARC_CPU (hs38_linux, hs, FL_MPYOPT_9|FL_DIVREM|FL_LL64|FL_FPU_FPUD_ALL, NONE)

> -ARC_CPU (hs4x,  hs, FL_MPYOPT_9|FL_DIVREM|FL_LL64, ARCHS4X)

> -ARC_CPU (hs4xd, hs, FL_MPYOPT_9|FL_DIVREM|FL_LL64, ARCHS4XD)

> -

> -ARC_CPU (arc600,          6xx, FL_BS, ARC600)

> -ARC_CPU (arc600_norm,     6xx, FL_BS|FL_NORM, ARC600)

> -ARC_CPU (arc600_mul64,    6xx, FL_BS|FL_NORM|FL_MUL64, ARC600)

> -ARC_CPU (arc600_mul32x16, 6xx, FL_BS|FL_NORM|FL_MUL32x16, ARC600)

> -ARC_CPU (arc601,       6xx, 0, ARC600)

> -ARC_CPU (arc601_norm,          6xx, FL_NORM, ARC600)

> -ARC_CPU (arc601_mul64,         6xx, FL_NORM|FL_MUL64, ARC600)

> -ARC_CPU (arc601_mul32x16, 6xx, FL_NORM|FL_MUL32x16, ARC600)

> -

> -ARC_CPU (arc700, 700, 0, ARC700_4_2_STD)

> -ARC_CPU (nps400, 700, 0, ARC700_4_2_STD)

> +ARC_CPU (em,     em, 0, NONE, NONE)

> +ARC_CPU (em_mini,   em, FL_RF16, NONE, NONE)

> +ARC_CPU (arcem,          em, FL_MPYOPT_2|FL_CD|FL_BS, NONE, NONE)

> +ARC_CPU (em4,            em, FL_CD, NONE, NONE)

> +ARC_CPU (em4_dmips, em, FL_MPYOPT_2|FL_CD|FL_DIVREM|FL_NORM|FL_SWAP|FL_BS, NONE, NONE)

> +ARC_CPU (em4_fpus,  em, FL_MPYOPT_2|FL_CD|FL_DIVREM|FL_NORM|FL_SWAP|FL_BS|FL_FPU_FPUS, NONE, NONE)

> +ARC_CPU (em4_fpuda, em, FL_MPYOPT_2|FL_CD|FL_DIVREM|FL_NORM|FL_SWAP|FL_BS|FL_FPU_FPUDA, NONE, NONE)

> +ARC_CPU (quarkse_em, em, FL_MPYOPT_3|FL_CD|FL_DIVREM|FL_NORM|FL_SWAP|FL_BS|FL_FPX_QUARK|FL_SPFP|FL_DPFP, LPCOUNT_16, NONE)

> +

> +ARC_CPU (hs,         hs, 0, NONE, NONE)

> +ARC_CPU (archs,           hs, FL_MPYOPT_2|FL_DIVREM|FL_LL64, NONE, NONE)

> +ARC_CPU (hs34,            hs, FL_MPYOPT_2, NONE, NONE)

> +ARC_CPU (hs38,            hs, FL_MPYOPT_9|FL_DIVREM|FL_LL64, NONE, NONE)

> +ARC_CPU (hs38_linux, hs, FL_MPYOPT_9|FL_DIVREM|FL_LL64|FL_FPU_FPUD_ALL, NONE, NONE)

> +ARC_CPU (hs4x,  hs, FL_MPYOPT_9|FL_DIVREM|FL_LL64, NONE, ARCHS4X)

> +ARC_CPU (hs4xd, hs, FL_MPYOPT_9|FL_DIVREM|FL_LL64, NONE, ARCHS4XD)

> +

> +ARC_CPU (arc600,          6xx, FL_BS, NONE, ARC600)

> +ARC_CPU (arc600_norm,     6xx, FL_BS|FL_NORM, NONE, ARC600)

> +ARC_CPU (arc600_mul64,    6xx, FL_BS|FL_NORM|FL_MUL64, NONE, ARC600)

> +ARC_CPU (arc600_mul32x16, 6xx, FL_BS|FL_NORM|FL_MUL32x16, NONE, ARC600)

> +ARC_CPU (arc601,       6xx, 0, NONE, ARC600)

> +ARC_CPU (arc601_norm,          6xx, FL_NORM, NONE, ARC600)

> +ARC_CPU (arc601_mul64,         6xx, FL_NORM|FL_MUL64, NONE, ARC600)

> +ARC_CPU (arc601_mul32x16, 6xx, FL_NORM|FL_MUL32x16, NONE, ARC600)

> +

> +ARC_CPU (arc700, 700, 0, NONE, ARC700_4_2_STD)

> +ARC_CPU (nps400, 700, 0, NONE, ARC700_4_2_STD)

>

>  /* Local Variables: */

>  /* mode: c */

> diff --git a/gcc/config/arc/arc-opts.h b/gcc/config/arc/arc-opts.h

> index 838e59b0bf3..3a7b7042de0 100644

> --- a/gcc/config/arc/arc-opts.h

> +++ b/gcc/config/arc/arc-opts.h

> @@ -24,7 +24,7 @@

>  enum processor_type

>  {

>    PROCESSOR_NONE = 0,

> -#define ARC_CPU(NAME, ARCH, FLAGS, TUNE)  PROCESSOR_##NAME,

> +#define ARC_CPU(NAME, ARCH, FLAGS, EXTRA, TUNE)  PROCESSOR_##NAME,

>  #include "arc-cpus.def"

>  #undef ARC_CPU

>    PROCESSOR_generic

> diff --git a/gcc/config/arc/arc.c b/gcc/config/arc/arc.c

> index 03a2f4223c0..56715a8f61d 100644

> --- a/gcc/config/arc/arc.c

> +++ b/gcc/config/arc/arc.c

> @@ -1256,6 +1256,16 @@ arc_override_options (void)

>  #undef ARC_OPTX

>  #undef ARC_OPT

>

> +  /* Set extras.  */

> +  switch (arc_selected_cpu->extra)

> +    {

> +    case HAS_LPCOUNT_16:

> +      arc_lpcwidth = 16;

> +      break;

> +    default:

> +      break;

> +    }

> +

>    /* Set Tune option.  */

>    if (arc_tune == ARC_TUNE_NONE)

>      arc_tune = (enum arc_tune_attr) arc_selected_cpu->tune;

> --

> 2.14.3

>

Patch

diff --git a/gcc/config/arc/arc-arch.h b/gcc/config/arc/arc-arch.h
index 01f95946623..f90be66e200 100644
--- a/gcc/config/arc/arc-arch.h
+++ b/gcc/config/arc/arc-arch.h
@@ -79,6 +79,14 @@  enum arc_tune_attr
     ARC_TUNE_ARCHS4XD_SLOW
   };
 
+/* Extra options for a processor.  */
+
+enum arc_extras
+{
+  HAS_NONE,
+  HAS_LPCOUNT_16
+};
+
 /* CPU specific properties.  */
 
 typedef struct
@@ -95,6 +103,9 @@  typedef struct
   /* Specific flags.  */
   const unsigned long long flags;
 
+  /* Extra value.  */
+  enum arc_extras extra;
+
   /* Tune value.  */
   enum arc_tune_attr tune;
 
@@ -112,12 +123,12 @@  const arc_arch_t arc_arch_types[] =
 
 const arc_cpu_t arc_cpu_types[] =
   {
-    {"none", NULL, PROCESSOR_NONE, 0, ARC_TUNE_NONE},
-#define ARC_CPU(NAME, ARCH, FLAGS, TUNE)	\
-    {#NAME, &arc_arch_types [BASE_ARCH_##ARCH], PROCESSOR_##NAME, FLAGS, ARC_TUNE_##TUNE },
+    {"none", NULL, PROCESSOR_NONE, 0, HAS_NONE, ARC_TUNE_NONE},
+#define ARC_CPU(NAME, ARCH, FLAGS, EXTRA, TUNE)				\
+    {#NAME, &arc_arch_types [BASE_ARCH_##ARCH], PROCESSOR_##NAME, FLAGS, HAS_##EXTRA, ARC_TUNE_##TUNE },
 #include "arc-cpus.def"
 #undef ARC_CPU
-    {NULL, NULL, PROCESSOR_NONE, 0, ARC_TUNE_NONE}
+    {NULL, NULL, PROCESSOR_NONE, 0, HAS_NONE, ARC_TUNE_NONE}
   };
 
 /* Currently selected cpu type.  */
diff --git a/gcc/config/arc/arc-cpus.def b/gcc/config/arc/arc-cpus.def
index 4aa422f1a39..eea83917b42 100644
--- a/gcc/config/arc/arc-cpus.def
+++ b/gcc/config/arc/arc-cpus.def
@@ -43,36 +43,39 @@ 
 	  as defined in arc-options.def file, and allowed by arc-arches.def
 	  file.  The specific hardware flags are enumerated without using
 	  spaces between the '|' character and consequtive flags.
+   EXTRA  Extra hardware flags, different than the ones in
+	  arc-arches.def.  Here we can specify the width of lp_count,
+	  for example.
    TUNE	  Tune value for the given configuration, otherwise NONE.  */
 
-ARC_CPU (em,	    em, 0, NONE)
-ARC_CPU (em_mini,   em, FL_RF16, NONE)
-ARC_CPU (arcem,	    em, FL_MPYOPT_2|FL_CD|FL_BS, NONE)
-ARC_CPU (em4,	    em, FL_CD, NONE)
-ARC_CPU (em4_dmips, em, FL_MPYOPT_2|FL_CD|FL_DIVREM|FL_NORM|FL_SWAP|FL_BS, NONE)
-ARC_CPU (em4_fpus,  em, FL_MPYOPT_2|FL_CD|FL_DIVREM|FL_NORM|FL_SWAP|FL_BS|FL_FPU_FPUS, NONE)
-ARC_CPU (em4_fpuda, em, FL_MPYOPT_2|FL_CD|FL_DIVREM|FL_NORM|FL_SWAP|FL_BS|FL_FPU_FPUDA, NONE)
-ARC_CPU (quarkse_em, em, FL_MPYOPT_3|FL_CD|FL_DIVREM|FL_NORM|FL_SWAP|FL_BS|FL_FPX_QUARK|FL_SPFP|FL_DPFP, NONE)
-
-ARC_CPU (hs,	     hs, 0, NONE)
-ARC_CPU (archs,	     hs, FL_MPYOPT_2|FL_DIVREM|FL_LL64, NONE)
-ARC_CPU (hs34,	     hs, FL_MPYOPT_2, NONE)
-ARC_CPU (hs38,	     hs, FL_MPYOPT_9|FL_DIVREM|FL_LL64, NONE)
-ARC_CPU (hs38_linux, hs, FL_MPYOPT_9|FL_DIVREM|FL_LL64|FL_FPU_FPUD_ALL, NONE)
-ARC_CPU (hs4x,  hs, FL_MPYOPT_9|FL_DIVREM|FL_LL64, ARCHS4X)
-ARC_CPU (hs4xd, hs, FL_MPYOPT_9|FL_DIVREM|FL_LL64, ARCHS4XD)
-
-ARC_CPU (arc600,          6xx, FL_BS, ARC600)
-ARC_CPU (arc600_norm,     6xx, FL_BS|FL_NORM, ARC600)
-ARC_CPU (arc600_mul64,    6xx, FL_BS|FL_NORM|FL_MUL64, ARC600)
-ARC_CPU (arc600_mul32x16, 6xx, FL_BS|FL_NORM|FL_MUL32x16, ARC600)
-ARC_CPU (arc601,	  6xx, 0, ARC600)
-ARC_CPU (arc601_norm,	  6xx, FL_NORM, ARC600)
-ARC_CPU (arc601_mul64,	  6xx, FL_NORM|FL_MUL64, ARC600)
-ARC_CPU (arc601_mul32x16, 6xx, FL_NORM|FL_MUL32x16, ARC600)
-
-ARC_CPU (arc700, 700, 0, ARC700_4_2_STD)
-ARC_CPU (nps400, 700, 0, ARC700_4_2_STD)
+ARC_CPU (em,	    em, 0, NONE, NONE)
+ARC_CPU (em_mini,   em, FL_RF16, NONE, NONE)
+ARC_CPU (arcem,	    em, FL_MPYOPT_2|FL_CD|FL_BS, NONE, NONE)
+ARC_CPU (em4,	    em, FL_CD, NONE, NONE)
+ARC_CPU (em4_dmips, em, FL_MPYOPT_2|FL_CD|FL_DIVREM|FL_NORM|FL_SWAP|FL_BS, NONE, NONE)
+ARC_CPU (em4_fpus,  em, FL_MPYOPT_2|FL_CD|FL_DIVREM|FL_NORM|FL_SWAP|FL_BS|FL_FPU_FPUS, NONE, NONE)
+ARC_CPU (em4_fpuda, em, FL_MPYOPT_2|FL_CD|FL_DIVREM|FL_NORM|FL_SWAP|FL_BS|FL_FPU_FPUDA, NONE, NONE)
+ARC_CPU (quarkse_em, em, FL_MPYOPT_3|FL_CD|FL_DIVREM|FL_NORM|FL_SWAP|FL_BS|FL_FPX_QUARK|FL_SPFP|FL_DPFP, LPCOUNT_16, NONE)
+
+ARC_CPU (hs,         hs, 0, NONE, NONE)
+ARC_CPU (archs,	     hs, FL_MPYOPT_2|FL_DIVREM|FL_LL64, NONE, NONE)
+ARC_CPU (hs34,	     hs, FL_MPYOPT_2, NONE, NONE)
+ARC_CPU (hs38,	     hs, FL_MPYOPT_9|FL_DIVREM|FL_LL64, NONE, NONE)
+ARC_CPU (hs38_linux, hs, FL_MPYOPT_9|FL_DIVREM|FL_LL64|FL_FPU_FPUD_ALL, NONE, NONE)
+ARC_CPU (hs4x,  hs, FL_MPYOPT_9|FL_DIVREM|FL_LL64, NONE, ARCHS4X)
+ARC_CPU (hs4xd, hs, FL_MPYOPT_9|FL_DIVREM|FL_LL64, NONE, ARCHS4XD)
+
+ARC_CPU (arc600,          6xx, FL_BS, NONE, ARC600)
+ARC_CPU (arc600_norm,     6xx, FL_BS|FL_NORM, NONE, ARC600)
+ARC_CPU (arc600_mul64,    6xx, FL_BS|FL_NORM|FL_MUL64, NONE, ARC600)
+ARC_CPU (arc600_mul32x16, 6xx, FL_BS|FL_NORM|FL_MUL32x16, NONE, ARC600)
+ARC_CPU (arc601,	  6xx, 0, NONE, ARC600)
+ARC_CPU (arc601_norm,	  6xx, FL_NORM, NONE, ARC600)
+ARC_CPU (arc601_mul64,	  6xx, FL_NORM|FL_MUL64, NONE, ARC600)
+ARC_CPU (arc601_mul32x16, 6xx, FL_NORM|FL_MUL32x16, NONE, ARC600)
+
+ARC_CPU (arc700, 700, 0, NONE, ARC700_4_2_STD)
+ARC_CPU (nps400, 700, 0, NONE, ARC700_4_2_STD)
 
 /* Local Variables: */
 /* mode: c */
diff --git a/gcc/config/arc/arc-opts.h b/gcc/config/arc/arc-opts.h
index 838e59b0bf3..3a7b7042de0 100644
--- a/gcc/config/arc/arc-opts.h
+++ b/gcc/config/arc/arc-opts.h
@@ -24,7 +24,7 @@ 
 enum processor_type
 {
   PROCESSOR_NONE = 0,
-#define ARC_CPU(NAME, ARCH, FLAGS, TUNE)  PROCESSOR_##NAME,
+#define ARC_CPU(NAME, ARCH, FLAGS, EXTRA, TUNE)  PROCESSOR_##NAME,
 #include "arc-cpus.def"
 #undef ARC_CPU
   PROCESSOR_generic
diff --git a/gcc/config/arc/arc.c b/gcc/config/arc/arc.c
index 03a2f4223c0..56715a8f61d 100644
--- a/gcc/config/arc/arc.c
+++ b/gcc/config/arc/arc.c
@@ -1256,6 +1256,16 @@  arc_override_options (void)
 #undef ARC_OPTX
 #undef ARC_OPT
 
+  /* Set extras.  */
+  switch (arc_selected_cpu->extra)
+    {
+    case HAS_LPCOUNT_16:
+      arc_lpcwidth = 16;
+      break;
+    default:
+      break;
+    }
+
   /* Set Tune option.  */
   if (arc_tune == ARC_TUNE_NONE)
     arc_tune = (enum arc_tune_attr) arc_selected_cpu->tune;