1 /* Subroutines for the gcc driver.
2 Copyright (C) 2016-2024 Free Software Foundation, Inc.
3 Contributed by Claudiu Zissulescu <claziss@synopsys.com>
5 This file is part of GCC.
7 GCC is free software; you can redistribute it and/or modify it
8 under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 3, or (at your option)
12 GCC is distributed in the hope that it will be useful, but WITHOUT
13 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
14 or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
15 License for more details.
17 You should have received a copy of the GNU General Public License
18 along with GCC; see the file COPYING3. If not see
19 <http://www.gnu.org/licenses/>. */
21 #define IN_TARGET_CODE 1
25 #include "coretypes.h"
28 /* Returns command line parameters to pass to as. */
31 arc_cpu_to_as (int argc
, const char **argv
)
33 const char *name
= NULL
;
34 const arc_cpu_t
*arc_selected_cpu
;
36 /* No argument, check what is the default cpu. */
39 arc_selected_cpu
= &arc_cpu_types
[(int) TARGET_CPU_DEFAULT
];
44 for (arc_selected_cpu
= arc_cpu_types
; arc_selected_cpu
->name
;
47 if (strcmp (arc_selected_cpu
->name
, name
) == 0)
52 switch (arc_selected_cpu
->arch_info
->arch_id
)
55 if (arc_selected_cpu
->flags
& FL_CD
)
56 name
= "-mcode-density";
59 if (arc_selected_cpu
->flags
& FL_FPUDA
)
60 name
= concat ("-mfpuda ", name
, NULL
);
61 if (arc_selected_cpu
->flags
& FL_SPFP
)
62 name
= concat ("-mspfp ", name
, NULL
);
63 if (arc_selected_cpu
->flags
& FL_DPFP
)
64 name
= concat ("-mdpfp ", name
, NULL
);
65 return concat ("-mcpu=arcem ", name
, NULL
);
69 if (arc_selected_cpu
->processor
== PROCESSOR_nps400
)
70 return "-mcpu=nps400 -mEA";
72 return "-mcpu=arc700 -mEA";
74 if (arc_selected_cpu
->flags
& FL_MUL64
)
75 return "-mcpu=arc600 -mmul64 -mnorm";
76 if (arc_selected_cpu
->flags
& FL_MUL32x16
)
77 return "-mcpu=arc600 -mdsp-packa -mnorm";
78 return "-mcpu=arc600 -mnorm";