1/* ARC options.
2   Copyright (C) 2016-2018 Free Software Foundation, Inc.
3
4   This file is part of GCC.
5
6   GCC is free software; you can redistribute it and/or modify it
7   under the terms of the GNU General Public License as published
8   by the Free Software Foundation; either version 3, or (at your
9   option) any later version.
10
11   GCC is distributed in the hope that it will be useful, but WITHOUT
12   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
13   or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public
14   License for more details.
15
16   You should have received a copy of the GNU General Public License
17   along with GCC; see the file COPYING3.  If not see
18   <http://www.gnu.org/licenses/>.  */
19
20/* List of all known ARC hardware modifier options (i.e., compiler
21   options that are selecting a hardware facility).  There can be two
22   types options: simple switches (e.g. code-density option can be
23   on/off), or can accept multiple values (e.g., fpu options).
24
25   For any valid HW option, define a macro:
26
27   ARC_OPT (NAME, CODE, MASK, DOC)
28
29   where:
30   NAME	  Name (identifier) of a particular hardware modifier option,
31	  as in enum cpu_flags.
32
33   CODE	  64-bit mask used to encode NAME.
34
35   MASK	  Corresponding GCC's MASK_<option> macro.
36
37   DOC	  A string used when emitting compiler errors or warnings.
38
39   For a multi-value option, define a macro for a valid value:
40
41   ARC_OPTX (NAME, CODE, VAR, VAL, DOC)
42
43   where:
44   NAME	  Name (identifier) of a particular hardware modifier
45	  configuration.
46
47   CODE	  64-bit mask used to encode NAME.  It will be encoded in the
48	  same variable like options given via ARC_OPT.
49
50   VAR	  Corresponding GCC's option variable.
51
52   VAL	  Value to be set in VAR.
53
54   DOC	  A string used when emitting compiler errors or warnings.
55
56   All multi-value options are defined using ARC_OPTX and ARC_OPT.
57   ARC_OPT contains a mask with all valid values for the given
58   option.  */
59
60ARC_OPT (FL_CD,	      (1ULL << 0), MASK_CODE_DENSITY,	   "code density")
61ARC_OPT (FL_DIVREM,   (1ULL << 1), MASK_DIVREM,		   "div/rem")
62ARC_OPT (FL_NORM,     (1ULL << 2), MASK_NORM_SET,	   "norm")
63ARC_OPT (FL_RF16,     (1ULL << 3), MASK_RF16,              "rf16")
64ARC_OPT (FL_ATOMIC,   (1ULL << 4), MASK_ATOMIC,		   "atomic")
65ARC_OPT (FL_LL64,     (1ULL << 5), MASK_LL64,		   "double load/store")
66ARC_OPT (FL_BS,	      (1ULL << 6), MASK_BARREL_SHIFTER,	   "barrel shifter")
67ARC_OPT (FL_SWAP,     (1ULL << 7), MASK_SWAP_SET,	   "swap")
68ARC_OPT (FL_MUL64,    (1ULL << 8), MASK_MUL64_SET,	   "mul64")
69ARC_OPT (FL_MUL32x16, (1ULL << 9), MASK_MULMAC_32BY16_SET, "mul32x16")
70
71ARC_OPT (FL_EA,	      (1ULL << 11), MASK_EA_SET,	   "extended arithmetics")
72ARC_OPT (FL_SPFP,     (1ULL << 12), MASK_SPFP_COMPACT_SET, "single precission FPX")
73ARC_OPT (FL_DPFP,     (1ULL << 13), MASK_DPFP_COMPACT_SET, "double precission FPX")
74ARC_OPT (FL_ARGONAUT, (1ULL << 14), MASK_ARGONAUT_SET,	   "argonaut")
75ARC_OPT (FL_SIMD,     (1ULL << 15), MASK_SIMD_SET,	   "simd")
76
77ARC_OPTX (FL_MPYOPT_1, (1ULL << 17), arc_mpy_option, 1, "mpy option w")
78ARC_OPTX (FL_MPYOPT_2, (1ULL << 18), arc_mpy_option, 2, "mpy option wlh1")
79ARC_OPTX (FL_MPYOPT_3, (1ULL << 19), arc_mpy_option, 3, "mpy option wlh2")
80ARC_OPTX (FL_MPYOPT_4, (1ULL << 20), arc_mpy_option, 4, "mpy option wlh3")
81ARC_OPTX (FL_MPYOPT_5, (1ULL << 21), arc_mpy_option, 5, "mpy option wlh4")
82ARC_OPTX (FL_MPYOPT_6, (1ULL << 22), arc_mpy_option, 6, "mpy option wlh5")
83ARC_OPTX (FL_MPYOPT_7, (1ULL << 23), arc_mpy_option, 7, "mpy option plus_dmpy")
84ARC_OPTX (FL_MPYOPT_8, (1ULL << 24), arc_mpy_option, 8, "mpy option plus_macd")
85ARC_OPTX (FL_MPYOPT_9, (1ULL << 25), arc_mpy_option, 9, "mpy option plus_qmacw")
86
87ARC_OPT (FL_MPYOPT_7_9, (0x01c2ULL << 17), 0, "mpy option")
88ARC_OPT (FL_MPYOPT_1_6, (0x003fULL << 17), 0, "mpy option")
89
90ARC_OPTX (FL_FPU_FPUS,	    (1ULL << 26), arc_fpu_build, FPU_FPUS,	"mfpu=fpus")
91ARC_OPTX (FL_FPU_FPUS_DIV,  (1ULL << 27), arc_fpu_build, FPU_FPUS_DIV,	"mfpu=fpus_div")
92ARC_OPTX (FL_FPU_FPUS_FMA,  (1ULL << 28), arc_fpu_build, FPU_FPUS_FMA,	"mfpu=fpus_fma")
93ARC_OPTX (FL_FPU_FPUS_ALL,  (1ULL << 29), arc_fpu_build, FPU_FPUS_ALL,	"mfpu=fpus_all")
94ARC_OPTX (FL_FPU_FPUDA,	    (1ULL << 30), arc_fpu_build, FPU_FPUDA,	"mfpu=fpuda")
95ARC_OPTX (FL_FPU_FPUDA_DIV, (1ULL << 31), arc_fpu_build, FPU_FPUDA_DIV, "mfpu=fpuda_div")
96ARC_OPTX (FL_FPU_FPUDA_FMA, (1ULL << 32), arc_fpu_build, FPU_FPUDA_FMA, "mfpu=fpuda_fma")
97ARC_OPTX (FL_FPU_FPUDA_ALL, (1ULL << 33), arc_fpu_build, FPU_FPUDA_ALL, "mfpu=fpuda_all")
98ARC_OPTX (FL_FPU_FPUD,	    (1ULL << 34), arc_fpu_build, FPU_FPUD,	"mfpu=fpud")
99ARC_OPTX (FL_FPU_FPUD_DIV,  (1ULL << 35), arc_fpu_build, FPU_FPUD_DIV,	"mfpu=fpud_div")
100ARC_OPTX (FL_FPU_FPUD_FMA,  (1ULL << 36), arc_fpu_build, FPU_FPUD_FMA,	"mfpu=fpud_fma")
101ARC_OPTX (FL_FPU_FPUD_ALL,  (1ULL << 37), arc_fpu_build, FPU_FPUD_ALL,	"mfpu=fpud_all")
102ARC_OPTX (FL_FPX_QUARK,	    (1ULL << 38), arc_fpu_build, FPX_QK,	"quarkse fp")
103
104ARC_OPT (FL_FPUS,  (0xFULL << 26), 0, "single precission floating point")
105ARC_OPT (FL_FPUDA, (0xFFULL << 26), 0, "double precission fp assist")
106ARC_OPT (FL_FPUD,  (0xF0FULL << 26), 0, "double precission floating point")
107ARC_OPT (FL_QUARK, (1ULL << 38), 0, "Quark SE fp extension")
108
109/* Local Variables: */
110/* mode: c */
111/* End: */
112