This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Pass -mtune and -march options to assembler.


Hi!

This patch fixes PR 40171 by passing optimization option
-mtune to GNU assembler. Not all cpu_type passed!


2009-06-02 Vladimir Volynsky <vvv@ru.ru>


PR target/40171
* gcc.c (process_command): Pass -mtune to the GNU assembler.


--- gcc/gcc.c 2009-06-02 21:26:13.000000000 +0400
+++ gcc/gcc.c.vv 2009-06-02 21:27:28.000000000 +0400
@@ -3749,6 +3749,34 @@ process_command (int argc, const char **
print_multi_os_directory = 1;
else if (! strcmp (argv[i], "-print-sysroot-headers-suffix"))
print_sysroot_headers_suffix = 1;
+#ifdef HAVE_GNU_AS
+ else if (! strncmp (argv[i], "-mtune=", 7))
+ {
+ /* Pass -mtune option to the assembler.
+ It's options supported by GNU AS 2.19.1
+ This option can be overridden by assembler option -Wa, */
+ if( (!strcmp (argv[i]+7,"i386"))
+ ||(!strcmp (argv[i]+7,"i486"))
+ ||(!strcmp (argv[i]+7,"pentium"))
+ ||(!strcmp (argv[i]+7,"pentiumpro"))
+ ||(!strcmp (argv[i]+7,"pentium4"))
+ ||(!strcmp (argv[i]+7,"prescott"))
+ ||(!strcmp (argv[i]+7,"nocona"))
+ ||(!strcmp (argv[i]+7,"core2"))
+ ||(!strcmp (argv[i]+7,"k6"))
+ ||(!strcmp (argv[i]+7,"athlon"))
+ ||(!strcmp (argv[i]+7,"k8"))
+ ||(!strcmp (argv[i]+7,"amdfam10"))
+ )
+ add_assembler_option (argv[i], strlen ( argv[i] ) );
+ else if (!strcmp (argv[i]+7,"pentium2"))
+ add_assembler_option ("-mtune=pentiumii", 16 );
+ else if (!strcmp (argv[i]+7,"pentium3"))
+ add_assembler_option ("-mtune=pentiumiii", 17 );
+ else if (!strcmp (argv[i]+7,"k6-2"))
+ add_assembler_option ("-mtune=k6_2", 11 );
+ }
+#endif
else if (! strncmp (argv[i], "-Wa,", 4))
{
int prev, j;


Ok for trunk?

Regards,
 Vladimir Volynsky
---
Professional hosting for everyone - http://www.host.ru


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]