Notice: We have migrated to GitLab launching 2024-05-01 see here: https://gitlab.rtems.org/

Ticket #4215: 0001-nios2-Remove-custom-instruction-warnings.patch

File 0001-nios2-Remove-custom-instruction-warnings.patch, 16.8 KB (added by Sebastian Huber, on 01/17/21 at 18:47:18)
  • gcc/config/nios2/nios2.c

    From a8f9a7404c9dee852720a9d8bab35662c63785f2 Mon Sep 17 00:00:00 2001
    From: Sebastian Huber <sebastian.huber@embedded-brains.de>
    Date: Sat, 16 Jan 2021 09:00:23 +0100
    Subject: [PATCH] nios2: Remove custom instruction warnings
    
    Do not warn if custom instructions are not used due to missing
    optimization flags.  This prevents build errors with -Werror which
    cannot be disabled via a dedicated warning option.
    
    One reason to remove these warnings is to enable a multilib for the
    "Nios II Floating Point Hardware 2 Component".  For example, the
    libatomic target library in GCC is built with -Werror and the warnings
    removed by this patch resulted in errors like:
    
    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_custom_check_insns): Remove
    	custom instruction warnings.
    
    nios2: Add -mcustom-fpu-cfg=fph2
    
    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.
    
    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.
    
    RTEMS: Add -mcustom-fpu-cfg=fph2 multilib
    
    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/nios2.c |  51 ++++++--------
     gcc/config/nios2/t-rtems | 146 +++++----------------------------------
     gcc/doc/invoke.texi      |  28 ++++++++
     3 files changed, 68 insertions(+), 157 deletions(-)
    
    diff --git a/gcc/config/nios2/nios2.c b/gcc/config/nios2/nios2.c
    index ba0a0a9ba43..fcd74bef6f5 100644
    a b nios2_custom_check_insns (void) 
    11861186        break;
    11871187      }
    11881188
    1189   /* Warn if the user has certain exotic operations that won't get used
    1190      without -funsafe-math-optimizations.  See expand_builtin () in
    1191      builtins.c.  */
    1192   if (!flag_unsafe_math_optimizations)
    1193     for (i = 0; i < ARRAY_SIZE (nios2_fpu_insn); i++)
    1194       if (N2FPU_ENABLED_P (i) && N2FPU_UNSAFE_P (i))
    1195         warning (0, "switch %<-mcustom-%s%> has no effect unless "
    1196                  "%<-funsafe-math-optimizations%> is specified",
    1197                  N2FPU_NAME (i));
    1198 
    1199   /* Warn if the user is trying to use -mcustom-fmins et. al, that won't
    1200      get used without -ffinite-math-only.  See fold_builtin_fmin_fmax ()
    1201      in builtins.c.  */
    1202   if (!flag_finite_math_only)
    1203     for (i = 0; i < ARRAY_SIZE (nios2_fpu_insn); i++)
    1204       if (N2FPU_ENABLED_P (i) && N2FPU_FINITE_P (i))
    1205         warning (0, "switch %<-mcustom-%s%> has no effect unless "
    1206                  "%<-ffinite-math-only%> is specified", N2FPU_NAME (i));
    1207 
    1208   /* Warn if the user is trying to use a custom rounding instruction
    1209      that won't get used without -fno-math-errno.  See
    1210      expand_builtin_int_roundingfn_2 () in builtins.c.  */
    1211   if (flag_errno_math)
    1212     for (i = 0; i < ARRAY_SIZE (nios2_fpu_insn); i++)
    1213       if (N2FPU_ENABLED_P (i) && N2FPU_NO_ERRNO_P (i))
    1214         warning (0, "switch %<-mcustom-%s%> has no effect unless "
    1215                  "%<-fno-math-errno%> is specified", N2FPU_NAME (i));
    1216 
    12171189  if (errors || custom_code_conflict)
    12181190    fatal_error (input_location,
    12191191                 "conflicting use of %<-mcustom%> switches, target attributes, "
    struct nios2_fpu_config 
    12361208  int code[n2fpu_code_num];
    12371209};
    12381210
    1239 #define NIOS2_FPU_CONFIG_NUM 3
     1211#define NIOS2_FPU_CONFIG_NUM 4
    12401212static struct nios2_fpu_config custom_fpu_config[NIOS2_FPU_CONFIG_NUM];
    12411213
    12421214static void
    nios2_init_fpu_configs (void) 
    12801252  cfg->code[n2fpu_fsubs]   = 254;
    12811253  cfg->code[n2fpu_fdivs]   = 255;
    12821254
     1255  NEXT_FPU_CONFIG;
     1256  cfg->name = "fph2";
     1257  cfg->code[n2fpu_fabss]   = 224;
     1258  cfg->code[n2fpu_fnegs]   = 225;
     1259  cfg->code[n2fpu_fcmpnes] = 226;
     1260  cfg->code[n2fpu_fcmpeqs] = 227;
     1261  cfg->code[n2fpu_fcmpges] = 228;
     1262  cfg->code[n2fpu_fcmpgts] = 229;
     1263  cfg->code[n2fpu_fcmples] = 230;
     1264  cfg->code[n2fpu_fcmplts] = 231;
     1265  cfg->code[n2fpu_fmaxs]   = 232;
     1266  cfg->code[n2fpu_fmins]   = 233;
     1267  cfg->code[n2fpu_round]   = 248;
     1268  cfg->code[n2fpu_fixsi]   = 249;
     1269  cfg->code[n2fpu_floatis] = 250;
     1270  cfg->code[n2fpu_fsqrts]  = 251;
     1271  cfg->code[n2fpu_fmuls]   = 252;
     1272  cfg->code[n2fpu_fadds]   = 253;
     1273  cfg->code[n2fpu_fsubs]   = 254;
     1274  cfg->code[n2fpu_fdivs]   = 255;
     1275
    12831276#undef NEXT_FPU_CONFIG
    12841277  gcc_assert (i == NIOS2_FPU_CONFIG_NUM);
    12851278}
  • gcc/config/nios2/t-rtems

    diff --git a/gcc/config/nios2/t-rtems b/gcc/config/nios2/t-rtems
    index f95fa3c4717..beda8328bd2 100644
    a b  
    11# Custom RTEMS multilibs
    22
    3 MULTILIB_OPTIONS = mhw-mul mhw-mulx mhw-div mcustom-fadds=253 mcustom-fdivs=255 mcustom-fmuls=252 mcustom-fsubs=254
     3# Reset all MULTILIB variables
     4
     5MULTILIB_OPTIONS        =
     6MULTILIB_DIRNAMES       =
     7MULTILIB_EXCEPTIONS     =
     8MULTILIB_REUSE          =
     9MULTILIB_MATCHES        =
     10MULTILIB_REQUIRED       =
    411
    512# Enumeration of multilibs
    613
    7 # MULTILIB_EXCEPTIONS += mhw-mul/mhw-mulx/mhw-div/mcustom-fadds=253/mcustom-fdivs=255/mcustom-fmuls=252/mcustom-fsubs=254
    8 MULTILIB_EXCEPTIONS += mhw-mul/mhw-mulx/mhw-div/mcustom-fadds=253/mcustom-fdivs=255/mcustom-fmuls=252
    9 MULTILIB_EXCEPTIONS += mhw-mul/mhw-mulx/mhw-div/mcustom-fadds=253/mcustom-fdivs=255/mcustom-fsubs=254
    10 MULTILIB_EXCEPTIONS += mhw-mul/mhw-mulx/mhw-div/mcustom-fadds=253/mcustom-fdivs=255
    11 MULTILIB_EXCEPTIONS += mhw-mul/mhw-mulx/mhw-div/mcustom-fadds=253/mcustom-fmuls=252/mcustom-fsubs=254
    12 MULTILIB_EXCEPTIONS += mhw-mul/mhw-mulx/mhw-div/mcustom-fadds=253/mcustom-fmuls=252
    13 MULTILIB_EXCEPTIONS += mhw-mul/mhw-mulx/mhw-div/mcustom-fadds=253/mcustom-fsubs=254
    14 MULTILIB_EXCEPTIONS += mhw-mul/mhw-mulx/mhw-div/mcustom-fadds=253
    15 MULTILIB_EXCEPTIONS += mhw-mul/mhw-mulx/mhw-div/mcustom-fdivs=255/mcustom-fmuls=252/mcustom-fsubs=254
    16 MULTILIB_EXCEPTIONS += mhw-mul/mhw-mulx/mhw-div/mcustom-fdivs=255/mcustom-fmuls=252
    17 MULTILIB_EXCEPTIONS += mhw-mul/mhw-mulx/mhw-div/mcustom-fdivs=255/mcustom-fsubs=254
    18 MULTILIB_EXCEPTIONS += mhw-mul/mhw-mulx/mhw-div/mcustom-fdivs=255
    19 MULTILIB_EXCEPTIONS += mhw-mul/mhw-mulx/mhw-div/mcustom-fmuls=252/mcustom-fsubs=254
    20 MULTILIB_EXCEPTIONS += mhw-mul/mhw-mulx/mhw-div/mcustom-fmuls=252
    21 MULTILIB_EXCEPTIONS += mhw-mul/mhw-mulx/mhw-div/mcustom-fsubs=254
    22 # MULTILIB_EXCEPTIONS += mhw-mul/mhw-mulx/mhw-div
    23 MULTILIB_EXCEPTIONS += mhw-mul/mhw-mulx/mcustom-fadds=253/mcustom-fdivs=255/mcustom-fmuls=252/mcustom-fsubs=254
    24 MULTILIB_EXCEPTIONS += mhw-mul/mhw-mulx/mcustom-fadds=253/mcustom-fdivs=255/mcustom-fmuls=252
    25 MULTILIB_EXCEPTIONS += mhw-mul/mhw-mulx/mcustom-fadds=253/mcustom-fdivs=255/mcustom-fsubs=254
    26 MULTILIB_EXCEPTIONS += mhw-mul/mhw-mulx/mcustom-fadds=253/mcustom-fdivs=255
    27 MULTILIB_EXCEPTIONS += mhw-mul/mhw-mulx/mcustom-fadds=253/mcustom-fmuls=252/mcustom-fsubs=254
    28 MULTILIB_EXCEPTIONS += mhw-mul/mhw-mulx/mcustom-fadds=253/mcustom-fmuls=252
    29 MULTILIB_EXCEPTIONS += mhw-mul/mhw-mulx/mcustom-fadds=253/mcustom-fsubs=254
    30 MULTILIB_EXCEPTIONS += mhw-mul/mhw-mulx/mcustom-fadds=253
    31 MULTILIB_EXCEPTIONS += mhw-mul/mhw-mulx/mcustom-fdivs=255/mcustom-fmuls=252/mcustom-fsubs=254
    32 MULTILIB_EXCEPTIONS += mhw-mul/mhw-mulx/mcustom-fdivs=255/mcustom-fmuls=252
    33 MULTILIB_EXCEPTIONS += mhw-mul/mhw-mulx/mcustom-fdivs=255/mcustom-fsubs=254
    34 MULTILIB_EXCEPTIONS += mhw-mul/mhw-mulx/mcustom-fdivs=255
    35 MULTILIB_EXCEPTIONS += mhw-mul/mhw-mulx/mcustom-fmuls=252/mcustom-fsubs=254
    36 MULTILIB_EXCEPTIONS += mhw-mul/mhw-mulx/mcustom-fmuls=252
    37 MULTILIB_EXCEPTIONS += mhw-mul/mhw-mulx/mcustom-fsubs=254
    38 MULTILIB_EXCEPTIONS += mhw-mul/mhw-mulx
    39 MULTILIB_EXCEPTIONS += mhw-mul/mhw-div/mcustom-fadds=253/mcustom-fdivs=255/mcustom-fmuls=252/mcustom-fsubs=254
    40 MULTILIB_EXCEPTIONS += mhw-mul/mhw-div/mcustom-fadds=253/mcustom-fdivs=255/mcustom-fmuls=252
    41 MULTILIB_EXCEPTIONS += mhw-mul/mhw-div/mcustom-fadds=253/mcustom-fdivs=255/mcustom-fsubs=254
    42 MULTILIB_EXCEPTIONS += mhw-mul/mhw-div/mcustom-fadds=253/mcustom-fdivs=255
    43 MULTILIB_EXCEPTIONS += mhw-mul/mhw-div/mcustom-fadds=253/mcustom-fmuls=252/mcustom-fsubs=254
    44 MULTILIB_EXCEPTIONS += mhw-mul/mhw-div/mcustom-fadds=253/mcustom-fmuls=252
    45 MULTILIB_EXCEPTIONS += mhw-mul/mhw-div/mcustom-fadds=253/mcustom-fsubs=254
    46 MULTILIB_EXCEPTIONS += mhw-mul/mhw-div/mcustom-fadds=253
    47 MULTILIB_EXCEPTIONS += mhw-mul/mhw-div/mcustom-fdivs=255/mcustom-fmuls=252/mcustom-fsubs=254
    48 MULTILIB_EXCEPTIONS += mhw-mul/mhw-div/mcustom-fdivs=255/mcustom-fmuls=252
    49 MULTILIB_EXCEPTIONS += mhw-mul/mhw-div/mcustom-fdivs=255/mcustom-fsubs=254
    50 MULTILIB_EXCEPTIONS += mhw-mul/mhw-div/mcustom-fdivs=255
    51 MULTILIB_EXCEPTIONS += mhw-mul/mhw-div/mcustom-fmuls=252/mcustom-fsubs=254
    52 MULTILIB_EXCEPTIONS += mhw-mul/mhw-div/mcustom-fmuls=252
    53 MULTILIB_EXCEPTIONS += mhw-mul/mhw-div/mcustom-fsubs=254
    54 MULTILIB_EXCEPTIONS += mhw-mul/mhw-div
    55 MULTILIB_EXCEPTIONS += mhw-mul/mcustom-fadds=253/mcustom-fdivs=255/mcustom-fmuls=252/mcustom-fsubs=254
    56 MULTILIB_EXCEPTIONS += mhw-mul/mcustom-fadds=253/mcustom-fdivs=255/mcustom-fmuls=252
    57 MULTILIB_EXCEPTIONS += mhw-mul/mcustom-fadds=253/mcustom-fdivs=255/mcustom-fsubs=254
    58 MULTILIB_EXCEPTIONS += mhw-mul/mcustom-fadds=253/mcustom-fdivs=255
    59 MULTILIB_EXCEPTIONS += mhw-mul/mcustom-fadds=253/mcustom-fmuls=252/mcustom-fsubs=254
    60 MULTILIB_EXCEPTIONS += mhw-mul/mcustom-fadds=253/mcustom-fmuls=252
    61 MULTILIB_EXCEPTIONS += mhw-mul/mcustom-fadds=253/mcustom-fsubs=254
    62 MULTILIB_EXCEPTIONS += mhw-mul/mcustom-fadds=253
    63 MULTILIB_EXCEPTIONS += mhw-mul/mcustom-fdivs=255/mcustom-fmuls=252/mcustom-fsubs=254
    64 MULTILIB_EXCEPTIONS += mhw-mul/mcustom-fdivs=255/mcustom-fmuls=252
    65 MULTILIB_EXCEPTIONS += mhw-mul/mcustom-fdivs=255/mcustom-fsubs=254
    66 MULTILIB_EXCEPTIONS += mhw-mul/mcustom-fdivs=255
    67 MULTILIB_EXCEPTIONS += mhw-mul/mcustom-fmuls=252/mcustom-fsubs=254
    68 MULTILIB_EXCEPTIONS += mhw-mul/mcustom-fmuls=252
    69 MULTILIB_EXCEPTIONS += mhw-mul/mcustom-fsubs=254
    70 # MULTILIB_EXCEPTIONS += mhw-mul
    71 MULTILIB_EXCEPTIONS += mhw-mulx/mhw-div/mcustom-fadds=253/mcustom-fdivs=255/mcustom-fmuls=252/mcustom-fsubs=254
    72 MULTILIB_EXCEPTIONS += mhw-mulx/mhw-div/mcustom-fadds=253/mcustom-fdivs=255/mcustom-fmuls=252
    73 MULTILIB_EXCEPTIONS += mhw-mulx/mhw-div/mcustom-fadds=253/mcustom-fdivs=255/mcustom-fsubs=254
    74 MULTILIB_EXCEPTIONS += mhw-mulx/mhw-div/mcustom-fadds=253/mcustom-fdivs=255
    75 MULTILIB_EXCEPTIONS += mhw-mulx/mhw-div/mcustom-fadds=253/mcustom-fmuls=252/mcustom-fsubs=254
    76 MULTILIB_EXCEPTIONS += mhw-mulx/mhw-div/mcustom-fadds=253/mcustom-fmuls=252
    77 MULTILIB_EXCEPTIONS += mhw-mulx/mhw-div/mcustom-fadds=253/mcustom-fsubs=254
    78 MULTILIB_EXCEPTIONS += mhw-mulx/mhw-div/mcustom-fadds=253
    79 MULTILIB_EXCEPTIONS += mhw-mulx/mhw-div/mcustom-fdivs=255/mcustom-fmuls=252/mcustom-fsubs=254
    80 MULTILIB_EXCEPTIONS += mhw-mulx/mhw-div/mcustom-fdivs=255/mcustom-fmuls=252
    81 MULTILIB_EXCEPTIONS += mhw-mulx/mhw-div/mcustom-fdivs=255/mcustom-fsubs=254
    82 MULTILIB_EXCEPTIONS += mhw-mulx/mhw-div/mcustom-fdivs=255
    83 MULTILIB_EXCEPTIONS += mhw-mulx/mhw-div/mcustom-fmuls=252/mcustom-fsubs=254
    84 MULTILIB_EXCEPTIONS += mhw-mulx/mhw-div/mcustom-fmuls=252
    85 MULTILIB_EXCEPTIONS += mhw-mulx/mhw-div/mcustom-fsubs=254
    86 MULTILIB_EXCEPTIONS += mhw-mulx/mhw-div
    87 MULTILIB_EXCEPTIONS += mhw-mulx/mcustom-fadds=253/mcustom-fdivs=255/mcustom-fmuls=252/mcustom-fsubs=254
    88 MULTILIB_EXCEPTIONS += mhw-mulx/mcustom-fadds=253/mcustom-fdivs=255/mcustom-fmuls=252
    89 MULTILIB_EXCEPTIONS += mhw-mulx/mcustom-fadds=253/mcustom-fdivs=255/mcustom-fsubs=254
    90 MULTILIB_EXCEPTIONS += mhw-mulx/mcustom-fadds=253/mcustom-fdivs=255
    91 MULTILIB_EXCEPTIONS += mhw-mulx/mcustom-fadds=253/mcustom-fmuls=252/mcustom-fsubs=254
    92 MULTILIB_EXCEPTIONS += mhw-mulx/mcustom-fadds=253/mcustom-fmuls=252
    93 MULTILIB_EXCEPTIONS += mhw-mulx/mcustom-fadds=253/mcustom-fsubs=254
    94 MULTILIB_EXCEPTIONS += mhw-mulx/mcustom-fadds=253
    95 MULTILIB_EXCEPTIONS += mhw-mulx/mcustom-fdivs=255/mcustom-fmuls=252/mcustom-fsubs=254
    96 MULTILIB_EXCEPTIONS += mhw-mulx/mcustom-fdivs=255/mcustom-fmuls=252
    97 MULTILIB_EXCEPTIONS += mhw-mulx/mcustom-fdivs=255/mcustom-fsubs=254
    98 MULTILIB_EXCEPTIONS += mhw-mulx/mcustom-fdivs=255
    99 MULTILIB_EXCEPTIONS += mhw-mulx/mcustom-fmuls=252/mcustom-fsubs=254
    100 MULTILIB_EXCEPTIONS += mhw-mulx/mcustom-fmuls=252
    101 MULTILIB_EXCEPTIONS += mhw-mulx/mcustom-fsubs=254
    102 MULTILIB_EXCEPTIONS += mhw-mulx
    103 MULTILIB_EXCEPTIONS += mhw-div/mcustom-fadds=253/mcustom-fdivs=255/mcustom-fmuls=252/mcustom-fsubs=254
    104 MULTILIB_EXCEPTIONS += mhw-div/mcustom-fadds=253/mcustom-fdivs=255/mcustom-fmuls=252
    105 MULTILIB_EXCEPTIONS += mhw-div/mcustom-fadds=253/mcustom-fdivs=255/mcustom-fsubs=254
    106 MULTILIB_EXCEPTIONS += mhw-div/mcustom-fadds=253/mcustom-fdivs=255
    107 MULTILIB_EXCEPTIONS += mhw-div/mcustom-fadds=253/mcustom-fmuls=252/mcustom-fsubs=254
    108 MULTILIB_EXCEPTIONS += mhw-div/mcustom-fadds=253/mcustom-fmuls=252
    109 MULTILIB_EXCEPTIONS += mhw-div/mcustom-fadds=253/mcustom-fsubs=254
    110 MULTILIB_EXCEPTIONS += mhw-div/mcustom-fadds=253
    111 MULTILIB_EXCEPTIONS += mhw-div/mcustom-fdivs=255/mcustom-fmuls=252/mcustom-fsubs=254
    112 MULTILIB_EXCEPTIONS += mhw-div/mcustom-fdivs=255/mcustom-fmuls=252
    113 MULTILIB_EXCEPTIONS += mhw-div/mcustom-fdivs=255/mcustom-fsubs=254
    114 MULTILIB_EXCEPTIONS += mhw-div/mcustom-fdivs=255
    115 MULTILIB_EXCEPTIONS += mhw-div/mcustom-fmuls=252/mcustom-fsubs=254
    116 MULTILIB_EXCEPTIONS += mhw-div/mcustom-fmuls=252
    117 MULTILIB_EXCEPTIONS += mhw-div/mcustom-fsubs=254
    118 MULTILIB_EXCEPTIONS += mhw-div
    119 MULTILIB_EXCEPTIONS += mcustom-fadds=253/mcustom-fdivs=255/mcustom-fmuls=252/mcustom-fsubs=254
    120 MULTILIB_EXCEPTIONS += mcustom-fadds=253/mcustom-fdivs=255/mcustom-fmuls=252
    121 MULTILIB_EXCEPTIONS += mcustom-fadds=253/mcustom-fdivs=255/mcustom-fsubs=254
    122 MULTILIB_EXCEPTIONS += mcustom-fadds=253/mcustom-fdivs=255
    123 MULTILIB_EXCEPTIONS += mcustom-fadds=253/mcustom-fmuls=252/mcustom-fsubs=254
    124 MULTILIB_EXCEPTIONS += mcustom-fadds=253/mcustom-fmuls=252
    125 MULTILIB_EXCEPTIONS += mcustom-fadds=253/mcustom-fsubs=254
    126 MULTILIB_EXCEPTIONS += mcustom-fadds=253
    127 MULTILIB_EXCEPTIONS += mcustom-fdivs=255/mcustom-fmuls=252/mcustom-fsubs=254
    128 MULTILIB_EXCEPTIONS += mcustom-fdivs=255/mcustom-fmuls=252
    129 MULTILIB_EXCEPTIONS += mcustom-fdivs=255/mcustom-fsubs=254
    130 MULTILIB_EXCEPTIONS += mcustom-fdivs=255
    131 MULTILIB_EXCEPTIONS += mcustom-fmuls=252/mcustom-fsubs=254
    132 MULTILIB_EXCEPTIONS += mcustom-fmuls=252
    133 MULTILIB_EXCEPTIONS += mcustom-fsubs=254
     14MULTILIB_OPTIONS  += mhw-mul mhw-mulx mhw-div
     15MULTILIB_DIRNAMES += mul mulx div
     16
     17MULTILIB_OPTIONS  += mcustom-fadds=253 mcustom-fdivs=255 mcustom-fmuls=252 mcustom-fsubs=254 mcustom-fpu-cfg=fph2
     18MULTILIB_DIRNAMES += fadds fdivs fmuls fsubs fph2
     19
     20MULTILIB_REQUIRED += mhw-mul
     21MULTILIB_REQUIRED += mhw-mul/mhw-mulx/mhw-div
     22MULTILIB_REQUIRED += mhw-mul/mhw-mulx/mhw-div/mcustom-fadds=253/mcustom-fdivs=255/mcustom-fmuls=252/mcustom-fsubs=254
     23MULTILIB_REQUIRED += mhw-mul/mhw-mulx/mhw-div/mcustom-fpu-cfg=fph2
  • gcc/doc/invoke.texi

    diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi
    index 7775bcc72eb..1eef9a18ab7 100644
    a b Currently, the following sets are defined: 
    2491924919-mcustom-fdivs=255 @gol
    2492024920-fsingle-precision-constant}
    2492124921
     24922@option{-mcustom-fpu-cfg=fph2} is equivalent to:
     24923@gccoptlist{-mcustom-fabss=224 @gol
     24924-mcustom-fnegs=225 @gol
     24925-mcustom-fcmpnes=226 @gol
     24926-mcustom-fcmpeqs=227 @gol
     24927-mcustom-fcmpges=228 @gol
     24928-mcustom-fcmpgts=229 @gol
     24929-mcustom-fcmples=230 @gol
     24930-mcustom-fcmplts=231 @gol
     24931-mcustom-fmaxs=232 @gol
     24932-mcustom-fmins=233 @gol
     24933-mcustom-round=248 @gol
     24934-mcustom-fixsi=249 @gol
     24935-mcustom-floatis=250 @gol
     24936-mcustom-fsqrts=251 @gol
     24937-mcustom-fmuls=252 @gol
     24938-mcustom-fadds=253 @gol
     24939-mcustom-fsubs=254 @gol
     24940-mcustom-fdivs=255 @gol}
     24941
    2492224942Custom instruction assignments given by individual
    2492324943@option{-mcustom-@var{insn}=} options override those given by
    2492424944@option{-mcustom-fpu-cfg=}, regardless of the
    configuration by using the @code{target("custom-fpu-cfg=@var{name}")} 
    2492924949function attribute (@pxref{Function Attributes})
    2493024950or pragma (@pxref{Function Specific Option Pragmas}).
    2493124951
     24952The name @var{fph2} is an abbreviation for @emph{Nios II Floating Point
     24953Hardware 2 Component}.  Please note that the custom instructions enabled by
     24954@option{-mcustom-fmins=233} and @option{-mcustom-fmaxs=234} are only generated
     24955if @option{-ffinite-math-only} is specified.  The custom instruction enabled by
     24956@option{-mcustom-round=248} is only generated if @option{-fno-math-errno} is
     24957specified.  In contrast to the other configurations,
     24958@option{-fsingle-precision-constant} is not set.
     24959
    2493224960@end table
    2493324961
    2493424962These additional @samp{-m} options are available for the Altera Nios II