public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH 1/2] nios2: Add -mcustom-fpu-cfg=fph2
@ 2021-01-14 19:16 Sebastian Huber
  2021-01-14 19:16 ` [PATCH 2/2] RTEMS: Add -mcustom-fpu-cfg=fph2 multilib Sebastian Huber
  2021-01-15 19:12 ` [PATCH 1/2] nios2: Add -mcustom-fpu-cfg=fph2 Sandra Loosemore
  0 siblings, 2 replies; 6+ messages in thread
From: Sebastian Huber @ 2021-01-14 19:16 UTC (permalink / raw)
  To: gcc-patches; +Cc: Sandra Loosemore

The new -mcustom-fpu-cfg=fph2 option variant is useful to build a
multilib for the "Nios II Floating Point Hardware 2 Component":

https://www.intel.com/content/dam/www/programmable/us/en/pdfs/literature/ug/ug_nios2_custom_instruction.pdf

Directly using the corresponding -mcustom-insn=N options for this
floating-point unit leads to a combinatorial explosion in the potential
count of multilibs which may break the build.

The following instructions supported by this component are not enabled
by this option:

* -mcustom-fmins
* -mcustom-fmaxs
* -mcustom-round

The reason is that these instructions are only in effect in combination
with other options. If they are not set, then a build error occurs in
libatomic since -Werror is used for building this library:

cc1: error: switch '-mcustom-fmins' has no effect unless '-ffinite-math-only' is specified [-Werror]
cc1: error: switch '-mcustom-fmaxs' has no effect unless '-ffinite-math-only' is specified [-Werror]
cc1: error: switch '-mcustom-round' has no effect unless '-fno-math-errno' is specified [-Werror]

gcc/

	* config/nios2/nios2.c (NIOS2_FPU_CONFIG_NUM): Adjust value.
	(nios2_init_fpu_configs): Provide register values for new
	-mcustom-fpu-cfg=fph2 option variant.
	* doc/invoke.texi (-mcustom-fpu-cfg=fph2): Document new option
	variant.
---
 gcc/config/nios2/nios2.c | 20 +++++++++++++++++++-
 gcc/doc/invoke.texi      | 25 +++++++++++++++++++++++++
 2 files changed, 44 insertions(+), 1 deletion(-)

diff --git a/gcc/config/nios2/nios2.c b/gcc/config/nios2/nios2.c
index 3bffabe9856..fc9c8b70807 100644
--- a/gcc/config/nios2/nios2.c
+++ b/gcc/config/nios2/nios2.c
@@ -1236,7 +1236,7 @@ struct nios2_fpu_config
   int code[n2fpu_code_num];
 };
 
-#define NIOS2_FPU_CONFIG_NUM 3
+#define NIOS2_FPU_CONFIG_NUM 4
 static struct nios2_fpu_config custom_fpu_config[NIOS2_FPU_CONFIG_NUM];
 
 static void
@@ -1280,6 +1280,24 @@ nios2_init_fpu_configs (void)
   cfg->code[n2fpu_fsubs]   = 254;
   cfg->code[n2fpu_fdivs]   = 255;
 
+  NEXT_FPU_CONFIG;
+  cfg->name = "fph2";
+  cfg->code[n2fpu_fabss]   = 224;
+  cfg->code[n2fpu_fnegs]   = 225;
+  cfg->code[n2fpu_fcmpnes] = 226;
+  cfg->code[n2fpu_fcmpeqs] = 227;
+  cfg->code[n2fpu_fcmpges] = 228;
+  cfg->code[n2fpu_fcmpgts] = 229;
+  cfg->code[n2fpu_fcmples] = 230;
+  cfg->code[n2fpu_fcmplts] = 231;
+  cfg->code[n2fpu_fixsi]   = 249;
+  cfg->code[n2fpu_floatis] = 250;
+  cfg->code[n2fpu_fsqrts]  = 251;
+  cfg->code[n2fpu_fmuls]   = 252;
+  cfg->code[n2fpu_fadds]   = 253;
+  cfg->code[n2fpu_fsubs]   = 254;
+  cfg->code[n2fpu_fdivs]   = 255;
+
 #undef NEXT_FPU_CONFIG
   gcc_assert (i == NIOS2_FPU_CONFIG_NUM);
 }
diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi
index 298f1f873e3..91fd980550f 100644
--- a/gcc/doc/invoke.texi
+++ b/gcc/doc/invoke.texi
@@ -26121,6 +26121,23 @@ Currently, the following sets are defined:
 -mcustom-fdivs=255 @gol
 -fsingle-precision-constant}
 
+@option{-mcustom-fpu-cfg=fph2} is equivalent to:
+@gccoptlist{-mcustom-fabss=224 @gol
+-mcustom-fnegs=225 @gol
+-mcustom-fcmpnes=226 @gol
+-mcustom-fcmpeqs=227 @gol
+-mcustom-fcmpges=228 @gol
+-mcustom-fcmpgts=229 @gol
+-mcustom-fcmples=230 @gol
+-mcustom-fcmplts=231 @gol
+-mcustom-fixsi=249 @gol
+-mcustom-floatis=250 @gol
+-mcustom-fsqrts=251 @gol
+-mcustom-fmuls=252 @gol
+-mcustom-fadds=253 @gol
+-mcustom-fsubs=254 @gol
+-mcustom-fdivs=255 @gol}
+
 Custom instruction assignments given by individual
 @option{-mcustom-@var{insn}=} options override those given by
 @option{-mcustom-fpu-cfg=}, regardless of the
@@ -26131,6 +26148,14 @@ configuration by using the @code{target("custom-fpu-cfg=@var{name}")}
 function attribute (@pxref{Function Attributes})
 or pragma (@pxref{Function Specific Option Pragmas}).
 
+The name @var{fph2} is an abbreviation for @emph{Nios II Floating Point
+Hardware 2 Component}.  This component supports also the custom instructions
+@option{-mcustom-fmins=233}, @option{-mcustom-fmaxs=234}, and
+@option{-mcustom-round=248}.  These options are not enabled by
+@option{-mcustom-fpu-cfg=fph2} since they are only in effect if other options
+are enabled.  In contrast to the other configurations,
+@option{-fsingle-precision-constant} is not set.
+
 @end table
 
 These additional @samp{-m} options are available for the Altera Nios II
-- 
2.26.2


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH 2/2] RTEMS: Add -mcustom-fpu-cfg=fph2 multilib
  2021-01-14 19:16 [PATCH 1/2] nios2: Add -mcustom-fpu-cfg=fph2 Sebastian Huber
@ 2021-01-14 19:16 ` Sebastian Huber
  2021-01-15 19:13   ` Sandra Loosemore
  2021-01-15 19:12 ` [PATCH 1/2] nios2: Add -mcustom-fpu-cfg=fph2 Sandra Loosemore
  1 sibling, 1 reply; 6+ messages in thread
From: Sebastian Huber @ 2021-01-14 19:16 UTC (permalink / raw)
  To: gcc-patches; +Cc: Sandra Loosemore

This multilib supports Nios II configurations with the "Nios II Floating
Point Hardware 2 Component".

gcc/

	* config/nios2/t-rtems: Reset all MULTILIB_* variables.  Shorten
	multilib directory names.  Use MULTILIB_REQUIRED instead of
	MULTILIB_EXCEPTIONS.  Add -mhw-mul -mhw-mulx -mhw-div
	-mcustom-fpu-cfg=fph2 multilib.
---
 gcc/config/nios2/t-rtems | 146 +++++----------------------------------
 1 file changed, 18 insertions(+), 128 deletions(-)

diff --git a/gcc/config/nios2/t-rtems b/gcc/config/nios2/t-rtems
index f95fa3c4717..beda8328bd2 100644
--- a/gcc/config/nios2/t-rtems
+++ b/gcc/config/nios2/t-rtems
@@ -1,133 +1,23 @@
 # Custom RTEMS multilibs
 
-MULTILIB_OPTIONS = mhw-mul mhw-mulx mhw-div mcustom-fadds=253 mcustom-fdivs=255 mcustom-fmuls=252 mcustom-fsubs=254
+# Reset all MULTILIB variables
+
+MULTILIB_OPTIONS	=
+MULTILIB_DIRNAMES	=
+MULTILIB_EXCEPTIONS	=
+MULTILIB_REUSE		=
+MULTILIB_MATCHES	=
+MULTILIB_REQUIRED	=
 
 # Enumeration of multilibs
 
-# MULTILIB_EXCEPTIONS += mhw-mul/mhw-mulx/mhw-div/mcustom-fadds=253/mcustom-fdivs=255/mcustom-fmuls=252/mcustom-fsubs=254
-MULTILIB_EXCEPTIONS += mhw-mul/mhw-mulx/mhw-div/mcustom-fadds=253/mcustom-fdivs=255/mcustom-fmuls=252
-MULTILIB_EXCEPTIONS += mhw-mul/mhw-mulx/mhw-div/mcustom-fadds=253/mcustom-fdivs=255/mcustom-fsubs=254
-MULTILIB_EXCEPTIONS += mhw-mul/mhw-mulx/mhw-div/mcustom-fadds=253/mcustom-fdivs=255
-MULTILIB_EXCEPTIONS += mhw-mul/mhw-mulx/mhw-div/mcustom-fadds=253/mcustom-fmuls=252/mcustom-fsubs=254
-MULTILIB_EXCEPTIONS += mhw-mul/mhw-mulx/mhw-div/mcustom-fadds=253/mcustom-fmuls=252
-MULTILIB_EXCEPTIONS += mhw-mul/mhw-mulx/mhw-div/mcustom-fadds=253/mcustom-fsubs=254
-MULTILIB_EXCEPTIONS += mhw-mul/mhw-mulx/mhw-div/mcustom-fadds=253
-MULTILIB_EXCEPTIONS += mhw-mul/mhw-mulx/mhw-div/mcustom-fdivs=255/mcustom-fmuls=252/mcustom-fsubs=254
-MULTILIB_EXCEPTIONS += mhw-mul/mhw-mulx/mhw-div/mcustom-fdivs=255/mcustom-fmuls=252
-MULTILIB_EXCEPTIONS += mhw-mul/mhw-mulx/mhw-div/mcustom-fdivs=255/mcustom-fsubs=254
-MULTILIB_EXCEPTIONS += mhw-mul/mhw-mulx/mhw-div/mcustom-fdivs=255
-MULTILIB_EXCEPTIONS += mhw-mul/mhw-mulx/mhw-div/mcustom-fmuls=252/mcustom-fsubs=254
-MULTILIB_EXCEPTIONS += mhw-mul/mhw-mulx/mhw-div/mcustom-fmuls=252
-MULTILIB_EXCEPTIONS += mhw-mul/mhw-mulx/mhw-div/mcustom-fsubs=254
-# MULTILIB_EXCEPTIONS += mhw-mul/mhw-mulx/mhw-div
-MULTILIB_EXCEPTIONS += mhw-mul/mhw-mulx/mcustom-fadds=253/mcustom-fdivs=255/mcustom-fmuls=252/mcustom-fsubs=254
-MULTILIB_EXCEPTIONS += mhw-mul/mhw-mulx/mcustom-fadds=253/mcustom-fdivs=255/mcustom-fmuls=252
-MULTILIB_EXCEPTIONS += mhw-mul/mhw-mulx/mcustom-fadds=253/mcustom-fdivs=255/mcustom-fsubs=254
-MULTILIB_EXCEPTIONS += mhw-mul/mhw-mulx/mcustom-fadds=253/mcustom-fdivs=255
-MULTILIB_EXCEPTIONS += mhw-mul/mhw-mulx/mcustom-fadds=253/mcustom-fmuls=252/mcustom-fsubs=254
-MULTILIB_EXCEPTIONS += mhw-mul/mhw-mulx/mcustom-fadds=253/mcustom-fmuls=252
-MULTILIB_EXCEPTIONS += mhw-mul/mhw-mulx/mcustom-fadds=253/mcustom-fsubs=254
-MULTILIB_EXCEPTIONS += mhw-mul/mhw-mulx/mcustom-fadds=253
-MULTILIB_EXCEPTIONS += mhw-mul/mhw-mulx/mcustom-fdivs=255/mcustom-fmuls=252/mcustom-fsubs=254
-MULTILIB_EXCEPTIONS += mhw-mul/mhw-mulx/mcustom-fdivs=255/mcustom-fmuls=252
-MULTILIB_EXCEPTIONS += mhw-mul/mhw-mulx/mcustom-fdivs=255/mcustom-fsubs=254
-MULTILIB_EXCEPTIONS += mhw-mul/mhw-mulx/mcustom-fdivs=255
-MULTILIB_EXCEPTIONS += mhw-mul/mhw-mulx/mcustom-fmuls=252/mcustom-fsubs=254
-MULTILIB_EXCEPTIONS += mhw-mul/mhw-mulx/mcustom-fmuls=252
-MULTILIB_EXCEPTIONS += mhw-mul/mhw-mulx/mcustom-fsubs=254
-MULTILIB_EXCEPTIONS += mhw-mul/mhw-mulx
-MULTILIB_EXCEPTIONS += mhw-mul/mhw-div/mcustom-fadds=253/mcustom-fdivs=255/mcustom-fmuls=252/mcustom-fsubs=254
-MULTILIB_EXCEPTIONS += mhw-mul/mhw-div/mcustom-fadds=253/mcustom-fdivs=255/mcustom-fmuls=252
-MULTILIB_EXCEPTIONS += mhw-mul/mhw-div/mcustom-fadds=253/mcustom-fdivs=255/mcustom-fsubs=254
-MULTILIB_EXCEPTIONS += mhw-mul/mhw-div/mcustom-fadds=253/mcustom-fdivs=255
-MULTILIB_EXCEPTIONS += mhw-mul/mhw-div/mcustom-fadds=253/mcustom-fmuls=252/mcustom-fsubs=254
-MULTILIB_EXCEPTIONS += mhw-mul/mhw-div/mcustom-fadds=253/mcustom-fmuls=252
-MULTILIB_EXCEPTIONS += mhw-mul/mhw-div/mcustom-fadds=253/mcustom-fsubs=254
-MULTILIB_EXCEPTIONS += mhw-mul/mhw-div/mcustom-fadds=253
-MULTILIB_EXCEPTIONS += mhw-mul/mhw-div/mcustom-fdivs=255/mcustom-fmuls=252/mcustom-fsubs=254
-MULTILIB_EXCEPTIONS += mhw-mul/mhw-div/mcustom-fdivs=255/mcustom-fmuls=252
-MULTILIB_EXCEPTIONS += mhw-mul/mhw-div/mcustom-fdivs=255/mcustom-fsubs=254
-MULTILIB_EXCEPTIONS += mhw-mul/mhw-div/mcustom-fdivs=255
-MULTILIB_EXCEPTIONS += mhw-mul/mhw-div/mcustom-fmuls=252/mcustom-fsubs=254
-MULTILIB_EXCEPTIONS += mhw-mul/mhw-div/mcustom-fmuls=252
-MULTILIB_EXCEPTIONS += mhw-mul/mhw-div/mcustom-fsubs=254
-MULTILIB_EXCEPTIONS += mhw-mul/mhw-div
-MULTILIB_EXCEPTIONS += mhw-mul/mcustom-fadds=253/mcustom-fdivs=255/mcustom-fmuls=252/mcustom-fsubs=254
-MULTILIB_EXCEPTIONS += mhw-mul/mcustom-fadds=253/mcustom-fdivs=255/mcustom-fmuls=252
-MULTILIB_EXCEPTIONS += mhw-mul/mcustom-fadds=253/mcustom-fdivs=255/mcustom-fsubs=254
-MULTILIB_EXCEPTIONS += mhw-mul/mcustom-fadds=253/mcustom-fdivs=255
-MULTILIB_EXCEPTIONS += mhw-mul/mcustom-fadds=253/mcustom-fmuls=252/mcustom-fsubs=254
-MULTILIB_EXCEPTIONS += mhw-mul/mcustom-fadds=253/mcustom-fmuls=252
-MULTILIB_EXCEPTIONS += mhw-mul/mcustom-fadds=253/mcustom-fsubs=254
-MULTILIB_EXCEPTIONS += mhw-mul/mcustom-fadds=253
-MULTILIB_EXCEPTIONS += mhw-mul/mcustom-fdivs=255/mcustom-fmuls=252/mcustom-fsubs=254
-MULTILIB_EXCEPTIONS += mhw-mul/mcustom-fdivs=255/mcustom-fmuls=252
-MULTILIB_EXCEPTIONS += mhw-mul/mcustom-fdivs=255/mcustom-fsubs=254
-MULTILIB_EXCEPTIONS += mhw-mul/mcustom-fdivs=255
-MULTILIB_EXCEPTIONS += mhw-mul/mcustom-fmuls=252/mcustom-fsubs=254
-MULTILIB_EXCEPTIONS += mhw-mul/mcustom-fmuls=252
-MULTILIB_EXCEPTIONS += mhw-mul/mcustom-fsubs=254
-# MULTILIB_EXCEPTIONS += mhw-mul
-MULTILIB_EXCEPTIONS += mhw-mulx/mhw-div/mcustom-fadds=253/mcustom-fdivs=255/mcustom-fmuls=252/mcustom-fsubs=254
-MULTILIB_EXCEPTIONS += mhw-mulx/mhw-div/mcustom-fadds=253/mcustom-fdivs=255/mcustom-fmuls=252
-MULTILIB_EXCEPTIONS += mhw-mulx/mhw-div/mcustom-fadds=253/mcustom-fdivs=255/mcustom-fsubs=254
-MULTILIB_EXCEPTIONS += mhw-mulx/mhw-div/mcustom-fadds=253/mcustom-fdivs=255
-MULTILIB_EXCEPTIONS += mhw-mulx/mhw-div/mcustom-fadds=253/mcustom-fmuls=252/mcustom-fsubs=254
-MULTILIB_EXCEPTIONS += mhw-mulx/mhw-div/mcustom-fadds=253/mcustom-fmuls=252
-MULTILIB_EXCEPTIONS += mhw-mulx/mhw-div/mcustom-fadds=253/mcustom-fsubs=254
-MULTILIB_EXCEPTIONS += mhw-mulx/mhw-div/mcustom-fadds=253
-MULTILIB_EXCEPTIONS += mhw-mulx/mhw-div/mcustom-fdivs=255/mcustom-fmuls=252/mcustom-fsubs=254
-MULTILIB_EXCEPTIONS += mhw-mulx/mhw-div/mcustom-fdivs=255/mcustom-fmuls=252
-MULTILIB_EXCEPTIONS += mhw-mulx/mhw-div/mcustom-fdivs=255/mcustom-fsubs=254
-MULTILIB_EXCEPTIONS += mhw-mulx/mhw-div/mcustom-fdivs=255
-MULTILIB_EXCEPTIONS += mhw-mulx/mhw-div/mcustom-fmuls=252/mcustom-fsubs=254
-MULTILIB_EXCEPTIONS += mhw-mulx/mhw-div/mcustom-fmuls=252
-MULTILIB_EXCEPTIONS += mhw-mulx/mhw-div/mcustom-fsubs=254
-MULTILIB_EXCEPTIONS += mhw-mulx/mhw-div
-MULTILIB_EXCEPTIONS += mhw-mulx/mcustom-fadds=253/mcustom-fdivs=255/mcustom-fmuls=252/mcustom-fsubs=254
-MULTILIB_EXCEPTIONS += mhw-mulx/mcustom-fadds=253/mcustom-fdivs=255/mcustom-fmuls=252
-MULTILIB_EXCEPTIONS += mhw-mulx/mcustom-fadds=253/mcustom-fdivs=255/mcustom-fsubs=254
-MULTILIB_EXCEPTIONS += mhw-mulx/mcustom-fadds=253/mcustom-fdivs=255
-MULTILIB_EXCEPTIONS += mhw-mulx/mcustom-fadds=253/mcustom-fmuls=252/mcustom-fsubs=254
-MULTILIB_EXCEPTIONS += mhw-mulx/mcustom-fadds=253/mcustom-fmuls=252
-MULTILIB_EXCEPTIONS += mhw-mulx/mcustom-fadds=253/mcustom-fsubs=254
-MULTILIB_EXCEPTIONS += mhw-mulx/mcustom-fadds=253
-MULTILIB_EXCEPTIONS += mhw-mulx/mcustom-fdivs=255/mcustom-fmuls=252/mcustom-fsubs=254
-MULTILIB_EXCEPTIONS += mhw-mulx/mcustom-fdivs=255/mcustom-fmuls=252
-MULTILIB_EXCEPTIONS += mhw-mulx/mcustom-fdivs=255/mcustom-fsubs=254
-MULTILIB_EXCEPTIONS += mhw-mulx/mcustom-fdivs=255
-MULTILIB_EXCEPTIONS += mhw-mulx/mcustom-fmuls=252/mcustom-fsubs=254
-MULTILIB_EXCEPTIONS += mhw-mulx/mcustom-fmuls=252
-MULTILIB_EXCEPTIONS += mhw-mulx/mcustom-fsubs=254
-MULTILIB_EXCEPTIONS += mhw-mulx
-MULTILIB_EXCEPTIONS += mhw-div/mcustom-fadds=253/mcustom-fdivs=255/mcustom-fmuls=252/mcustom-fsubs=254
-MULTILIB_EXCEPTIONS += mhw-div/mcustom-fadds=253/mcustom-fdivs=255/mcustom-fmuls=252
-MULTILIB_EXCEPTIONS += mhw-div/mcustom-fadds=253/mcustom-fdivs=255/mcustom-fsubs=254
-MULTILIB_EXCEPTIONS += mhw-div/mcustom-fadds=253/mcustom-fdivs=255
-MULTILIB_EXCEPTIONS += mhw-div/mcustom-fadds=253/mcustom-fmuls=252/mcustom-fsubs=254
-MULTILIB_EXCEPTIONS += mhw-div/mcustom-fadds=253/mcustom-fmuls=252
-MULTILIB_EXCEPTIONS += mhw-div/mcustom-fadds=253/mcustom-fsubs=254
-MULTILIB_EXCEPTIONS += mhw-div/mcustom-fadds=253
-MULTILIB_EXCEPTIONS += mhw-div/mcustom-fdivs=255/mcustom-fmuls=252/mcustom-fsubs=254
-MULTILIB_EXCEPTIONS += mhw-div/mcustom-fdivs=255/mcustom-fmuls=252
-MULTILIB_EXCEPTIONS += mhw-div/mcustom-fdivs=255/mcustom-fsubs=254
-MULTILIB_EXCEPTIONS += mhw-div/mcustom-fdivs=255
-MULTILIB_EXCEPTIONS += mhw-div/mcustom-fmuls=252/mcustom-fsubs=254
-MULTILIB_EXCEPTIONS += mhw-div/mcustom-fmuls=252
-MULTILIB_EXCEPTIONS += mhw-div/mcustom-fsubs=254
-MULTILIB_EXCEPTIONS += mhw-div
-MULTILIB_EXCEPTIONS += mcustom-fadds=253/mcustom-fdivs=255/mcustom-fmuls=252/mcustom-fsubs=254
-MULTILIB_EXCEPTIONS += mcustom-fadds=253/mcustom-fdivs=255/mcustom-fmuls=252
-MULTILIB_EXCEPTIONS += mcustom-fadds=253/mcustom-fdivs=255/mcustom-fsubs=254
-MULTILIB_EXCEPTIONS += mcustom-fadds=253/mcustom-fdivs=255
-MULTILIB_EXCEPTIONS += mcustom-fadds=253/mcustom-fmuls=252/mcustom-fsubs=254
-MULTILIB_EXCEPTIONS += mcustom-fadds=253/mcustom-fmuls=252
-MULTILIB_EXCEPTIONS += mcustom-fadds=253/mcustom-fsubs=254
-MULTILIB_EXCEPTIONS += mcustom-fadds=253
-MULTILIB_EXCEPTIONS += mcustom-fdivs=255/mcustom-fmuls=252/mcustom-fsubs=254
-MULTILIB_EXCEPTIONS += mcustom-fdivs=255/mcustom-fmuls=252
-MULTILIB_EXCEPTIONS += mcustom-fdivs=255/mcustom-fsubs=254
-MULTILIB_EXCEPTIONS += mcustom-fdivs=255
-MULTILIB_EXCEPTIONS += mcustom-fmuls=252/mcustom-fsubs=254
-MULTILIB_EXCEPTIONS += mcustom-fmuls=252
-MULTILIB_EXCEPTIONS += mcustom-fsubs=254
+MULTILIB_OPTIONS  += mhw-mul mhw-mulx mhw-div
+MULTILIB_DIRNAMES += mul mulx div
+
+MULTILIB_OPTIONS  += mcustom-fadds=253 mcustom-fdivs=255 mcustom-fmuls=252 mcustom-fsubs=254 mcustom-fpu-cfg=fph2
+MULTILIB_DIRNAMES += fadds fdivs fmuls fsubs fph2
+
+MULTILIB_REQUIRED += mhw-mul
+MULTILIB_REQUIRED += mhw-mul/mhw-mulx/mhw-div
+MULTILIB_REQUIRED += mhw-mul/mhw-mulx/mhw-div/mcustom-fadds=253/mcustom-fdivs=255/mcustom-fmuls=252/mcustom-fsubs=254
+MULTILIB_REQUIRED += mhw-mul/mhw-mulx/mhw-div/mcustom-fpu-cfg=fph2
-- 
2.26.2


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 1/2] nios2: Add -mcustom-fpu-cfg=fph2
  2021-01-14 19:16 [PATCH 1/2] nios2: Add -mcustom-fpu-cfg=fph2 Sebastian Huber
  2021-01-14 19:16 ` [PATCH 2/2] RTEMS: Add -mcustom-fpu-cfg=fph2 multilib Sebastian Huber
@ 2021-01-15 19:12 ` Sandra Loosemore
  2021-01-15 21:27   ` Sebastian Huber
  1 sibling, 1 reply; 6+ messages in thread
From: Sandra Loosemore @ 2021-01-15 19:12 UTC (permalink / raw)
  To: Sebastian Huber, gcc-patches

On 1/14/21 12:16 PM, Sebastian Huber wrote:
> The new -mcustom-fpu-cfg=fph2 option variant is useful to build a
> multilib for the "Nios II Floating Point Hardware 2 Component":
> 
> https://www.intel.com/content/dam/www/programmable/us/en/pdfs/literature/ug/ug_nios2_custom_instruction.pdf
> 
> Directly using the corresponding -mcustom-insn=N options for this
> floating-point unit leads to a combinatorial explosion in the potential
> count of multilibs which may break the build.
> 
> The following instructions supported by this component are not enabled
> by this option:
> 
> * -mcustom-fmins
> * -mcustom-fmaxs
> * -mcustom-round
> 
> The reason is that these instructions are only in effect in combination
> with other options. If they are not set, then a build error occurs in
> libatomic since -Werror is used for building this library:
> 
> cc1: error: switch '-mcustom-fmins' has no effect unless '-ffinite-math-only' is specified [-Werror]
> cc1: error: switch '-mcustom-fmaxs' has no effect unless '-ffinite-math-only' is specified [-Werror]
> cc1: error: switch '-mcustom-round' has no effect unless '-fno-math-errno' is specified [-Werror]
> 

Seems like it would be better to have a separate switch to disable these 
warnings, or perhaps remove them entirely, as I'm sure there are other 
custom instructions that are not used unless -ffinite-math-only, 
-fno-math-errno, or -ffast-math are also specified (e.g., I see an issue 
in our internal tracker about fsqrts) and we don't consistently warn 
about those.  So I think the warnings are of dubious value.  Maybe the 
existing -Wdisabled-optimization flag could be used here to control the 
warnings we're already checking for?

> gcc/
> 
> 	* config/nios2/nios2.c (NIOS2_FPU_CONFIG_NUM): Adjust value.
> 	(nios2_init_fpu_configs): Provide register values for new
> 	-mcustom-fpu-cfg=fph2 option variant.
> 	* doc/invoke.texi (-mcustom-fpu-cfg=fph2): Document new option
> 	variant.

The rest of the patch looks fine to me.

-Sandra

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 2/2] RTEMS: Add -mcustom-fpu-cfg=fph2 multilib
  2021-01-14 19:16 ` [PATCH 2/2] RTEMS: Add -mcustom-fpu-cfg=fph2 multilib Sebastian Huber
@ 2021-01-15 19:13   ` Sandra Loosemore
  0 siblings, 0 replies; 6+ messages in thread
From: Sandra Loosemore @ 2021-01-15 19:13 UTC (permalink / raw)
  To: Sebastian Huber, gcc-patches

On 1/14/21 12:16 PM, Sebastian Huber wrote:
> This multilib supports Nios II configurations with the "Nios II Floating
> Point Hardware 2 Component".
> 
> gcc/
> 
> 	* config/nios2/t-rtems: Reset all MULTILIB_* variables.  Shorten
> 	multilib directory names.  Use MULTILIB_REQUIRED instead of
> 	MULTILIB_EXCEPTIONS.  Add -mhw-mul -mhw-mulx -mhw-div
> 	-mcustom-fpu-cfg=fph2 multilib.

As far as I'm concerned, you're the owner of everything RTEMS-related in 
the nios2 backend, so this is OK with me.  :-)

-Sandra

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 1/2] nios2: Add -mcustom-fpu-cfg=fph2
  2021-01-15 19:12 ` [PATCH 1/2] nios2: Add -mcustom-fpu-cfg=fph2 Sandra Loosemore
@ 2021-01-15 21:27   ` Sebastian Huber
  2021-01-15 22:08     ` Sandra Loosemore
  0 siblings, 1 reply; 6+ messages in thread
From: Sebastian Huber @ 2021-01-15 21:27 UTC (permalink / raw)
  To: Sandra Loosemore, gcc-patches

Hello Sandra,

On 15/01/2021 20:12, Sandra Loosemore wrote:
>>
>> The following instructions supported by this component are not enabled
>> by this option:
>>
>> * -mcustom-fmins
>> * -mcustom-fmaxs
>> * -mcustom-round
>>
>> The reason is that these instructions are only in effect in combination
>> with other options. If they are not set, then a build error occurs in
>> libatomic since -Werror is used for building this library:
>>
>> cc1: error: switch '-mcustom-fmins' has no effect unless 
>> '-ffinite-math-only' is specified [-Werror]
>> cc1: error: switch '-mcustom-fmaxs' has no effect unless 
>> '-ffinite-math-only' is specified [-Werror]
>> cc1: error: switch '-mcustom-round' has no effect unless 
>> '-fno-math-errno' is specified [-Werror]
>>
>
> Seems like it would be better to have a separate switch to disable 
> these warnings, or perhaps remove them entirely, as I'm sure there are 
> other custom instructions that are not used unless -ffinite-math-only, 
> -fno-math-errno, or -ffast-math are also specified (e.g., I see an 
> issue in our internal tracker about fsqrts) and we don't consistently 
> warn about those.  So I think the warnings are of dubious value.  
> Maybe the existing -Wdisabled-optimization flag could be used here to 
> control the warnings we're already checking for? 

thanks for having a look at it. It would be good to control the warning 
via an option not enabled by -Wall or remove the warnings. The 
-Wdisabled-optimization not used in gcc/config/*:

grep -r 'warning (OPT_Wdisabled' gcc/
gcc/tree-ssa-loop-prefetch.c:     warning (OPT_Wdisabled_optimization,
gcc/gcse.c:      warning (OPT_Wdisabled_optimization,
gcc/gcse.c:      warning (OPT_Wdisabled_optimization,

The warning description doesn't really fit from my point of view.

Maybe use -Wextra which is already used by avr (not really a prime target):

grep -r 'warning (OPT_Wextra' gcc/config
gcc/config/avr/avr.c:          warning (OPT_Wextra, "rounding to %d bits 
has no effect for "

-- 
embedded brains GmbH
Herr Sebastian HUBER
Dornierstr. 4
82178 Puchheim
Germany
email: sebastian.huber@embedded-brains.de
phone: +49-89-18 94 741 - 16
fax:   +49-89-18 94 741 - 08

Registergericht: Amtsgericht München
Registernummer: HRB 157899
Vertretungsberechtigte Geschäftsführer: Peter Rasmussen, Thomas Dörfler
Unsere Datenschutzerklärung finden Sie hier:
https://embedded-brains.de/datenschutzerklaerung/


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 1/2] nios2: Add -mcustom-fpu-cfg=fph2
  2021-01-15 21:27   ` Sebastian Huber
@ 2021-01-15 22:08     ` Sandra Loosemore
  0 siblings, 0 replies; 6+ messages in thread
From: Sandra Loosemore @ 2021-01-15 22:08 UTC (permalink / raw)
  To: Sebastian Huber, gcc-patches

On 1/15/21 2:27 PM, Sebastian Huber wrote:
> Hello Sandra,
> 
> On 15/01/2021 20:12, Sandra Loosemore wrote:
>>>
>>> The following instructions supported by this component are not enabled
>>> by this option:
>>>
>>> * -mcustom-fmins
>>> * -mcustom-fmaxs
>>> * -mcustom-round
>>>
>>> The reason is that these instructions are only in effect in combination
>>> with other options. If they are not set, then a build error occurs in
>>> libatomic since -Werror is used for building this library:
>>>
>>> cc1: error: switch '-mcustom-fmins' has no effect unless 
>>> '-ffinite-math-only' is specified [-Werror]
>>> cc1: error: switch '-mcustom-fmaxs' has no effect unless 
>>> '-ffinite-math-only' is specified [-Werror]
>>> cc1: error: switch '-mcustom-round' has no effect unless 
>>> '-fno-math-errno' is specified [-Werror]
>>>
>>
>> Seems like it would be better to have a separate switch to disable 
>> these warnings, or perhaps remove them entirely, as I'm sure there are 
>> other custom instructions that are not used unless -ffinite-math-only, 
>> -fno-math-errno, or -ffast-math are also specified (e.g., I see an 
>> issue in our internal tracker about fsqrts) and we don't consistently 
>> warn about those.  So I think the warnings are of dubious value. Maybe 
>> the existing -Wdisabled-optimization flag could be used here to 
>> control the warnings we're already checking for? 
> 
> thanks for having a look at it. It would be good to control the warning 
> via an option not enabled by -Wall or remove the warnings. The 
> -Wdisabled-optimization not used in gcc/config/*:
> 
> grep -r 'warning (OPT_Wdisabled' gcc/
> gcc/tree-ssa-loop-prefetch.c:     warning (OPT_Wdisabled_optimization,
> gcc/gcse.c:      warning (OPT_Wdisabled_optimization,
> gcc/gcse.c:      warning (OPT_Wdisabled_optimization,
> 
> The warning description doesn't really fit from my point of view.
> 
> Maybe use -Wextra which is already used by avr (not really a prime target):
> 
> grep -r 'warning (OPT_Wextra' gcc/config
> gcc/config/avr/avr.c:          warning (OPT_Wextra, "rounding to %d bits 
> has no effect for "

Hmmm, -Wextra seems too generic.  At this point, I think the easiest 
thing would just be to remove the warnings.  I'm pretty sure other 
backends don't warn if you specify some CPU variant that includes 
instructions that aren't used by GCC unless you also specify -ffast-math 
or whatever, and that's basically what's going on here.

-Sandra



^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2021-01-15 22:08 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-14 19:16 [PATCH 1/2] nios2: Add -mcustom-fpu-cfg=fph2 Sebastian Huber
2021-01-14 19:16 ` [PATCH 2/2] RTEMS: Add -mcustom-fpu-cfg=fph2 multilib Sebastian Huber
2021-01-15 19:13   ` Sandra Loosemore
2021-01-15 19:12 ` [PATCH 1/2] nios2: Add -mcustom-fpu-cfg=fph2 Sandra Loosemore
2021-01-15 21:27   ` Sebastian Huber
2021-01-15 22:08     ` Sandra Loosemore

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).