1 /* Subroutines for the gcc driver.
2 Copyright (C) 2016-2017 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/>. */
23 #include "coretypes.h"
26 /* Returns command line parameters to pass to as. */
29 arc_cpu_to_as (int argc
, const char **argv
)
31 const char *name
= NULL
;
32 const arc_cpu_t
*arc_selected_cpu
;
34 /* No argument, check what is the default cpu. */
37 arc_selected_cpu
= &arc_cpu_types
[(int) TARGET_CPU_DEFAULT
];
42 for (arc_selected_cpu
= arc_cpu_types
; arc_selected_cpu
->name
;
45 if (strcmp (arc_selected_cpu
->name
, name
) == 0)
50 switch (arc_selected_cpu
->arch_info
->arch_id
)
53 if (arc_selected_cpu
->flags
& FL_CD
)
54 name
= "-mcode-density";
57 if (arc_selected_cpu
->flags
& FL_FPUDA
)
58 name
= concat ("-mfpuda ", name
, NULL
);
59 if (arc_selected_cpu
->flags
& FL_SPFP
)
60 name
= concat ("-mspfp ", name
, NULL
);
61 if (arc_selected_cpu
->flags
& FL_DPFP
)
62 name
= concat ("-mdpfp ", name
, NULL
);
63 return concat ("-mcpu=arcem ", name
, NULL
);
67 if (arc_selected_cpu
->processor
== PROCESSOR_nps400
)
68 return "-mcpu=nps400 -mEA";
70 return "-mcpu=arc700 -mEA";
72 if (arc_selected_cpu
->flags
& FL_MUL64
)
73 return "-mcpu=arc600 -mmul64 -mnorm";
74 if (arc_selected_cpu
->flags
& FL_MUL32x16
)
75 return "-mcpu=arc600 -mdsp-packa -mnorm";
76 return "-mcpu=arc600 -mnorm";