]> gcc.gnu.org Git - gcc.git/commitdiff
gcc * config.gcc (extra_gcc_objs): Define for MSP430.
authorNick Clifton <nickc@redhat.com>
Fri, 4 Dec 2015 17:24:30 +0000 (17:24 +0000)
committerNick Clifton <nickc@gcc.gnu.org>
Fri, 4 Dec 2015 17:24:30 +0000 (17:24 +0000)
        * common/config/msp430/msp430-common.c (msp430_handle_option):
Pass both -mmcu and -mcpu on to the back end if they are both
defined.
* config/msp430/msp430.c (hwmult_name): New function.
        (msp430_option_override): If an unrecognised MCU name is
detected only warn if the user has not provided suitable
        -mhwmult and -mcpu options.  Use msp430_warn_mcu to control
warning messages.  Generate warnings about conflicts between
-mmcu and -mcpu and -mhwmult options.
If neither -mcpu nor -mmcu have been specified but -mhwmult=
f5series has the select the 430X isa.
(msp430_no_hwmult): If -mmcu has not been specified and
msp430_hwmult_type is AUTO then return true.
* config/msp430/msp430.h (EXTRA_SPEC_FUNCTIONS): Define.
(LIB_SPEC): Add hardware multiply library selection.
* config/msp430/t-msp430: Delete hardware multiply multilibs.
Add rule to build driver-msp430.o
* config/msp430/driver-msp430.c: New file.
* config/msp430/msp430.opt (warn-mcu): New option.
* doc/invoke.texi: Update description of -mhwmult=auto.
        Document -mwarn-mcu option.

tests * gcc.target/msp430/msp_abi_div_funcs.c: New test.
* gcc.target/msp430/mul_main.h: New test support file.
* gcc.target/msp430/mul_none.c: New test.
* gcc.target/msp430/mul_16bit.c: New test.
* gcc.target/msp430/mul_32bit.c: New test.
* gcc.target/msp430/mul_f5.c: New test.

libgcc * config/msp430/mpy.c (__mulhi3): Use a faster algorithm.
Allow for the second argument being negative.
* config.host (extra_parts): Define for MSP430.  Create separate
libraries for each of the hardware multiply formats.
* config/msp430/lib2hw_mul.S: Build only the multiply routines
that are needed.
* config/msp430/lib2mul.c: Likewise.
* config/msp430/t-msp430 (LIB2ADD): Remove lib2hw_mul.S.
Add rules to build hardware multiply libraries.
* config/msp430/lib2divSI.c: (__mspabi_divlu): Alias for
__mspabi_divul function.
(__mspabi_divllu): New stub function.

From-SVN: r231286

24 files changed:
gcc/ChangeLog
gcc/common/config/msp430/msp430-common.c
gcc/config.gcc
gcc/config/msp430/driver-msp430.c [new file with mode: 0644]
gcc/config/msp430/msp430.c
gcc/config/msp430/msp430.h
gcc/config/msp430/msp430.opt
gcc/config/msp430/t-msp430
gcc/doc/invoke.texi
gcc/testsuite/ChangeLog
gcc/testsuite/c-c++-common/cpp/warning-zero-location.c
gcc/testsuite/gcc.target/msp430/msp_abi_div_funcs.c [new file with mode: 0644]
gcc/testsuite/gcc.target/msp430/mul_16bit.c [new file with mode: 0644]
gcc/testsuite/gcc.target/msp430/mul_32bit.c [new file with mode: 0644]
gcc/testsuite/gcc.target/msp430/mul_f5.c [new file with mode: 0644]
gcc/testsuite/gcc.target/msp430/mul_main.h [new file with mode: 0644]
gcc/testsuite/gcc.target/msp430/mul_none.c [new file with mode: 0644]
libgcc/ChangeLog
libgcc/config.host
libgcc/config/msp430/lib2divSI.c
libgcc/config/msp430/lib2hw_mul.S
libgcc/config/msp430/lib2mul.c
libgcc/config/msp430/mpy.c
libgcc/config/msp430/t-msp430

index 7d5e7aa21ee588e2f3e8c31af8731204f06d46b5..c918cf92931aed1dbe02f4e08b099f8f9270b395 100644 (file)
@@ -1,4 +1,29 @@
-2015-12-04  Segher Boessenkool  <segher@kernel.crashing.org>
+2015-11-25  Nick Clifton  <nickc@redhat.com>
+
+       * config.gcc (extra_gcc_objs): Define for MSP430.
+        * common/config/msp430/msp430-common.c (msp430_handle_option):
+       Pass both -mmcu and -mcpu on to the back end if they are both
+       defined.
+       * config/msp430/msp430.c (hwmult_name): New function.
+        (msp430_option_override): If an unrecognised MCU name is
+       detected only warn if the user has not provided suitable
+        -mhwmult and -mcpu options.  Use msp430_warn_mcu to control
+       warning messages.  Generate warnings about conflicts between
+       -mmcu and -mcpu and -mhwmult options.
+       If neither -mcpu nor -mmcu have been specified but -mhwmult=
+       f5series has the select the 430X isa.
+       (msp430_no_hwmult): If -mmcu has not been specified and
+       msp430_hwmult_type is AUTO then return true.
+       * config/msp430/msp430.h (EXTRA_SPEC_FUNCTIONS): Define.
+       (LIB_SPEC): Add hardware multiply library selection.
+       * config/msp430/t-msp430: Delete hardware multiply multilibs.
+       Add rule to build driver-msp430.o
+       * config/msp430/driver-msp430.c: New file.
+       * config/msp430/msp430.opt (warn-mcu): New option.
+       * doc/invoke.texi: Update description of -mhwmult=auto.
+        Document -mwarn-mcu option.
+
+2015-12-04  Segher Boessenkool  <segher&kernel.crashing.org>
 
        * (cstore<mode>4_signed): New expander.
        (cstore<mode>4): Call it.
index ce071d13fa9bcc1c079a7b81be6abd3bb6fc3c4f..cbceab92db325d5448b960feb0c6390de0104213 100644 (file)
@@ -27,9 +27,9 @@
 #include "opts.h"
 #include "flags.h"
 
-/* Handle -mcpu= and -mmcu= here.  We want to ensure that only one
-   of these two options - the last specified on the command line -
-   is passed on to the msp430 backend.  */
+/* Check for generic -mcpu= and -mmcu= names here.  If found then we
+   convert to a baseline cpu name.  Otherwise we allow the option to
+   be passed on to the backend where it can be checked more fully.  */
 
 static bool
 msp430_handle_option (struct gcc_options *opts ATTRIBUTE_UNUSED,
@@ -46,13 +46,11 @@ msp430_handle_option (struct gcc_options *opts ATTRIBUTE_UNUSED,
          || strcasecmp (decoded->arg, "430xv2") == 0)
        {
          target_cpu = "msp430x";
-         target_mcu = NULL;
        }
       else if (strcasecmp (decoded->arg, "msp430") == 0
               || strcasecmp (decoded->arg, "430") == 0)
        {
          target_cpu = "msp430";
-         target_mcu = NULL;
        }
       else
        {
@@ -77,8 +75,6 @@ msp430_handle_option (struct gcc_options *opts ATTRIBUTE_UNUSED,
          target_cpu = "msp430x";
          target_mcu = NULL;
        }
-      else
-       target_cpu = NULL;
       break;
     }
       
index 59aee2cfdcde9cdab55678b9b6e2d0adc678e6b9..96ec76a1c16df02c9426acede69550a045b6848a 100644 (file)
@@ -2236,6 +2236,7 @@ msp430*-*-*)
        c_target_objs="msp430-c.o"
        cxx_target_objs="msp430-c.o"
        tmake_file="${tmake_file} msp430/t-msp430"
+       extra_gcc_objs="driver-msp430.o"
        ;;
 nds32le-*-*)
        target_cpu_default="0"
diff --git a/gcc/config/msp430/driver-msp430.c b/gcc/config/msp430/driver-msp430.c
new file mode 100644 (file)
index 0000000..0557aac
--- /dev/null
@@ -0,0 +1,703 @@
+/* Subroutines for the gcc driver.
+   Copyright (C) 2015 Free Software Foundation, Inc.
+   Contributed by Georg-Johann Lay <avr@gjlay.de>
+
+   This file is part of GCC.
+
+   GCC is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3, or (at your option)
+   any later version.
+
+   GCC is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with GCC; see the file COPYING3.  If not see
+   <http://www.gnu.org/licenses/>.  */
+
+#include "config.h"
+#include "system.h"
+#include "coretypes.h"
+#include "diagnostic.h"
+#include "tm.h"
+
+/* This is a copy of the same data structure found in gas/config/tc-msp430.c
+   Also another (sort-of) copy can be found in gcc/config/msp430/msp430.c
+   Keep these three structures in sync.
+   The data in this structure has been extracted from the devices.csv file
+   released by TI, updated as of 8 October 2015.  */
+
+struct msp430_mcu_data
+{
+  const char * name;
+  unsigned int revision; /* 0=> MSP430, 1=>MSP430X, 2=> MSP430Xv2.  */
+  unsigned int hwmpy;    /* 0=>none, 1=>16-bit, 2=>16-bit w/sign extend, 4=>32-bit, 8=> 32-bit (5xx).  */
+}
+msp430_mcu_data [] =
+{
+  { "cc430f5123",2,8 },
+  { "cc430f5125",2,8 },
+  { "cc430f5133",2,8 },
+  { "cc430f5135",2,8 },
+  { "cc430f5137",2,8 },
+  { "cc430f5143",2,8 },
+  { "cc430f5145",2,8 },
+  { "cc430f5147",2,8 },
+  { "cc430f6125",2,8 },
+  { "cc430f6126",2,8 },
+  { "cc430f6127",2,8 },
+  { "cc430f6135",2,8 },
+  { "cc430f6137",2,8 },
+  { "cc430f6143",2,8 },
+  { "cc430f6145",2,8 },
+  { "cc430f6147",2,8 },
+  { "msp430afe221",0,2 },
+  { "msp430afe222",0,2 },
+  { "msp430afe223",0,2 },
+  { "msp430afe231",0,2 },
+  { "msp430afe232",0,2 },
+  { "msp430afe233",0,2 },
+  { "msp430afe251",0,2 },
+  { "msp430afe252",0,2 },
+  { "msp430afe253",0,2 },
+  { "msp430bt5190",2,8 },
+  { "msp430c091",0,0 },
+  { "msp430c092",0,0 },
+  { "msp430c111",0,0 },
+  { "msp430c1111",0,0 },
+  { "msp430c112",0,0 },
+  { "msp430c1121",0,0 },
+  { "msp430c1331",0,0 },
+  { "msp430c1351",0,0 },
+  { "msp430c311s",0,0 },
+  { "msp430c312",0,0 },
+  { "msp430c313",0,0 },
+  { "msp430c314",0,0 },
+  { "msp430c315",0,0 },
+  { "msp430c323",0,0 },
+  { "msp430c325",0,0 },
+  { "msp430c336",0,1 },
+  { "msp430c337",0,1 },
+  { "msp430c412",0,0 },
+  { "msp430c413",0,0 },
+  { "msp430cg4616",1,1 },
+  { "msp430cg4617",1,1 },
+  { "msp430cg4618",1,1 },
+  { "msp430cg4619",1,1 },
+  { "msp430e112",0,0 },
+  { "msp430e313",0,0 },
+  { "msp430e315",0,0 },
+  { "msp430e325",0,0 },
+  { "msp430e337",0,1 },
+  { "msp430f110",0,0 },
+  { "msp430f1101",0,0 },
+  { "msp430f1101a",0,0 },
+  { "msp430f1111",0,0 },
+  { "msp430f1111a",0,0 },
+  { "msp430f112",0,0 },
+  { "msp430f1121",0,0 },
+  { "msp430f1121a",0,0 },
+  { "msp430f1122",0,0 },
+  { "msp430f1132",0,0 },
+  { "msp430f122",0,0 },
+  { "msp430f1222",0,0 },
+  { "msp430f123",0,0 },
+  { "msp430f1232",0,0 },
+  { "msp430f133",0,0 },
+  { "msp430f135",0,0 },
+  { "msp430f147",0,1 },
+  { "msp430f1471",0,1 },
+  { "msp430f148",0,1 },
+  { "msp430f1481",0,1 },
+  { "msp430f149",0,1 },
+  { "msp430f1491",0,1 },
+  { "msp430f155",0,0 },
+  { "msp430f156",0,0 },
+  { "msp430f157",0,0 },
+  { "msp430f1610",0,1 },
+  { "msp430f1611",0,1 },
+  { "msp430f1612",0,1 },
+  { "msp430f167",0,1 },
+  { "msp430f168",0,1 },
+  { "msp430f169",0,1 },
+  { "msp430f2001",0,0 },
+  { "msp430f2002",0,0 },
+  { "msp430f2003",0,0 },
+  { "msp430f2011",0,0 },
+  { "msp430f2012",0,0 },
+  { "msp430f2013",0,0 },
+  { "msp430f2101",0,0 },
+  { "msp430f2111",0,0 },
+  { "msp430f2112",0,0 },
+  { "msp430f2121",0,0 },
+  { "msp430f2122",0,0 },
+  { "msp430f2131",0,0 },
+  { "msp430f2132",0,0 },
+  { "msp430f2232",0,0 },
+  { "msp430f2234",0,0 },
+  { "msp430f2252",0,0 },
+  { "msp430f2254",0,0 },
+  { "msp430f2272",0,0 },
+  { "msp430f2274",0,0 },
+  { "msp430f233",0,2 },
+  { "msp430f2330",0,2 },
+  { "msp430f235",0,2 },
+  { "msp430f2350",0,2 },
+  { "msp430f2370",0,2 },
+  { "msp430f2410",0,2 },
+  { "msp430f2416",1,2 },
+  { "msp430f2417",1,2 },
+  { "msp430f2418",1,2 },
+  { "msp430f2419",1,2 },
+  { "msp430f247",0,2 },
+  { "msp430f2471",0,2 },
+  { "msp430f248",0,2 },
+  { "msp430f2481",0,2 },
+  { "msp430f249",0,2 },
+  { "msp430f2491",0,2 },
+  { "msp430f2616",1,2 },
+  { "msp430f2617",1,2 },
+  { "msp430f2618",1,2 },
+  { "msp430f2619",1,2 },
+  { "msp430f412",0,0 },
+  { "msp430f413",0,0 },
+  { "msp430f4132",0,0 },
+  { "msp430f415",0,0 },
+  { "msp430f4152",0,0 },
+  { "msp430f417",0,0 },
+  { "msp430f423",0,1 },
+  { "msp430f423a",0,1 },
+  { "msp430f425",0,1 },
+  { "msp430f4250",0,0 },
+  { "msp430f425a",0,1 },
+  { "msp430f4260",0,0 },
+  { "msp430f427",0,1 },
+  { "msp430f4270",0,0 },
+  { "msp430f427a",0,1 },
+  { "msp430f435",0,0 },
+  { "msp430f4351",0,0 },
+  { "msp430f436",0,0 },
+  { "msp430f4361",0,0 },
+  { "msp430f437",0,0 },
+  { "msp430f4371",0,0 },
+  { "msp430f438",0,0 },
+  { "msp430f439",0,0 },
+  { "msp430f447",0,1 },
+  { "msp430f448",0,1 },
+  { "msp430f4481",0,1 },
+  { "msp430f449",0,1 },
+  { "msp430f4491",0,1 },
+  { "msp430f4616",1,1 },
+  { "msp430f46161",1,1 },
+  { "msp430f4617",1,1 },
+  { "msp430f46171",1,1 },
+  { "msp430f4618",1,1 },
+  { "msp430f46181",1,1 },
+  { "msp430f4619",1,1 },
+  { "msp430f46191",1,1 },
+  { "msp430f47126",1,4 },
+  { "msp430f47127",1,4 },
+  { "msp430f47163",1,4 },
+  { "msp430f47166",1,4 },
+  { "msp430f47167",1,4 },
+  { "msp430f47173",1,4 },
+  { "msp430f47176",1,4 },
+  { "msp430f47177",1,4 },
+  { "msp430f47183",1,4 },
+  { "msp430f47186",1,4 },
+  { "msp430f47187",1,4 },
+  { "msp430f47193",1,4 },
+  { "msp430f47196",1,4 },
+  { "msp430f47197",1,4 },
+  { "msp430f477",0,0 },
+  { "msp430f478",0,0 },
+  { "msp430f4783",0,4 },
+  { "msp430f4784",0,4 },
+  { "msp430f479",0,0 },
+  { "msp430f4793",0,4 },
+  { "msp430f4794",0,4 },
+  { "msp430f5131",2,8 },
+  { "msp430f5132",2,8 },
+  { "msp430f5151",2,8 },
+  { "msp430f5152",2,8 },
+  { "msp430f5171",2,8 },
+  { "msp430f5172",2,8 },
+  { "msp430f5212",2,8 },
+  { "msp430f5213",2,8 },
+  { "msp430f5214",2,8 },
+  { "msp430f5217",2,8 },
+  { "msp430f5218",2,8 },
+  { "msp430f5219",2,8 },
+  { "msp430f5222",2,8 },
+  { "msp430f5223",2,8 },
+  { "msp430f5224",2,8 },
+  { "msp430f5227",2,8 },
+  { "msp430f5228",2,8 },
+  { "msp430f5229",2,8 },
+  { "msp430f5232",2,8 },
+  { "msp430f5234",2,8 },
+  { "msp430f5237",2,8 },
+  { "msp430f5239",2,8 },
+  { "msp430f5242",2,8 },
+  { "msp430f5244",2,8 },
+  { "msp430f5247",2,8 },
+  { "msp430f5249",2,8 },
+  { "msp430f5252",2,8 },
+  { "msp430f5253",2,8 },
+  { "msp430f5254",2,8 },
+  { "msp430f5255",2,8 },
+  { "msp430f5256",2,8 },
+  { "msp430f5257",2,8 },
+  { "msp430f5258",2,8 },
+  { "msp430f5259",2,8 },
+  { "msp430f5304",2,8 },
+  { "msp430f5308",2,8 },
+  { "msp430f5309",2,8 },
+  { "msp430f5310",2,8 },
+  { "msp430f5324",2,8 },
+  { "msp430f5325",2,8 },
+  { "msp430f5326",2,8 },
+  { "msp430f5327",2,8 },
+  { "msp430f5328",2,8 },
+  { "msp430f5329",2,8 },
+  { "msp430f5333",2,8 },
+  { "msp430f5335",2,8 },
+  { "msp430f5336",2,8 },
+  { "msp430f5338",2,8 },
+  { "msp430f5340",2,8 },
+  { "msp430f5341",2,8 },
+  { "msp430f5342",2,8 },
+  { "msp430f5358",2,8 },
+  { "msp430f5359",2,8 },
+  { "msp430f5418",2,8 },
+  { "msp430f5418a",2,8 },
+  { "msp430f5419",2,8 },
+  { "msp430f5419a",2,8 },
+  { "msp430f5435",2,8 },
+  { "msp430f5435a",2,8 },
+  { "msp430f5436",2,8 },
+  { "msp430f5436a",2,8 },
+  { "msp430f5437",2,8 },
+  { "msp430f5437a",2,8 },
+  { "msp430f5438",2,8 },
+  { "msp430f5438a",2,8 },
+  { "msp430f5500",2,8 },
+  { "msp430f5501",2,8 },
+  { "msp430f5502",2,8 },
+  { "msp430f5503",2,8 },
+  { "msp430f5504",2,8 },
+  { "msp430f5505",2,8 },
+  { "msp430f5506",2,8 },
+  { "msp430f5507",2,8 },
+  { "msp430f5508",2,8 },
+  { "msp430f5509",2,8 },
+  { "msp430f5510",2,8 },
+  { "msp430f5513",2,8 },
+  { "msp430f5514",2,8 },
+  { "msp430f5515",2,8 },
+  { "msp430f5517",2,8 },
+  { "msp430f5519",2,8 },
+  { "msp430f5521",2,8 },
+  { "msp430f5522",2,8 },
+  { "msp430f5524",2,8 },
+  { "msp430f5525",2,8 },
+  { "msp430f5526",2,8 },
+  { "msp430f5527",2,8 },
+  { "msp430f5528",2,8 },
+  { "msp430f5529",2,8 },
+  { "msp430f5630",2,8 },
+  { "msp430f5631",2,8 },
+  { "msp430f5632",2,8 },
+  { "msp430f5633",2,8 },
+  { "msp430f5634",2,8 },
+  { "msp430f5635",2,8 },
+  { "msp430f5636",2,8 },
+  { "msp430f5637",2,8 },
+  { "msp430f5638",2,8 },
+  { "msp430f5658",2,8 },
+  { "msp430f5659",2,8 },
+  { "msp430f5xx_6xxgeneric",2,8 },
+  { "msp430f6433",2,8 },
+  { "msp430f6435",2,8 },
+  { "msp430f6436",2,8 },
+  { "msp430f6438",2,8 },
+  { "msp430f6458",2,8 },
+  { "msp430f6459",2,8 },
+  { "msp430f6630",2,8 },
+  { "msp430f6631",2,8 },
+  { "msp430f6632",2,8 },
+  { "msp430f6633",2,8 },
+  { "msp430f6634",2,8 },
+  { "msp430f6635",2,8 },
+  { "msp430f6636",2,8 },
+  { "msp430f6637",2,8 },
+  { "msp430f6638",2,8 },
+  { "msp430f6658",2,8 },
+  { "msp430f6659",2,8 },
+  { "msp430f6720",2,8 },
+  { "msp430f6720a",2,8 },
+  { "msp430f6721",2,8 },
+  { "msp430f6721a",2,8 },
+  { "msp430f6723",2,8 },
+  { "msp430f6723a",2,8 },
+  { "msp430f6724",2,8 },
+  { "msp430f6724a",2,8 },
+  { "msp430f6725",2,8 },
+  { "msp430f6725a",2,8 },
+  { "msp430f6726",2,8 },
+  { "msp430f6726a",2,8 },
+  { "msp430f6730",2,8 },
+  { "msp430f6730a",2,8 },
+  { "msp430f6731",2,8 },
+  { "msp430f6731a",2,8 },
+  { "msp430f6733",2,8 },
+  { "msp430f6733a",2,8 },
+  { "msp430f6734",2,8 },
+  { "msp430f6734a",2,8 },
+  { "msp430f6735",2,8 },
+  { "msp430f6735a",2,8 },
+  { "msp430f6736",2,8 },
+  { "msp430f6736a",2,8 },
+  { "msp430f6745",2,8 },
+  { "msp430f67451",2,8 },
+  { "msp430f67451a",2,8 },
+  { "msp430f6745a",2,8 },
+  { "msp430f6746",2,8 },
+  { "msp430f67461",2,8 },
+  { "msp430f67461a",2,8 },
+  { "msp430f6746a",2,8 },
+  { "msp430f6747",2,8 },
+  { "msp430f67471",2,8 },
+  { "msp430f67471a",2,8 },
+  { "msp430f6747a",2,8 },
+  { "msp430f6748",2,8 },
+  { "msp430f67481",2,8 },
+  { "msp430f67481a",2,8 },
+  { "msp430f6748a",2,8 },
+  { "msp430f6749",2,8 },
+  { "msp430f67491",2,8 },
+  { "msp430f67491a",2,8 },
+  { "msp430f6749a",2,8 },
+  { "msp430f67621",2,8 },
+  { "msp430f67621a",2,8 },
+  { "msp430f67641",2,8 },
+  { "msp430f67641a",2,8 },
+  { "msp430f6765",2,8 },
+  { "msp430f67651",2,8 },
+  { "msp430f67651a",2,8 },
+  { "msp430f6765a",2,8 },
+  { "msp430f6766",2,8 },
+  { "msp430f67661",2,8 },
+  { "msp430f67661a",2,8 },
+  { "msp430f6766a",2,8 },
+  { "msp430f6767",2,8 },
+  { "msp430f67671",2,8 },
+  { "msp430f67671a",2,8 },
+  { "msp430f6767a",2,8 },
+  { "msp430f6768",2,8 },
+  { "msp430f67681",2,8 },
+  { "msp430f67681a",2,8 },
+  { "msp430f6768a",2,8 },
+  { "msp430f6769",2,8 },
+  { "msp430f67691",2,8 },
+  { "msp430f67691a",2,8 },
+  { "msp430f6769a",2,8 },
+  { "msp430f6775",2,8 },
+  { "msp430f67751",2,8 },
+  { "msp430f67751a",2,8 },
+  { "msp430f6775a",2,8 },
+  { "msp430f6776",2,8 },
+  { "msp430f67761",2,8 },
+  { "msp430f67761a",2,8 },
+  { "msp430f6776a",2,8 },
+  { "msp430f6777",2,8 },
+  { "msp430f67771",2,8 },
+  { "msp430f67771a",2,8 },
+  { "msp430f6777a",2,8 },
+  { "msp430f6778",2,8 },
+  { "msp430f67781",2,8 },
+  { "msp430f67781a",2,8 },
+  { "msp430f6778a",2,8 },
+  { "msp430f6779",2,8 },
+  { "msp430f67791",2,8 },
+  { "msp430f67791a",2,8 },
+  { "msp430f6779a",2,8 },
+  { "msp430fe423",0,0 },
+  { "msp430fe4232",0,0 },
+  { "msp430fe423a",0,0 },
+  { "msp430fe4242",0,0 },
+  { "msp430fe425",0,0 },
+  { "msp430fe4252",0,0 },
+  { "msp430fe425a",0,0 },
+  { "msp430fe427",0,0 },
+  { "msp430fe4272",0,0 },
+  { "msp430fe427a",0,0 },
+  { "msp430fg4250",0,0 },
+  { "msp430fg4260",0,0 },
+  { "msp430fg4270",0,0 },
+  { "msp430fg437",0,0 },
+  { "msp430fg438",0,0 },
+  { "msp430fg439",0,0 },
+  { "msp430fg4616",1,1 },
+  { "msp430fg4617",1,1 },
+  { "msp430fg4618",1,1 },
+  { "msp430fg4619",1,1 },
+  { "msp430fg477",0,0 },
+  { "msp430fg478",0,0 },
+  { "msp430fg479",0,0 },
+  { "msp430fg6425",2,8 },
+  { "msp430fg6426",2,8 },
+  { "msp430fg6625",2,8 },
+  { "msp430fg6626",2,8 },
+  { "msp430fr2032",2,0 },
+  { "msp430fr2033",2,0 },
+  { "msp430fr2433",2,8 },
+  { "msp430fr2xx_4xxgeneric",2,8 },
+  { "msp430fr4131",2,0 },
+  { "msp430fr4132",2,0 },
+  { "msp430fr4133",2,0 },
+  { "msp430fr5720",2,8 },
+  { "msp430fr5721",2,8 },
+  { "msp430fr5722",2,8 },
+  { "msp430fr5723",2,8 },
+  { "msp430fr5724",2,8 },
+  { "msp430fr5725",2,8 },
+  { "msp430fr5726",2,8 },
+  { "msp430fr5727",2,8 },
+  { "msp430fr5728",2,8 },
+  { "msp430fr5729",2,8 },
+  { "msp430fr5730",2,8 },
+  { "msp430fr5731",2,8 },
+  { "msp430fr5732",2,8 },
+  { "msp430fr5733",2,8 },
+  { "msp430fr5734",2,8 },
+  { "msp430fr5735",2,8 },
+  { "msp430fr5736",2,8 },
+  { "msp430fr5737",2,8 },
+  { "msp430fr5738",2,8 },
+  { "msp430fr5739",2,8 },
+  { "msp430fr57xxgeneric",2,8 },
+  { "msp430fr5847",2,8 },
+  { "msp430fr58471",2,8 },
+  { "msp430fr5848",2,8 },
+  { "msp430fr5849",2,8 },
+  { "msp430fr5857",2,8 },
+  { "msp430fr5858",2,8 },
+  { "msp430fr5859",2,8 },
+  { "msp430fr5867",2,8 },
+  { "msp430fr58671",2,8 },
+  { "msp430fr5868",2,8 },
+  { "msp430fr5869",2,8 },
+  { "msp430fr5870",2,8 },
+  { "msp430fr5872",2,8 },
+  { "msp430fr58721",2,8 },
+  { "msp430fr5887",2,8 },
+  { "msp430fr5888",2,8 },
+  { "msp430fr5889",2,8 },
+  { "msp430fr58891",2,8 },
+  { "msp430fr5922",2,8 },
+  { "msp430fr59221",2,8 },
+  { "msp430fr5947",2,8 },
+  { "msp430fr59471",2,8 },
+  { "msp430fr5948",2,8 },
+  { "msp430fr5949",2,8 },
+  { "msp430fr5957",2,8 },
+  { "msp430fr5958",2,8 },
+  { "msp430fr5959",2,8 },
+  { "msp430fr5967",2,8 },
+  { "msp430fr5968",2,8 },
+  { "msp430fr5969",2,8 },
+  { "msp430fr59691",2,8 },
+  { "msp430fr5970",2,8 },
+  { "msp430fr5972",2,8 },
+  { "msp430fr59721",2,8 },
+  { "msp430fr5986",2,8 },
+  { "msp430fr5987",2,8 },
+  { "msp430fr5988",2,8 },
+  { "msp430fr5989",2,8 },
+  { "msp430fr59891",2,8 },
+  { "msp430fr5xx_6xxgeneric",2,8 },
+  { "msp430fr6820",2,8 },
+  { "msp430fr6822",2,8 },
+  { "msp430fr68221",2,8 },
+  { "msp430fr6870",2,8 },
+  { "msp430fr6872",2,8 },
+  { "msp430fr68721",2,8 },
+  { "msp430fr6877",2,8 },
+  { "msp430fr6879",2,8 },
+  { "msp430fr68791",2,8 },
+  { "msp430fr6887",2,8 },
+  { "msp430fr6888",2,8 },
+  { "msp430fr6889",2,8 },
+  { "msp430fr68891",2,8 },
+  { "msp430fr6920",2,8 },
+  { "msp430fr6922",2,8 },
+  { "msp430fr69221",2,8 },
+  { "msp430fr6927",2,8 },
+  { "msp430fr69271",2,8 },
+  { "msp430fr6928",2,8 },
+  { "msp430fr6970",2,8 },
+  { "msp430fr6972",2,8 },
+  { "msp430fr69721",2,8 },
+  { "msp430fr6977",2,8 },
+  { "msp430fr6979",2,8 },
+  { "msp430fr69791",2,8 },
+  { "msp430fr6987",2,8 },
+  { "msp430fr6988",2,8 },
+  { "msp430fr6989",2,8 },
+  { "msp430fr69891",2,8 },
+  { "msp430fw423",0,0 },
+  { "msp430fw425",0,0 },
+  { "msp430fw427",0,0 },
+  { "msp430fw428",0,0 },
+  { "msp430fw429",0,0 },
+  { "msp430g2001",0,0 },
+  { "msp430g2101",0,0 },
+  { "msp430g2102",0,0 },
+  { "msp430g2111",0,0 },
+  { "msp430g2112",0,0 },
+  { "msp430g2113",0,0 },
+  { "msp430g2121",0,0 },
+  { "msp430g2131",0,0 },
+  { "msp430g2132",0,0 },
+  { "msp430g2152",0,0 },
+  { "msp430g2153",0,0 },
+  { "msp430g2201",0,0 },
+  { "msp430g2202",0,0 },
+  { "msp430g2203",0,0 },
+  { "msp430g2210",0,0 },
+  { "msp430g2211",0,0 },
+  { "msp430g2212",0,0 },
+  { "msp430g2213",0,0 },
+  { "msp430g2221",0,0 },
+  { "msp430g2230",0,0 },
+  { "msp430g2231",0,0 },
+  { "msp430g2232",0,0 },
+  { "msp430g2233",0,0 },
+  { "msp430g2252",0,0 },
+  { "msp430g2253",0,0 },
+  { "msp430g2302",0,0 },
+  { "msp430g2303",0,0 },
+  { "msp430g2312",0,0 },
+  { "msp430g2313",0,0 },
+  { "msp430g2332",0,0 },
+  { "msp430g2333",0,0 },
+  { "msp430g2352",0,0 },
+  { "msp430g2353",0,0 },
+  { "msp430g2402",0,0 },
+  { "msp430g2403",0,0 },
+  { "msp430g2412",0,0 },
+  { "msp430g2413",0,0 },
+  { "msp430g2432",0,0 },
+  { "msp430g2433",0,0 },
+  { "msp430g2444",0,0 },
+  { "msp430g2452",0,0 },
+  { "msp430g2453",0,0 },
+  { "msp430g2513",0,0 },
+  { "msp430g2533",0,0 },
+  { "msp430g2544",0,0 },
+  { "msp430g2553",0,0 },
+  { "msp430g2744",0,0 },
+  { "msp430g2755",0,0 },
+  { "msp430g2855",0,0 },
+  { "msp430g2955",0,0 },
+  { "msp430i2020",0,2 },
+  { "msp430i2021",0,2 },
+  { "msp430i2030",0,2 },
+  { "msp430i2031",0,2 },
+  { "msp430i2040",0,2 },
+  { "msp430i2041",0,2 },
+  { "msp430i2xxgeneric",0,2 },
+  { "msp430l092",0,0 },
+  { "msp430p112",0,0 },
+  { "msp430p313",0,0 },
+  { "msp430p315",0,0 },
+  { "msp430p315s",0,0 },
+  { "msp430p325",0,0 },
+  { "msp430p337",0,1 },
+  { "msp430sl5438a",2,8 },
+  { "msp430tch5e",0,0 },
+  { "msp430xgeneric",2,8 },
+  { "rf430f5144",2,8 },
+  { "rf430f5155",2,8 },
+  { "rf430f5175",2,8 },
+  { "rf430frl152h",0,0 },
+  { "rf430frl152h_rom",0,0 },
+  { "rf430frl153h",0,0 },
+  { "rf430frl153h_rom",0,0 },
+  { "rf430frl154h",0,0 },
+  { "rf430frl154h_rom",0,0 }
+};  
+
+/* Implement spec function `msp430_hwmult_lib´.  */
+
+const char *
+msp430_select_hwmult_lib (int argc ATTRIBUTE_UNUSED, const char ** argv ATTRIBUTE_UNUSED)
+{
+  int i;
+
+  switch (argc)
+  {
+  case 1:
+    if (strcasecmp (argv[0], "default"))
+      error ("unexpected argument to msp430_select_hwmult_lib: %s", argv[0]);
+    break;
+
+  default:
+    /* We can get three or more arguments passed to this function.
+       This happens when the same option is repeated on the command line.
+       For example:
+         msp430-elf-gcc -mhwmult=none -mhwmult=16bit foo.c
+       We have to use the last argument as our selector.  */
+    if (strcasecmp (argv[0], "hwmult") == 0)
+      {
+       static struct hwmult_options
+       {
+         const char * name;
+         const char * lib;
+       } hwmult_options [] =
+       {
+         { "none", "-lmul_none" },
+         { "auto", "-lmul_AUTO" }, /* Should not see this one... */
+         { "16bit", "-lmul_16" },
+         { "32bit", "-lmul_32" },
+         { "f5series", "-lmul_f5" }
+       };
+
+       for (i = ARRAY_SIZE (hwmult_options); i--;)
+         if (strcasecmp (argv[argc - 1], hwmult_options[i].name) == 0)
+           return hwmult_options[i].lib;
+      }
+    else if (strcasecmp (argv[0], "mcu") == 0)
+      {
+       for (i = ARRAY_SIZE (msp430_mcu_data); i--;)
+         if (strcasecmp (argv[argc - 1], msp430_mcu_data[i].name) == 0)
+           {
+             switch (msp430_mcu_data[i].hwmpy)
+               {
+               case 0: return "-lmul_none";
+               case 2:
+               case 1: return "-lmul_16";
+               case 4: return "-lmul_32";
+               case 8: return "-lmul_f5";
+               default:
+                 error ("unrecognised hwpy field in msp430_mcu_data[%d]: %d",
+                        i, msp430_mcu_data[i].hwmpy);
+                 break;
+               }
+           }
+      }
+    else
+      error ("unexpected first argument to msp430_select_hwmult_lib: %s", argv[0]);
+    break;
+
+  case 0:
+    error ("msp430_select_hwmult_lib needs one or more arguments");
+    break;
+  }
+  
+  return "-lmul_none";
+}
index 8832582af8ef55c8f16edf20b5ae91bba1a8600c..88301c808ea8afe251ec50b1d274e57fa45ed888 100644 (file)
@@ -90,7 +90,7 @@ msp430_init_machine_status (void)
 #define TARGET_OPTION_OVERRIDE         msp430_option_override
 
 /* This is a copy of the same data structure found in gas/config/tc-msp430.c
-   Also another (sort-of) copy can be found in gcc/config/msp430/t-msp430.
+   Also another (sort-of) copy can be found in gcc/config/msp430/devices-msp430.c
    Keep these three structures in sync.
    The data in this structure has been extracted from the devices.csv file
    released by TI, updated as of 8 October 2015.  */
@@ -717,6 +717,20 @@ msp430_mcu_name (void)
   return msp430x ? "__MSP430XGENERIC__" : "__MSP430GENERIC__";
 }
 
+static const char *
+hwmult_name (unsigned int val)
+{
+  switch (val)
+    {
+    case 0: return "none";
+    case 1: return "16-bit";
+    case 2: return "16-bit";
+    case 4: return "32-bit";
+    case 8: return "32-bit (5xx)";
+    default: gcc_unreachable ();
+    }
+}
+
 static void
 msp430_option_override (void)
 {
@@ -724,37 +738,90 @@ msp430_option_override (void)
 
   if (target_cpu)
     {
+      /* gcc/common/config/msp430-common.c will have
+        already canonicalised the string in target_cpu.  */
       if (strcasecmp (target_cpu, "msp430x") == 0)
        msp430x = true;
       else /* target_cpu == "msp430" - already handled by the front end.  */
        msp430x = false;
     }
-  /* Note - the front end has already ensured at most
-     one of target_cpu and target_mcu will be set.  */
-  else if (target_mcu)
+
+  if (target_mcu)
     {
       int i;
 
-      /* If we are given an MCU name, we assume that it supports 430X.
-        Then we check to see if it is one of the known MCUs that only
-        supports 430.  */
-      msp430x = true;
-
-      /* FIXME: This array is alpha sorted, so we could use a binary search.  */
+      /* FIXME: If the array were alpha sorted, we could use a binary search.  */
       for (i = ARRAY_SIZE (msp430_mcu_data); i--;)
        if (strcasecmp (msp430_mcu_data[i].name, target_mcu) == 0)
          {
-           msp430x = msp430_mcu_data[i].revision >= 1;
+           bool xisa = msp430_mcu_data[i].revision >= 1; 
+
+           if (msp430_warn_mcu)
+             {
+               if (target_cpu&& msp430x != xisa)
+                 warning (0, "MCU '%s' supports %s ISA but -mcpu option is set to %s",
+                          target_mcu, xisa ? "430X" : "430", msp430x ? "430X" : "430");
+
+               if (msp430_mcu_data[i].hwmpy == 0
+                   && msp430_hwmult_type != AUTO
+                   && msp430_hwmult_type != NONE)
+                 warning (0, "MCU '%s' does not have hardware multiply support, but -mhwmult is set to %s",
+                          target_mcu,
+                          msp430_hwmult_type == SMALL ? "16-bit" : msp430_hwmult_type == LARGE ? "32-bit" : "f5series");
+               else if (msp430_hwmult_type == SMALL
+                   && msp430_mcu_data[i].hwmpy != 1
+                   && msp430_mcu_data[i].hwmpy != 2 )
+                 warning (0, "MCU '%s' supports %s hardware multiply, but -mhwmult is set to 16-bit",
+                          target_mcu, hwmult_name (msp430_mcu_data[i].hwmpy));
+               else if (msp430_hwmult_type == LARGE && msp430_mcu_data[i].hwmpy != 4)
+                 warning (0, "MCU '%s' supports %s hardware multiply, but -mhwmult is set to 32-bit",
+                          target_mcu, hwmult_name (msp430_mcu_data[i].hwmpy));
+               else if (msp430_hwmult_type == F5SERIES && msp430_mcu_data[i].hwmpy != 8)
+                 warning (0, "MCU '%s' supports %s hardware multiply, but -mhwmult is set to f5series",
+                          target_mcu, hwmult_name (msp430_mcu_data[i].hwmpy));
+             }
+
+           msp430x = xisa;
            break;
          }
+
       if (i < 0)
        {
-         warning (0, "Unrecognised MCU name '%s', assuming that it is just a MSP430 with no hardware multiply",
-                  target_mcu);
-         msp430x = false;
+         if (msp430_hwmult_type == AUTO)
+           {
+             if (msp430_warn_mcu)
+               {
+                 if (target_cpu == NULL)
+                   warning (0,
+                            "Unrecognised MCU name '%s', assuming that it is just a MSP430 with no hardware multiply.\nUse the -mcpu and -mhwmult options to set these explicitly.",
+                            target_mcu);
+                 else
+                   warning (0,
+                            "Unrecognised MCU name '%s', assuming that it has no hardware multiply.\nUse the -mhwmult option to set this explicitly.",
+                            target_mcu);
+               }
+
+             msp430_hwmult_type = NONE;
+           }
+         else if (target_cpu == NULL)
+           {
+             if (msp430_warn_mcu)
+               warning (0,
+                        "Unrecognised MCU name '%s', assuming that it just supports the MSP430 ISA.\nUse the -mcpu option to set the ISA explicitly.",
+                        target_mcu);
+
+             msp430x = false;
+           }
+         else if (msp430_warn_mcu)
+           warning (0,
+                    "Unrecognised MCU name '%s'.", target_mcu);
        }
     }
 
+  /* The F5 series are all able to support the 430X ISA.  */
+  if (target_cpu == NULL && target_mcu == NULL && msp430_hwmult_type == F5SERIES)
+    msp430x = true;
+
   if (TARGET_LARGE && !msp430x)
     error ("-mlarge requires a 430X-compatible -mmcu=");
 
@@ -955,7 +1022,8 @@ msp430_addr_space_pointer_mode (addr_space_t addrspace)
 static machine_mode
 msp430_unwind_word_mode (void)
 {
-  return TARGET_LARGE ? PSImode : HImode;
+  /* This needs to match msp430_init_dwarf_reg_sizes_extra (below).  */
+  return msp430x ? PSImode : HImode;
 }
 
 /* Determine if one named address space is a subset of another.  */
@@ -1930,7 +1998,7 @@ const struct attribute_spec msp430_attribute_table[] =
   { ATTR_NOINIT,      0, 0, true,  false, false, msp430_data_attr, false },
   { ATTR_PERSIST,     0, 0, true,  false, false, msp430_data_attr, false },
 
-  { NULL,             0, 0, false, false, false, NULL,        false }
+  { NULL,             0, 0, false, false, false, NULL, false }
 };
 
 #undef  TARGET_ASM_FUNCTION_PROLOGUE
@@ -2795,6 +2863,7 @@ msp430_init_dwarf_reg_sizes_extra (tree address)
   rtx addr = expand_normal (address);
   rtx mem = gen_rtx_MEM (BLKmode, addr);
 
+  /* This needs to match msp430_unwind_word_mode (above).  */
   if (!msp430x)
     return;
 
@@ -3089,8 +3158,8 @@ static const struct
   { "__divsi3", "__mspabi_divli" },
   { "__divdi3", "__mspabi_divlli" },
   { "__udivhi3", "__mspabi_divu" },
-  { "__udivsi3", "__mspabi_divlu" },
-  { "__udivdi3", "__mspabi_divllu" },
+  { "__udivsi3", "__mspabi_divul" },
+  { "__udivdi3", "__mspabi_divull" },
   { "__modhi3", "__mspabi_remi" },
   { "__modsi3", "__mspabi_remli" },
   { "__moddi3", "__mspabi_remlli" },
@@ -3186,9 +3255,12 @@ msp430_no_hwmult (void)
   if (msp430_hwmult_type == NONE)
     return true;
 
-  if (target_mcu == NULL || msp430_hwmult_type != AUTO)
+  if (msp430_hwmult_type != AUTO)
     return false;
 
+  if (target_mcu == NULL)
+    return true;
+
   if (target_mcu == cached_match)
     return cached_result;
 
index 340aabda6ad27d10b8e6a555eae17acab5c15283..c638f2f0dbcfe2322f65f958d2e8e4eb17934559 100644 (file)
@@ -65,13 +65,37 @@ extern bool msp430x;
    is enabled  (the GDB testsuite relies upon unused entities not being deleted).  */
 #define LINK_SPEC "%{mrelax:--relax} %{mlarge:%{!r:%{!g:--gc-sections}}}"
 
+extern const char * msp430_select_hwmult_lib (int, const char **);
+# define EXTRA_SPEC_FUNCTIONS                          \
+  { "msp430_hwmult_lib", msp430_select_hwmult_lib },
+
+/* Specify the libraries to include on the linker command line.
+
+   Selecting the hardware multiply library to use is quite complex.
+   If the user has specified -mhwmult=FOO then the mapping is quite
+   easy (and could be handled here in the SPEC string), unless FOO
+   is set to AUTO.  In this case the -mmcu= option must be consulted
+   instead.  If the -mhwmult= option is not specified then the -mmcu=
+   option must then be examined.  If neither -mhwmult= nor -mmcu= are
+   specified then a default hardware multiply library is used.
+
+   Examining the -mmcu=FOO option is difficult, and it is so this
+   reason that a spec function is used.  There are so many possible
+   values of FOO that a table is used to look up the name and map
+   it to a hardware multiply library.  This table (in device-msp430.c)
+   must be kept in sync with the same table in msp430.c.  */
 #undef  LIB_SPEC
 #define LIB_SPEC "                                     \
 --start-group                                          \
+%{mhwmult=auto:%{mmcu=*:%:msp430_hwmult_lib(mcu %{mmcu=*:%*});:%:msp430_hwmult_lib(default)}; \
+  mhwmult=*:%:msp430_hwmult_lib(hwmult %{mhwmult=*:%*}); \
+  mmcu=*:%:msp430_hwmult_lib(mcu %{mmcu=*:%*});                \
+  :%:msp430_hwmult_lib(default)}                       \
 -lc                                                    \
 -lgcc                                                  \
 -lcrt                                                  \
 %{msim:-lsim}                                          \
+%{!msim:-lnosys}                                       \
 --end-group                                            \
 %{!T*:%{!msim:%{mmcu=*:--script=%*.ld}}}               \
 %{!T*:%{!msim:%{!mmcu=*:%Tmsp430.ld}}}                 \
index 108c2ec724da15e6ab13a7b552a361d765bf1f3f..51e38f5b60bd8640e78bdf996f4b6911a1437504 100644 (file)
@@ -10,6 +10,10 @@ mmcu=
 Target Report ToLower Joined RejectNegative Var(target_mcu)
 Specify the MCU to build for.
 
+mwarn-mcu
+Target Report Var(msp430_warn_mcu) Init(1)
+Warn if an MCU name is unrecognised or conflicts with other options (default: on).
+
 mcpu=
 Target Report Joined RejectNegative Var(target_cpu)
 Specify the ISA to build for: msp430, msp430x, msp430xv2.
index 3cefac846ab9b3c8f5f337eebae1411679a073ef..01e6d4cfa344203c0ebb5c18ad2e86862ed68b7e 100644 (file)
 # License along with GCC; see the file COPYING3.  If not see
 # <http://www.gnu.org/licenses/>.
 
+driver-msp430.o: $(srcdir)/config/msp430/driver-msp430.c \
+  $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H)
+       $(COMPILER) -c $(ALL_COMPILERFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $<
+
 # Enable multilibs:
 
 MULTILIB_OPTIONS    = mcpu=msp430 mlarge 
@@ -259,536 +263,6 @@ MULTILIB_MATCHES += mcpu?msp430=mmcu?msp430f4794
 MULTILIB_EXCEPTIONS = mcpu=msp430/mlarge
 
 
-# Multilibs for different types of hardware multiply support:
-
-MULTILIB_OPTIONS   += mhwmult=none/mhwmult=32bit/mhwmult=f5series
-MULTILIB_DIRNAMES  +=        nomul         32mul         f5mul
-
-MULTILIB_EXCEPTIONS += mcpu=msp430/mlarge/mhwmult=none
-MULTILIB_EXCEPTIONS += mcpu=msp430/mlarge/mhwmult=32bit
-MULTILIB_EXCEPTIONS += mcpu=msp430/mlarge/mhwmult=f5series
-MULTILIB_EXCEPTIONS += mcpu=msp430/mhwmult=f5series
-
-MULTILIB_MATCHES   += mhwmult?none=mmcu?msp430c091
-MULTILIB_MATCHES   += mhwmult?none=mmcu?msp430c092
-MULTILIB_MATCHES   += mhwmult?none=mmcu?msp430c111
-MULTILIB_MATCHES   += mhwmult?none=mmcu?msp430c1111
-MULTILIB_MATCHES   += mhwmult?none=mmcu?msp430c112
-MULTILIB_MATCHES   += mhwmult?none=mmcu?msp430c1121
-MULTILIB_MATCHES   += mhwmult?none=mmcu?msp430c1331
-MULTILIB_MATCHES   += mhwmult?none=mmcu?msp430c1351
-MULTILIB_MATCHES   += mhwmult?none=mmcu?msp430c311s
-MULTILIB_MATCHES   += mhwmult?none=mmcu?msp430c312
-MULTILIB_MATCHES   += mhwmult?none=mmcu?msp430c313
-MULTILIB_MATCHES   += mhwmult?none=mmcu?msp430c314
-MULTILIB_MATCHES   += mhwmult?none=mmcu?msp430c315
-MULTILIB_MATCHES   += mhwmult?none=mmcu?msp430c323
-MULTILIB_MATCHES   += mhwmult?none=mmcu?msp430c325
-MULTILIB_MATCHES   += mhwmult?none=mmcu?msp430c412
-MULTILIB_MATCHES   += mhwmult?none=mmcu?msp430c413
-MULTILIB_MATCHES   += mhwmult?none=mmcu?msp430e112
-MULTILIB_MATCHES   += mhwmult?none=mmcu?msp430e313
-MULTILIB_MATCHES   += mhwmult?none=mmcu?msp430e315
-MULTILIB_MATCHES   += mhwmult?none=mmcu?msp430e325
-MULTILIB_MATCHES   += mhwmult?none=mmcu?msp430f110
-MULTILIB_MATCHES   += mhwmult?none=mmcu?msp430f1101
-MULTILIB_MATCHES   += mhwmult?none=mmcu?msp430f1101a
-MULTILIB_MATCHES   += mhwmult?none=mmcu?msp430f1111
-MULTILIB_MATCHES   += mhwmult?none=mmcu?msp430f1111a
-MULTILIB_MATCHES   += mhwmult?none=mmcu?msp430f112
-MULTILIB_MATCHES   += mhwmult?none=mmcu?msp430f1121
-MULTILIB_MATCHES   += mhwmult?none=mmcu?msp430f1121a
-MULTILIB_MATCHES   += mhwmult?none=mmcu?msp430f1122
-MULTILIB_MATCHES   += mhwmult?none=mmcu?msp430f1132
-MULTILIB_MATCHES   += mhwmult?none=mmcu?msp430f122
-MULTILIB_MATCHES   += mhwmult?none=mmcu?msp430f1222
-MULTILIB_MATCHES   += mhwmult?none=mmcu?msp430f123
-MULTILIB_MATCHES   += mhwmult?none=mmcu?msp430f1232
-MULTILIB_MATCHES   += mhwmult?none=mmcu?msp430f133
-MULTILIB_MATCHES   += mhwmult?none=mmcu?msp430f135
-MULTILIB_MATCHES   += mhwmult?none=mmcu?msp430f155
-MULTILIB_MATCHES   += mhwmult?none=mmcu?msp430f156
-MULTILIB_MATCHES   += mhwmult?none=mmcu?msp430f157
-MULTILIB_MATCHES   += mhwmult?none=mmcu?msp430f2001
-MULTILIB_MATCHES   += mhwmult?none=mmcu?msp430f2002
-MULTILIB_MATCHES   += mhwmult?none=mmcu?msp430f2003
-MULTILIB_MATCHES   += mhwmult?none=mmcu?msp430f2011
-MULTILIB_MATCHES   += mhwmult?none=mmcu?msp430f2012
-MULTILIB_MATCHES   += mhwmult?none=mmcu?msp430f2013
-MULTILIB_MATCHES   += mhwmult?none=mmcu?msp430f2101
-MULTILIB_MATCHES   += mhwmult?none=mmcu?msp430f2111
-MULTILIB_MATCHES   += mhwmult?none=mmcu?msp430f2112
-MULTILIB_MATCHES   += mhwmult?none=mmcu?msp430f2121
-MULTILIB_MATCHES   += mhwmult?none=mmcu?msp430f2122
-MULTILIB_MATCHES   += mhwmult?none=mmcu?msp430f2131
-MULTILIB_MATCHES   += mhwmult?none=mmcu?msp430f2132
-MULTILIB_MATCHES   += mhwmult?none=mmcu?msp430f2232
-MULTILIB_MATCHES   += mhwmult?none=mmcu?msp430f2234
-MULTILIB_MATCHES   += mhwmult?none=mmcu?msp430f2252
-MULTILIB_MATCHES   += mhwmult?none=mmcu?msp430f2254
-MULTILIB_MATCHES   += mhwmult?none=mmcu?msp430f2272
-MULTILIB_MATCHES   += mhwmult?none=mmcu?msp430f2274
-MULTILIB_MATCHES   += mhwmult?none=mmcu?msp430f412
-MULTILIB_MATCHES   += mhwmult?none=mmcu?msp430f413
-MULTILIB_MATCHES   += mhwmult?none=mmcu?msp430f4132
-MULTILIB_MATCHES   += mhwmult?none=mmcu?msp430f415
-MULTILIB_MATCHES   += mhwmult?none=mmcu?msp430f4152
-MULTILIB_MATCHES   += mhwmult?none=mmcu?msp430f417
-MULTILIB_MATCHES   += mhwmult?none=mmcu?msp430f4250
-MULTILIB_MATCHES   += mhwmult?none=mmcu?msp430f4260
-MULTILIB_MATCHES   += mhwmult?none=mmcu?msp430f4270
-MULTILIB_MATCHES   += mhwmult?none=mmcu?msp430f435
-MULTILIB_MATCHES   += mhwmult?none=mmcu?msp430f4351
-MULTILIB_MATCHES   += mhwmult?none=mmcu?msp430f436
-MULTILIB_MATCHES   += mhwmult?none=mmcu?msp430f4361
-MULTILIB_MATCHES   += mhwmult?none=mmcu?msp430f437
-MULTILIB_MATCHES   += mhwmult?none=mmcu?msp430f4371
-MULTILIB_MATCHES   += mhwmult?none=mmcu?msp430f438
-MULTILIB_MATCHES   += mhwmult?none=mmcu?msp430f439
-MULTILIB_MATCHES   += mhwmult?none=mmcu?msp430f477
-MULTILIB_MATCHES   += mhwmult?none=mmcu?msp430f478
-MULTILIB_MATCHES   += mhwmult?none=mmcu?msp430f479
-MULTILIB_MATCHES   += mhwmult?none=mmcu?msp430fe423
-MULTILIB_MATCHES   += mhwmult?none=mmcu?msp430fe4232
-MULTILIB_MATCHES   += mhwmult?none=mmcu?msp430fe423a
-MULTILIB_MATCHES   += mhwmult?none=mmcu?msp430fe4242
-MULTILIB_MATCHES   += mhwmult?none=mmcu?msp430fe425
-MULTILIB_MATCHES   += mhwmult?none=mmcu?msp430fe4252
-MULTILIB_MATCHES   += mhwmult?none=mmcu?msp430fe425a
-MULTILIB_MATCHES   += mhwmult?none=mmcu?msp430fe427
-MULTILIB_MATCHES   += mhwmult?none=mmcu?msp430fe4272
-MULTILIB_MATCHES   += mhwmult?none=mmcu?msp430fe427a
-MULTILIB_MATCHES   += mhwmult?none=mmcu?msp430fg4250
-MULTILIB_MATCHES   += mhwmult?none=mmcu?msp430fg4260
-MULTILIB_MATCHES   += mhwmult?none=mmcu?msp430fg4270
-MULTILIB_MATCHES   += mhwmult?none=mmcu?msp430fg437
-MULTILIB_MATCHES   += mhwmult?none=mmcu?msp430fg438
-MULTILIB_MATCHES   += mhwmult?none=mmcu?msp430fg439
-MULTILIB_MATCHES   += mhwmult?none=mmcu?msp430fg477
-MULTILIB_MATCHES   += mhwmult?none=mmcu?msp430fg478
-MULTILIB_MATCHES   += mhwmult?none=mmcu?msp430fg479
-MULTILIB_MATCHES   += mhwmult?none=mmcu?msp430fr2032
-MULTILIB_MATCHES   += mhwmult?none=mmcu?msp430fr2033
-MULTILIB_MATCHES   += mhwmult?none=mmcu?msp430fr4131
-MULTILIB_MATCHES   += mhwmult?none=mmcu?msp430fr4132
-MULTILIB_MATCHES   += mhwmult?none=mmcu?msp430fr4133
-MULTILIB_MATCHES   += mhwmult?none=mmcu?msp430fw423
-MULTILIB_MATCHES   += mhwmult?none=mmcu?msp430fw425
-MULTILIB_MATCHES   += mhwmult?none=mmcu?msp430fw427
-MULTILIB_MATCHES   += mhwmult?none=mmcu?msp430fw428
-MULTILIB_MATCHES   += mhwmult?none=mmcu?msp430fw429
-MULTILIB_MATCHES   += mhwmult?none=mmcu?msp430g2001
-MULTILIB_MATCHES   += mhwmult?none=mmcu?msp430g2101
-MULTILIB_MATCHES   += mhwmult?none=mmcu?msp430g2102
-MULTILIB_MATCHES   += mhwmult?none=mmcu?msp430g2111
-MULTILIB_MATCHES   += mhwmult?none=mmcu?msp430g2112
-MULTILIB_MATCHES   += mhwmult?none=mmcu?msp430g2113
-MULTILIB_MATCHES   += mhwmult?none=mmcu?msp430g2121
-MULTILIB_MATCHES   += mhwmult?none=mmcu?msp430g2131
-MULTILIB_MATCHES   += mhwmult?none=mmcu?msp430g2132
-MULTILIB_MATCHES   += mhwmult?none=mmcu?msp430g2152
-MULTILIB_MATCHES   += mhwmult?none=mmcu?msp430g2153
-MULTILIB_MATCHES   += mhwmult?none=mmcu?msp430g2201
-MULTILIB_MATCHES   += mhwmult?none=mmcu?msp430g2202
-MULTILIB_MATCHES   += mhwmult?none=mmcu?msp430g2203
-MULTILIB_MATCHES   += mhwmult?none=mmcu?msp430g2210
-MULTILIB_MATCHES   += mhwmult?none=mmcu?msp430g2211
-MULTILIB_MATCHES   += mhwmult?none=mmcu?msp430g2212
-MULTILIB_MATCHES   += mhwmult?none=mmcu?msp430g2213
-MULTILIB_MATCHES   += mhwmult?none=mmcu?msp430g2221
-MULTILIB_MATCHES   += mhwmult?none=mmcu?msp430g2230
-MULTILIB_MATCHES   += mhwmult?none=mmcu?msp430g2231
-MULTILIB_MATCHES   += mhwmult?none=mmcu?msp430g2232
-MULTILIB_MATCHES   += mhwmult?none=mmcu?msp430g2233
-MULTILIB_MATCHES   += mhwmult?none=mmcu?msp430g2252
-MULTILIB_MATCHES   += mhwmult?none=mmcu?msp430g2253
-MULTILIB_MATCHES   += mhwmult?none=mmcu?msp430g2302
-MULTILIB_MATCHES   += mhwmult?none=mmcu?msp430g2303
-MULTILIB_MATCHES   += mhwmult?none=mmcu?msp430g2312
-MULTILIB_MATCHES   += mhwmult?none=mmcu?msp430g2313
-MULTILIB_MATCHES   += mhwmult?none=mmcu?msp430g2332
-MULTILIB_MATCHES   += mhwmult?none=mmcu?msp430g2333
-MULTILIB_MATCHES   += mhwmult?none=mmcu?msp430g2352
-MULTILIB_MATCHES   += mhwmult?none=mmcu?msp430g2353
-MULTILIB_MATCHES   += mhwmult?none=mmcu?msp430g2402
-MULTILIB_MATCHES   += mhwmult?none=mmcu?msp430g2403
-MULTILIB_MATCHES   += mhwmult?none=mmcu?msp430g2412
-MULTILIB_MATCHES   += mhwmult?none=mmcu?msp430g2413
-MULTILIB_MATCHES   += mhwmult?none=mmcu?msp430g2432
-MULTILIB_MATCHES   += mhwmult?none=mmcu?msp430g2433
-MULTILIB_MATCHES   += mhwmult?none=mmcu?msp430g2444
-MULTILIB_MATCHES   += mhwmult?none=mmcu?msp430g2452
-MULTILIB_MATCHES   += mhwmult?none=mmcu?msp430g2453
-MULTILIB_MATCHES   += mhwmult?none=mmcu?msp430g2513
-MULTILIB_MATCHES   += mhwmult?none=mmcu?msp430g2533
-MULTILIB_MATCHES   += mhwmult?none=mmcu?msp430g2544
-MULTILIB_MATCHES   += mhwmult?none=mmcu?msp430g2553
-MULTILIB_MATCHES   += mhwmult?none=mmcu?msp430g2744
-MULTILIB_MATCHES   += mhwmult?none=mmcu?msp430g2755
-MULTILIB_MATCHES   += mhwmult?none=mmcu?msp430g2855
-MULTILIB_MATCHES   += mhwmult?none=mmcu?msp430g2955
-MULTILIB_MATCHES   += mhwmult?none=mmcu?msp430l092
-MULTILIB_MATCHES   += mhwmult?none=mmcu?msp430p112
-MULTILIB_MATCHES   += mhwmult?none=mmcu?msp430p313
-MULTILIB_MATCHES   += mhwmult?none=mmcu?msp430p315
-MULTILIB_MATCHES   += mhwmult?none=mmcu?msp430p315s
-MULTILIB_MATCHES   += mhwmult?none=mmcu?msp430p325
-MULTILIB_MATCHES   += mhwmult?none=mmcu?msp430tch5e
-MULTILIB_MATCHES   += mhwmult?none=mmcu?rf430frl152h
-MULTILIB_MATCHES   += mhwmult?none=mmcu?rf430frl152h_rom
-MULTILIB_MATCHES   += mhwmult?none=mmcu?rf430frl153h
-MULTILIB_MATCHES   += mhwmult?none=mmcu?rf430frl153h_rom
-MULTILIB_MATCHES   += mhwmult?none=mmcu?rf430frl154h
-MULTILIB_MATCHES   += mhwmult?none=mmcu?rf430frl154h_rom
-
-MULTILIB_MATCHES   += mhwmult?32bit=mmcu?msp430f47126
-MULTILIB_MATCHES   += mhwmult?32bit=mmcu?msp430f47127
-MULTILIB_MATCHES   += mhwmult?32bit=mmcu?msp430f47163
-MULTILIB_MATCHES   += mhwmult?32bit=mmcu?msp430f47166
-MULTILIB_MATCHES   += mhwmult?32bit=mmcu?msp430f47167
-MULTILIB_MATCHES   += mhwmult?32bit=mmcu?msp430f47173
-MULTILIB_MATCHES   += mhwmult?32bit=mmcu?msp430f47176
-MULTILIB_MATCHES   += mhwmult?32bit=mmcu?msp430f47177
-MULTILIB_MATCHES   += mhwmult?32bit=mmcu?msp430f47183
-MULTILIB_MATCHES   += mhwmult?32bit=mmcu?msp430f47186
-MULTILIB_MATCHES   += mhwmult?32bit=mmcu?msp430f47187
-MULTILIB_MATCHES   += mhwmult?32bit=mmcu?msp430f47193
-MULTILIB_MATCHES   += mhwmult?32bit=mmcu?msp430f47196
-MULTILIB_MATCHES   += mhwmult?32bit=mmcu?msp430f47197
-MULTILIB_MATCHES   += mhwmult?32bit=mmcu?msp430f4783
-MULTILIB_MATCHES   += mhwmult?32bit=mmcu?msp430f4784
-MULTILIB_MATCHES   += mhwmult?32bit=mmcu?msp430f4793
-MULTILIB_MATCHES   += mhwmult?32bit=mmcu?msp430f4794
-
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?cc430f5123
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?cc430f5125
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?cc430f5133
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?cc430f5135
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?cc430f5137
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?cc430f5143
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?cc430f5145
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?cc430f5147
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?cc430f6125
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?cc430f6126
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?cc430f6127
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?cc430f6135
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?cc430f6137
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?cc430f6143
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?cc430f6145
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?cc430f6147
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?msp430bt5190
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?msp430f5131
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?msp430f5132
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?msp430f5151
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?msp430f5152
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?msp430f5171
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?msp430f5172
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?msp430f5212
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?msp430f5213
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?msp430f5214
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?msp430f5217
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?msp430f5218
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?msp430f5219
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?msp430f5222
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?msp430f5223
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?msp430f5224
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?msp430f5227
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?msp430f5228
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?msp430f5229
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?msp430f5232
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?msp430f5234
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?msp430f5237
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?msp430f5239
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?msp430f5242
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?msp430f5244
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?msp430f5247
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?msp430f5249
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?msp430f5252
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?msp430f5253
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?msp430f5254
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?msp430f5255
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?msp430f5256
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?msp430f5257
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?msp430f5258
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?msp430f5259
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?msp430f5304
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?msp430f5308
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?msp430f5309
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?msp430f5310
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?msp430f5324
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?msp430f5325
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?msp430f5326
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?msp430f5327
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?msp430f5328
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?msp430f5329
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?msp430f5333
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?msp430f5335
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?msp430f5336
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?msp430f5338
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?msp430f5340
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?msp430f5341
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?msp430f5342
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?msp430f5358
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?msp430f5359
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?msp430f5418
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?msp430f5418a
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?msp430f5419
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?msp430f5419a
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?msp430f5435
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?msp430f5435a
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?msp430f5436
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?msp430f5436a
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?msp430f5437
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?msp430f5437a
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?msp430f5438
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?msp430f5438a
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?msp430f5500
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?msp430f5501
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?msp430f5502
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?msp430f5503
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?msp430f5504
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?msp430f5505
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?msp430f5506
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?msp430f5507
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?msp430f5508
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?msp430f5509
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?msp430f5510
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?msp430f5513
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?msp430f5514
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?msp430f5515
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?msp430f5517
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?msp430f5519
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?msp430f5521
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?msp430f5522
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?msp430f5524
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?msp430f5525
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?msp430f5526
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?msp430f5527
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?msp430f5528
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?msp430f5529
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?msp430f5630
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?msp430f5631
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?msp430f5632
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?msp430f5633
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?msp430f5634
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?msp430f5635
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?msp430f5636
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?msp430f5637
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?msp430f5638
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?msp430f5658
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?msp430f5659
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?msp430f5xx_6xxgeneric
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?msp430f6433
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?msp430f6435
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?msp430f6436
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?msp430f6438
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?msp430f6458
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?msp430f6459
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?msp430f6630
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?msp430f6631
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?msp430f6632
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?msp430f6633
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?msp430f6634
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?msp430f6635
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?msp430f6636
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?msp430f6637
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?msp430f6638
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?msp430f6658
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?msp430f6659
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?msp430f6720
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?msp430f6720a
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?msp430f6721
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?msp430f6721a
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?msp430f6723
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?msp430f6723a
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?msp430f6724
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?msp430f6724a
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?msp430f6725
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?msp430f6725a
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?msp430f6726
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?msp430f6726a
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?msp430f6730
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?msp430f6730a
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?msp430f6731
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?msp430f6731a
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?msp430f6733
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?msp430f6733a
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?msp430f6734
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?msp430f6734a
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?msp430f6735
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?msp430f6735a
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?msp430f6736
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?msp430f6736a
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?msp430f6745
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?msp430f67451
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?msp430f67451a
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?msp430f6745a
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?msp430f6746
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?msp430f67461
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?msp430f67461a
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?msp430f6746a
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?msp430f6747
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?msp430f67471
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?msp430f67471a
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?msp430f6747a
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?msp430f6748
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?msp430f67481
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?msp430f67481a
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?msp430f6748a
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?msp430f6749
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?msp430f67491
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?msp430f67491a
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?msp430f6749a
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?msp430f67621
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?msp430f67621a
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?msp430f67641
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?msp430f67641a
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?msp430f6765
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?msp430f67651
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?msp430f67651a
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?msp430f6765a
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?msp430f6766
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?msp430f67661
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?msp430f67661a
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?msp430f6766a
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?msp430f6767
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?msp430f67671
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?msp430f67671a
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?msp430f6767a
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?msp430f6768
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?msp430f67681
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?msp430f67681a
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?msp430f6768a
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?msp430f6769
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?msp430f67691
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?msp430f67691a
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?msp430f6769a
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?msp430f6775
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?msp430f67751
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?msp430f67751a
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?msp430f6775a
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?msp430f6776
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?msp430f67761
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?msp430f67761a
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?msp430f6776a
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?msp430f6777
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?msp430f67771
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?msp430f67771a
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?msp430f6777a
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?msp430f6778
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?msp430f67781
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?msp430f67781a
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?msp430f6778a
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?msp430f6779
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?msp430f67791
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?msp430f67791a
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?msp430f6779a
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?msp430fg6425
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?msp430fg6426
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?msp430fg6625
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?msp430fg6626
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?msp430fr2433
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?msp430fr2xx_4xxgeneric
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?msp430fr5720
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?msp430fr5721
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?msp430fr5722
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?msp430fr5723
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?msp430fr5724
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?msp430fr5725
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?msp430fr5726
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?msp430fr5727
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?msp430fr5728
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?msp430fr5729
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?msp430fr5730
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?msp430fr5731
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?msp430fr5732
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?msp430fr5733
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?msp430fr5734
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?msp430fr5735
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?msp430fr5736
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?msp430fr5737
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?msp430fr5738
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?msp430fr5739
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?msp430fr57xxgeneric
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?msp430fr5847
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?msp430fr58471
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?msp430fr5848
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?msp430fr5849
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?msp430fr5857
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?msp430fr5858
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?msp430fr5859
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?msp430fr5867
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?msp430fr58671
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?msp430fr5868
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?msp430fr5869
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?msp430fr5870
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?msp430fr5872
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?msp430fr58721
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?msp430fr5887
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?msp430fr5888
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?msp430fr5889
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?msp430fr58891
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?msp430fr5922
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?msp430fr59221
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?msp430fr5947
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?msp430fr59471
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?msp430fr5948
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?msp430fr5949
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?msp430fr5957
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?msp430fr5958
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?msp430fr5959
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?msp430fr5967
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?msp430fr5968
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?msp430fr5969
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?msp430fr59691
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?msp430fr5970
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?msp430fr5972
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?msp430fr59721
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?msp430fr5986
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?msp430fr5987
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?msp430fr5988
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?msp430fr5989
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?msp430fr59891
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?msp430fr5xx_6xxgeneric
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?msp430fr6820
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?msp430fr6822
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?msp430fr68221
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?msp430fr6870
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?msp430fr6872
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?msp430fr68721
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?msp430fr6877
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?msp430fr6879
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?msp430fr68791
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?msp430fr6887
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?msp430fr6888
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?msp430fr6889
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?msp430fr68891
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?msp430fr6920
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?msp430fr6922
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?msp430fr69221
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?msp430fr6927
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?msp430fr69271
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?msp430fr6928
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?msp430fr6970
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?msp430fr6972
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?msp430fr69721
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?msp430fr6977
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?msp430fr6979
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?msp430fr69791
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?msp430fr6987
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?msp430fr6988
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?msp430fr6989
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?msp430fr69891
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?msp430sl5438a
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?msp430xgeneric
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?rf430f5144
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?rf430f5155
-MULTILIB_MATCHES   += mhwmult?f5series=mmcu?rf430f5175
-
-# FIXME: There are a whole bunch of exceptions to these matches that
-#  could be added here as well...
-
-
 MULTILIB_EXTRA_OPTS =
 
 msp430-c.o: $(srcdir)/config/msp430/msp430-c.c $(RTL_H) $(TREE_H) $(CONFIG_H) $(TM_H)
index 3138c7d946eab1ceef28ea67110e6d852a451046..9ce37bbbb44c9645db4010fe98f150ba46f5be30 100644 (file)
@@ -845,6 +845,7 @@ Objective-C and Objective-C++ Dialects}.
 
 @emph{MSP430 Options}
 @gccoptlist{-msim -masm-hex -mmcu= -mcpu= -mlarge -msmall -mrelax @gol
+-mwarn-mcu @gol
 -mcode-region= -mdata-region= @gol
 -msilicon-errata= -msilicon-errata-warn= @gol
 -mhwmult= -minrt}
@@ -18510,6 +18511,16 @@ cause the linker to search for a script called @file{xxx.ld}.
 
 This option is also passed on to the assembler.
 
+@item -mwarn-mcu
+@itemx -mno-warn-mcu
+@opindex mwarn-mcu
+@opindex mno-warn-mcu
+This option enables or disables warnings about conflicts between the
+MCU name specified by the @option{-mmcu} option and the ISA set by the
+@option{-mcpu} option and/or the hardware multiply support set by the
+@option{-mhwmult} option.  It also toggles warnings about unrecognised
+MCU names.  This option is on by default.
+
 @item -mcpu=
 @opindex mcpu=
 Specifies the ISA to use.  Accepted values are @samp{msp430},
@@ -18544,10 +18555,9 @@ for the original 16-bit-only multiply supported by early MCUs.
 @samp{f5series} for the 16/32-bit multiply supported by F5-series MCUs.
 A value of @samp{auto} can also be given.  This tells GCC to deduce
 the hardware multiply support based upon the MCU name provided by the
-@option{-mmcu} option.  If no @option{-mmcu} option is specified then
-@samp{32bit} hardware multiply support is assumed.  If the MCU name is
-not recognised then no hardware multiply support is assumed.
-@code{auto} is the default setting.
+@option{-mmcu} option.  If no @option{-mmcu} option is specified or if
+the MCU name is not recognised then no hardware multiply support is
+assumed.  @code{auto} is the default setting.
 
 Hardware multiplies are normally performed by calling a library
 routine.  This saves space in the generated code.  When compiling at
index b36591a1847606d782eb4d556edaa1f5f9e86e7a..2f73100ddafefa94b79558b02d422055c1ff367f 100644 (file)
@@ -1,3 +1,12 @@
+2015-11-25  Nick Clifton  <nickc@redhat.com>
+
+       * gcc.target/msp430/msp_abi_div_funcs.c: New test.
+       * gcc.target/msp430/mul_main.h: New test support file.
+       * gcc.target/msp430/mul_none.c: New test.
+       * gcc.target/msp430/mul_16bit.c: New test.
+       * gcc.target/msp430/mul_32bit.c: New test.
+       * gcc.target/msp430/mul_f5.c: New test.
+
 2015-12-04  Jakub Jelinek  <jakub@redhat.com>
 
        PR tree-optimization/68680
index ca2e102bba01b2e15f37be471302d2c351996ec2..2b9c9a9521715fa9118ecb6aeebe16410612a5d6 100644 (file)
@@ -5,4 +5,4 @@
 
 #define _GNU_SOURCE    /* { dg-warning "redefined" } */
 
-/* { dg-message "" "#define _GNU_SOURCE" {target *-*-* } 0 }
+/* { dg-message "" "#define _GNU_SOURCE" {target *-*-* } 0 } */
diff --git a/gcc/testsuite/gcc.target/msp430/msp_abi_div_funcs.c b/gcc/testsuite/gcc.target/msp430/msp_abi_div_funcs.c
new file mode 100644 (file)
index 0000000..c125ac6
--- /dev/null
@@ -0,0 +1,150 @@
+/* { dg-do run } */
+/* { dg-options "-std=c99" } */
+
+extern int printf (const char *, ...);
+extern void abort (void) __attribute__((noreturn));
+
+typedef unsigned long uint32;
+typedef unsigned long long uint64;
+
+extern uint32 __mspabi_divul (uint32, uint32);
+extern uint32 __mspabi_divlu (uint32, uint32);
+extern uint64 __mspabi_divull (uint64, uint64);
+extern uint64 __mspabi_divllu (uint64, uint64);
+
+uint32 func1 (uint32, uint32) __attribute__ ((noinline));
+uint32 func2 (uint32, uint32) __attribute__ ((noinline));
+uint32 func3 (uint32, uint32) __attribute__ ((noinline));
+uint64 func4 (uint64, uint64) __attribute__ ((noinline));
+uint64 func5 (uint64, uint64) __attribute__ ((noinline));
+uint64 func6 (uint64, uint64) __attribute__ ((noinline));
+
+
+#define DEBUG 0
+
+int
+main (void)
+{
+  int fail = 0;
+
+  if (func1 (7UL, 3UL) != 2UL)
+    {
+#if DEBUG
+      printf ("FAIL: func1: 7 / 3 returns %lu\n", func1 (7UL, 3UL));
+#endif
+      ++ fail;
+    }
+
+  if (func2 (7UL, 3UL) != 2UL)
+    {
+#if DEBUG
+      printf ("FAIL: func2: 7 / 3 returns %lu\n", func2 (7UL, 3UL));
+#endif
+      ++ fail;
+    }
+
+  if (func3 (7UL, 3UL) != 2UL)
+    {
+#if DEBUG
+      printf ("FAIL: func4: 7 / 3 returns %lu\n", func3 (7UL, 3UL));
+#endif
+      ++ fail;
+    }
+
+  if (func4 (7ULL, 3ULL) != 2ULL)
+    {
+#if DEBUG
+      printf ("FAIL: func4: 7 / 3 returns %llu\n", func4 (7ULL, 3ULL));
+#endif
+      ++ fail;
+    }
+
+  if (func5 (7ULL, 3ULL) != 2ULL)
+    {
+#if DEBUG
+      printf ("FAIL: func5: 7 / 3 returns %llu\n", func5 (7ULL, 3ULL));
+#endif
+      ++ fail;
+    }
+
+  if (func6 (7ULL, 3ULL) != 2ULL)
+    {
+#if DEBUG
+      printf ("FAIL: func6: 7 / 3 returns %llu\n", func6 (7ULL, 3ULL));
+#endif
+      ++ fail;
+    }
+
+  if (fail)
+    abort ();
+
+  return 0;
+}
+
+/* At high levels of optimization gcc will probably fold func1 and func4 into
+   main, but this does not really matter.  Those two functions are just there
+   for a sanity check at low levels of optimization.  */
+                             
+uint32 func1 (uint32 a, uint32 b) { return a / b; }
+uint32 func2 (uint32 a, uint32 b) { return __mspabi_divul (a, b); }
+uint32 func3 (uint32 a, uint32 b) { return __mspabi_divlu (a, b); }
+uint64 func4 (uint64 a, uint64 b) { return a / b; }
+uint64 func5 (uint64 a, uint64 b) { return __mspabi_divull (a, b); }
+
+uint64
+func6 (uint64 a, uint64 b)
+{
+  uint64 ret;
+
+  /* This test function is special.  The correctly spelt ABI function
+     __mspabi_divull takes its first argument in registers R8::R11 and its
+     second argument in registers R12::R15, but GCC knows that __mspabi_divllu
+     is not the correct spelling and so it will use the normal function
+     calling convention - first argument in R12::R15, second argument on the
+     stack.
+     
+     The stub function for __mspabi_divllu in libgcc just does a BRAnch to
+     the real __mspabi_divull function - it does *not* rearrange the arguments
+     or pull anything off the stack.  This is correct, because in real code
+     that calls __mspabi_divllu, compiled by *old* versions of gcc, the
+     arguments will already be in the special ABI mandated locations.
+
+     As a result, in order to test __mspabi_divllu here, we have to put the
+     arguments into the correct registers ourselves and call __mspabi_divllu
+     manually.  This does lead to some very inefficient code generation, but
+     that is not our concern here.  */
+
+#ifdef __MSP430X_LARGE__
+  __asm ("mov  %A1, r8\n\
+        mov  %B1, r9\n\
+        mov  %C1, r10\n\
+        mov  %D1, r11\n\
+        mov  %A2, r12\n\
+        mov  %B2, r13\n\
+        mov  %C2, r14\n\
+        mov  %D2, r15\n\
+        calla #__mspabi_divllu\n\
+        mov  r12, %A0\n\
+        mov  r13, %B0\n\
+        mov  r14, %C0\n\
+        mov  r15, %D0\n"
+            : "=r" (ret) : "r" (a), "m" (b));
+#else
+  __asm ("mov  %A1, r8\n\
+        mov  %B1, r9\n\
+        mov  %C1, r10\n\
+        mov  %D1, r11\n\
+        mov  %A2, r12\n\
+        mov  %B2, r13\n\
+        mov  %C2, r14\n\
+        mov  %D2, r15\n\
+        call #__mspabi_divllu\n\
+        mov  r12, %A0\n\
+        mov  r13, %B0\n\
+        mov  r14, %C0\n\
+        mov  r15, %D0\n"
+            : "=r" (ret) : "r" (a), "m" (b));
+#endif
+
+  return ret;
+}
diff --git a/gcc/testsuite/gcc.target/msp430/mul_16bit.c b/gcc/testsuite/gcc.target/msp430/mul_16bit.c
new file mode 100644 (file)
index 0000000..772b1e8
--- /dev/null
@@ -0,0 +1,4 @@
+/* { dg-do run } */
+/* { dg-options "-mhwmult=16bit" } */
+
+#include "mul_main.h"
diff --git a/gcc/testsuite/gcc.target/msp430/mul_32bit.c b/gcc/testsuite/gcc.target/msp430/mul_32bit.c
new file mode 100644 (file)
index 0000000..36d1d92
--- /dev/null
@@ -0,0 +1,4 @@
+/* { dg-do run } */
+/* { dg-options "-mhwmult=32bit" } */
+
+#include "mul_main.h"
diff --git a/gcc/testsuite/gcc.target/msp430/mul_f5.c b/gcc/testsuite/gcc.target/msp430/mul_f5.c
new file mode 100644 (file)
index 0000000..ac58afb
--- /dev/null
@@ -0,0 +1,4 @@
+/* { dg-do run } */
+/* { dg-options "-mhwmult=f5series" } */
+
+#include "mul_main.h"
diff --git a/gcc/testsuite/gcc.target/msp430/mul_main.h b/gcc/testsuite/gcc.target/msp430/mul_main.h
new file mode 100644 (file)
index 0000000..b45059d
--- /dev/null
@@ -0,0 +1,83 @@
+extern void abort (void) __attribute__((noreturn));
+extern int printf (const char *, ...);
+
+int func1 (int, int) __attribute__((noinline));
+long func2 (int, int)  __attribute__((noinline));
+long func3 (long, long)  __attribute__((noinline));
+long long func4 (long, long)  __attribute__((noinline));
+long long func5 (long long, long long)  __attribute__((noinline));
+unsigned long func6 (unsigned int, unsigned int)  __attribute__((noinline));
+unsigned long long func7 (unsigned long, unsigned long)  __attribute__((noinline));
+
+#define DEBUG 0
+
+int
+main (void)
+{
+  if (func1 (6, 7) != 42)
+    {
+#if DEBUG
+      printf ("test1 fail: 6 * 7 = %d!\n", func1 (6, 7));
+#endif
+      abort ();
+    }
+
+  if (func2 (1000, 1000) != 1000000L)
+    {
+#if DEBUG
+      printf ("test2 fail: 1000 * 1000 = %ld!\n", func2 (1000, 1000));
+#endif
+      abort ();
+    }
+
+  if (func3 (70000L, -32L) != -2240000L)
+    {
+#if DEBUG
+      printf ("test3 fail: 70000 * -32 = %ld!\n", func3 (70000L, -32L));
+#endif
+      abort ();
+    }
+
+  if (func4 (-40L, -80L) != 3200LL)
+    {
+#if DEBUG
+      printf ("test4 fail: -40 * -80 = %lld!\n", func4 (-40L, -80L));
+#endif
+      abort ();
+    }
+
+  if (func5(9LL, 9LL) != 81LL)
+    {
+#if DEBUG
+      printf ("test5 fail: 9 * 9 = %lld!\n", func5 (9LL, 9LL));
+#endif
+      abort ();
+    }
+
+  if (func6 (-2U, 8U) != 524272LU)
+    {
+#if DEBUG
+      printf ("test6 fail: -2 * 8 = %lu!\n", func6 (-2U, 8U));
+#endif
+      abort ();
+    }
+
+  if (func7 (99UL, 101UL) != 9999LLU)
+    {
+#if DEBUG
+      printf ("test7 fail: 99 * 101 = %llu!\n", func7 (99UL, 101UL));
+#endif
+      abort ();
+    }
+  
+  return 0;
+}
+
+int func1 (int a, int b) { return a * b; }
+long func2 (int a, int b) { return (long) a * (long) b; }
+long func3 (long a, long b) { return a * b; }
+long long func4 (long a, long b) { return (long long) a * (long long) b; }
+long long func5 (long long a, long long b) { return a * b; }
+unsigned long func6 (unsigned int a, unsigned int b) { return (unsigned long) a * (unsigned long) b; }
+unsigned long long func7 (unsigned long a, unsigned long b) { return (unsigned long long) a * (unsigned long long) b; }
+
diff --git a/gcc/testsuite/gcc.target/msp430/mul_none.c b/gcc/testsuite/gcc.target/msp430/mul_none.c
new file mode 100644 (file)
index 0000000..d89f264
--- /dev/null
@@ -0,0 +1,5 @@
+/* { dg-do run } */
+/* { dg-options "-mhwmult=none" } */
+
+#include "mul_main.h"
+
index 8143db2222efc1390df09314f6dbd1da86573724..003971b0cdc828360a02baf06799112ee8475bb3 100644 (file)
@@ -1,3 +1,18 @@
+2015-12-04  Nick Clifton  <nickc@redhat.com>
+
+       * config/msp430/mpy.c (__mulhi3): Use a faster algorithm.
+       Allow for the second argument being negative.
+       * config.host (extra_parts): Define for MSP430.  Create separate
+       libraries for each of the hardware multiply formats.
+       * config/msp430/lib2hw_mul.S: Build only the multiply routines
+       that are needed.
+       * config/msp430/lib2mul.c: Likewise.
+       * config/msp430/t-msp430 (LIB2ADD): Remove lib2hw_mul.S.
+       Add rules to build hardware multiply libraries.
+       * config/msp430/lib2divSI.c: (__mspabi_divlu): Alias for
+       __mspabi_divul function.
+       (__mspabi_divllu): New stub function.
+
 2015-12-01  John David Anglin  <danglin@gcc.gnu.org>
 
        * config/pa/fptr.c (__canonicalize_funcptr_for_compare): Initialize
index 9a58beb78478d2596e47ffe52a46b6d032fb38f9..b16f52a54cc12298b6ef8586e747a52846fecdca 100644 (file)
@@ -942,6 +942,7 @@ moxie-*-rtems*)
        ;;
 msp430*-*-elf)
        tmake_file="$tm_file t-crtstuff t-fdpbit msp430/t-msp430"
+        extra_parts="$extra_parts libmul_none.a libmul_16.a libmul_32.a libmul_f5.a"
        ;;
 nds32*-elf*)
        # Basic makefile fragment and extra_parts for crt stuff.
index cc45c4c87ea5bed905da8419579a21f78524eef2..fa6ac4552e657988d2942c625746a146f07ddc2d 100644 (file)
@@ -40,3 +40,32 @@ typedef int           word_type     __attribute__ ((mode (__word__)));
 #define NAME_MODE      si
 
 #include "msp430-divmod.h"
+
+/* ---------------------------------------------------------------------*/
+
+/* There is a typo in the MSP430 ABI document.  It calls the unsigned
+   long integer division function __mspabi_divlu when it should be
+   __mspabi_divul.  Likewise the unsigned long long integer division
+   function is called __mspabi_divllu when it should be __mspabi_divull.
+
+   Earlier versions of this toolchain used generate the ABI compliant
+   names, so in order to support object files built with those tools
+   we provide stub functions that call the correct routines.  */
+
+asm (".global __mspabi_divlu\n\
+         .set __mspabi_divlu, __mspabi_divul");
+
+/* We cannot use the same trick for __mspabi_divllu as that is defined
+   in a different file.  Instead we create a stub here.  The cost of
+   executing the branch instruction will be trivial compared to the
+   cost of executing a long long division.  */
+
+#ifdef __MSP430X_LARGE__
+asm (".global __mspabi_divllu\n\
+      __mspabi_divllu:\n\
+           BRA #__mspabi_divull");
+#else
+asm (".global __mspabi_divllu\n\
+      __mspabi_divllu:\n\
+           BR #__mspabi_divull");
+#endif
index b686d8ec26b71f72743b34797035ff414a4c1e9f..908451d89f29635a913011e2ad03653fd88060fb 100644 (file)
 ; see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
 ; <http://www.gnu.org/licenses/>.
 
-.macro start_func name
-       .pushsection .text.\name,"ax",@progbits
+       ;;  Macro to start a multiply function.  Each function has three
+       ;; names, and hence three entry points - although they all go
+       ;; through the same code.  The first name is the version generated
+       ;; by GCC.  The second is the MSP430 EABI mandated name for the
+       ;; *software* version of the function.  The third is the EABI
+       ;; mandated name for the *hardware* version of the function.
+       ;; 
+       ;;  Since we are using the hardware and software names to point
+       ;; to the same code this effectively means that we are mapping
+       ;; the software function onto the hardware function.  Thus if
+       ;; the library containing this code is linked into an application
+       ;; (before the libgcc.a library) *all* multiply functions will
+       ;; be mapped onto the hardware versions.
+       ;;
+       ;;  We construct each function in its own section so that linker
+       ;; garbage collection can be used to delete any unused functions
+       ;; from this file.
+.macro start_func gcc_name eabi_soft_name eabi_hard_name
+       .pushsection .text.\gcc_name,"ax",@progbits
        .p2align 1
-       .global \name
-       .type \name , @function
-\name:
+       .global \eabi_hard_name
+       .type \eabi_hard_name , @function
+\eabi_hard_name:
+       .global \eabi_soft_name
+       .type \eabi_soft_name , @function
+\eabi_soft_name:
+       .global \gcc_name
+       .type \gcc_name , @function
+\gcc_name:
        PUSH.W  sr                      ; Save current interrupt state
        DINT                            ; Disable interrupts
        NOP                             ; Account for latency
 .endm
 
+
+       ;; End a function started with the start_func macro.
 .macro end_func name
 #ifdef __MSP430X_LARGE__
        POP.W  sr
        .popsection
 .endm
 
+
+       ;; Like the start_func macro except that it is used to
+       ;; create a false entry point that just jumps to the
+       ;; software function (implemented elsewhere).
+.macro fake_func gcc_name  eabi_soft_name  eabi_hard_name
+       .pushsection .text.\gcc_name,"ax",@progbits
+       .p2align 1
+       .global \eabi_hard_name
+       .type \eabi_hard_name , @function
+\eabi_hard_name:
+       .global \gcc_name
+       .type \gcc_name , @function
+\gcc_name:
+#ifdef __MSP430X_LARGE__
+       BRA     \eabi_soft_name
+#else
+       BR      \eabi_soft_name
+#endif
+       .size \gcc_name , . - \gcc_name
+       .popsection
+.endm
+
+
 .macro mult16 OP1, OP2, RESULT
 ;* * 16-bit hardware multiply:  int16 = int16 * int16
 ;*  
 .endm
 
 
-;;  First generation MSP430 hardware multiplies ....
+;; EABI mandated names:
+;; 
+;; int16 __mspabi_mpyi (int16 x, int16 y)
+;;            Multiply int by int.
+;; int16 __mspabi_mpyi_hw (int16 x, int16 y)
+;;            Multiply int by int. Uses hardware MPY16 or MPY32.
+;; int16 __mspabi_mpyi_f5hw (int16 x, int16 y)
+;;            Multiply int by int. Uses hardware MPY32 (F5xx devices and up).
+;; 
+;; int32 __mspabi_mpyl (int32 x, int32 y);
+;;           Multiply long by long.
+;; int32 __mspabi_mpyl_hw (int32 x, int32 y)
+;;           Multiply long by long. Uses hardware MPY16.
+;; int32 __mspabi_mpyl_hw32 (int32 x, int32 y)
+;;           Multiply long by long. Uses hardware MPY32 (F4xx devices).
+;; int32 __mspabi_mpyl_f5hw (int32 x, int32 y)
+;;           Multiply long by long. Uses hardware MPY32 (F5xx devices and up).
+;; 
+;; int64 __mspabi_mpyll (int64 x, int64 y)
+;;           Multiply long long by long long.
+;; int64 __mspabi_mpyll_hw (int64 x, int64 y)
+;;           Multiply long long by long long. Uses hardware MPY16.
+;; int64 __mspabi_mpyll_hw32 (int64 x, int64 y)
+;;           Multiply long long by long long. Uses hardware MPY32 (F4xx devices).
+;; int64 __mspabi_mpyll_f5hw (int64 x, int64 y)
+;;           Multiply long long by long long. Uses hardware MPY32 (F5xx devices and up).
+;;
+;; int32 __mspabi_mpysl (int16 x, int16 y)
+;;            Multiply int by int; result is long.
+;; int32 __mspabi_mpysl_hw(int16 x, int16 y)
+;;           Multiply int by int; result is long. Uses hardware MPY16 or MPY32
+;; int32 __mspabi_mpysl_f5hw(int16 x, int16 y)
+;;           Multiply int by int; result is long. Uses hardware MPY32 (F5xx devices and up).
+;; 
+;; int64 __mspabi_mpysll(int32 x, int32 y)
+;;            Multiply long by long; result is long long.
+;; int64 __mspabi_mpysll_hw(int32 x, int32 y)
+;;           Multiply long by long; result is long long. Uses hardware MPY16.
+;; int64 __mspabi_mpysll_hw32(int32 x, int32 y)
+;;           Multiply long by long; result is long long. Uses hardware MPY32 (F4xx devices).
+;; int64 __mspabi_mpysll_f5hw(int32 x, int32 y)
+;;           Multiply long by long; result is long long. Uses hardware MPY32 (F5xx devices and up).
+;; 
+;; uint32 __mspabi_mpyul(uint16 x, uint16 y)
+;;           Multiply unsigned int by unsigned int; result is unsigned long.
+;; uint32 __mspabi_mpyul_hw(uint16 x, uint16 y)
+;;           Multiply unsigned int by unsigned int; result is unsigned long. Uses hardware MPY16 or MPY32
+;; uint32 __mspabi_mpyul_f5hw(uint16 x, uint16 y)
+;;           Multiply unsigned int by unsigned int; result is unsigned long. Uses hardware MPY32 (F5xx devices and up).
+;; 
+;; uint64 __mspabi_mpyull(uint32 x, uint32 y)
+;;           Multiply unsigned long by unsigned long; result is unsigned long long.
+;; uint64 __mspabi_mpyull_hw(uint32 x, uint32 y)
+;;           Multiply unsigned long by unsigned long; result is unsigned long long. Uses hardware MPY16
+;; uint64 __mspabi_mpyull_hw32(uint32 x, uint32 y)
+;;           Multiply unsigned long by unsigned long; result is unsigned long long. Uses hardware MPY32 (F4xx devices).
+;; uint64 _ _mspabi_mpyull_f5hw(uint32 x, uint32 y)
+;;            Multiply unsigned long by unsigned long; result is unsigned long long. Uses hardware MPY32 (F5xx devices and up)
+
+
 
 .set MPY_OP1,   0x0130
 .set MPY_OP1_S, 0x0132
 .set MAC_OP2,  0x0138
 .set RESULT_LO, 0x013A
 .set RESULT_HI, 0x013C
-       
-       start_func __mulhi2
+
+#if defined MUL_16
+;;  First generation MSP430 hardware multiplies ...
+
+       start_func __mulhi2 __mspabi_mpyi  __mspabi_mpyi_hw
        mult16 MPY_OP1, MPY_OP2, RESULT_LO
-       end_func __mulhi2
+       end_func   __mulhi2
 
-       start_func __mulsihi2
+       start_func __mulsihi2  __mspabi_mpysl  __mspabi_mpysl_hw
        mult1632 MPY_OP1_S, MPY_OP2, RESULT_LO, RESULT_HI
-       end_func __mulsihi2
+       end_func   __mulsihi2
 
-       start_func __umulsihi2
+       start_func __umulsihi2  __mspabi_mpyul  _mspabi_mpyul_hw
        mult1632 MPY_OP1, MPY_OP2, RESULT_LO, RESULT_HI
-       end_func __umulsihi2
+       end_func   __umulsihi2
 
-       start_func __mulsi2
+       start_func __mulsi2  __mspabi_mpyl  __mspabi_mpyl_hw
        mult32 MPY_OP1, MPY_OP2, MAC_OP1, MAC_OP2, RESULT_LO, RESULT_HI
-       end_func __mulsi2
+       end_func   __mulsi2
 
-       start_func __mulsi2_hw32
+       ;; FIXME: We do not have hardware implementations of these
+       ;; routines, so just jump to the software versions instead.
+       fake_func __muldisi2   __mspabi_mpysll  __mspabi_mpysll_hw   
+       fake_func __umuldisi2  __mspabi_mpyull  __mspabi_mpyull_hw  
+       fake_func __muldi3     __mspabi_mpyll   __mspabi_mpyll_hw       
+
+#elif defined MUL_32
+;;  Second generation MSP430 hardware multiplies ...
+
+       start_func __mulhi2  __mspabi_mpyi  __mspabi_mpyi_hw
+       mult16 MPY_OP1, MPY_OP2, RESULT_LO
+       end_func   __mulhi2
+
+       start_func __mulsihi2  __mspabi_mpysl  __mspabi_mpysl_hw
+       mult1632 MPY_OP1_S, MPY_OP2, RESULT_LO, RESULT_HI
+       end_func   __mulsihi2
+
+       start_func __umulsihi2  __mspabi_mpyul  _mspabi_mpyul_hw
+       mult1632 MPY_OP1, MPY_OP2, RESULT_LO, RESULT_HI
+       end_func   __umulsihi2
+
+       start_func __mulsi2_hw32  __mspabi_mpyl  __mspabi_mpyl_hw32
        mult32_hw 0x0140, 0x0142, 0x0150, 0x0152, 0x0154, 0x0156
-       end_func __mulsi2_hw32
+       end_func   __mulsi2_hw32
 
-       start_func __muldisi2_hw32
+       start_func __muldisi2  __mspabi_mpysll  __mspabi_mpysll_hw32
        mult3264_hw 0x0144, 0x146, 0x0150, 0x0152, 0x0154, 0x0156, 0x0158, 0x015A
-       end_func __muldisi2_hw32
+       end_func   __muldisi2
 
-       start_func __umuldisi2_hw32
+       start_func __umuldisi2 __mspabi_mpyull  __mspabi_mpyull_hw32
        mult3264_hw 0x0140, 0x142, 0x0150, 0x0152, 0x0154, 0x0156, 0x0158, 0x015A
-       end_func __umuldisi2_hw32
-       
-/* The F5xxx series of MCUs support the same 16-bit hardware
-   multiply, but it is accessed from different memory registers.  */
+       end_func   __umuldisi2
+
+       ;; FIXME: Add a hardware version of this function.
+       fake_func __muldi3    __mspabi_mpyll  __mspabi_mpyll_hw32 
        
-       start_func __mulhi2_f5
+#elif defined MUL_F5
+/* The F5xxx series of MCUs support the same 16-bit and 32-bit multiply
+   as the second generation hardware, but they are accessed from different
+   memory registers.  */
+
+       start_func __mulhi2_f5 __mspabi_mpyi  __mspabi_mpyi_f5hw
        mult16 0x04C0, 0x04C8, 0x04CA
-       end_func __mulhi2_f5
+       end_func   __mulhi2_f5
 
-       start_func __mulsihi2_f5
+       start_func __mulsihi2  __mspabi_mpysl  __mspabi_mpysl_f5hw
        mult1632 0x04C2, 0x04C8, 0x04CA, 0x04CC
-       end_func __mulsihi2_f5
+       end_func   __mulsihi2
        
-       start_func __umulsihi2_f5
+       start_func __umulsihi2  __mspabi_mpyul  _mspabi_mpyul_f5hw
        mult1632 0x04C0, 0x04C8, 0x04CA, 0x04CC
-       end_func __umulsihi2_f5
+       end_func   __umulsihi2
 
-       start_func __mulsi2_f5
+       start_func __mulsi2_f5  __mspabi_mpyl  __mspabi_mpyl_f5hw
        mult32_hw 0x04D0, 0x04D2, 0x04E0, 0x04E2, 0x04E4, 0x04E6
-       end_func __mulsi2_f5
+       end_func   __mulsi2_f5
        
-       start_func __muldisi2_f5
+       start_func __muldisi2  __mspabi_mpysll  __mspabi_mpysll_f5hw
        mult3264_hw 0x04D4, 0x04D6, 0x04E0, 0x04E2, 0x04E4, 0x04E6, 0x04E8, 0x04EA
-       end_func __muldisi2_f5
+       end_func   __muldisi2
        
-       start_func __umuldisi2_f5
+       start_func __umuldisi2  __mspabi_mpyull  __mspabi_mpyull_f5hw
        mult3264_hw 0x04D0, 0x04D2, 0x04E0, 0x04E2, 0x04E4, 0x04E6, 0x04E8, 0x04EA
-       end_func __umuldisi2_f5
+       end_func   __umuldisi2
+
+       ;; FIXME: Add a hardware version of this function.
+       fake_func __muldi3   __mspabi_mpyll __mspabi_mpyll_f5hw 
+
+#else
+#error MUL type not defined
+#endif
index ecd3b854e6e441730f4ff25fab45f1ee491859bb..3aa0f924fa65fd49e509e2c08558e0a69c5f10da 100644 (file)
@@ -30,29 +30,44 @@ typedef unsigned int  uint08_type   __attribute__ ((mode (QI)));
 #define C3B(a,b,c) a##b##c
 #define C3(a,b,c) C3B(a,b,c)
 
+#if defined MUL_NONE
 
-#define UINT_TYPE      uint16_type
-#define BITS_MINUS_1   15
-#define NAME_MODE      hi
-
-#include "msp430-mul.h"
+/* The software multiply library needs __mspabi_mpyll.  */
 
 #undef UINT_TYPE
 #undef BITS_MINUS_1
 #undef NAME_MODE
 
-#define UINT_TYPE      uint08_type
-#define BITS_MINUS_1   7
-#define NAME_MODE      qi
+#define UINT_TYPE      uint32_type
+#define BITS_MINUS_1   31
+#define NAME_MODE      si
 
 #include "msp430-mul.h"
 
+#elif defined MUL_16
+
+signed long long
+__mspabi_mpysll (signed long a, signed long b)
+{
+  return (signed long long) a * (signed long long) b;
+}
+
+unsigned long long
+__mspabi_mpyull (unsigned long a, unsigned long b)
+{
+  return (unsigned long long) a * (unsigned long long) b;
+}
+
+#else
+
 #undef UINT_TYPE
 #undef BITS_MINUS_1
 #undef NAME_MODE
 
-#define UINT_TYPE      uint32_type
-#define BITS_MINUS_1   31
-#define NAME_MODE      si
+#define UINT_TYPE      uint08_type
+#define BITS_MINUS_1   7
+#define NAME_MODE      qi
 
 #include "msp430-mul.h"
+
+#endif /* MUL_NONE */
index 57cffd0ba2a68b5a75355759bf4c60e0d0f73652..3842d86fc356fd74966f7e59656d63e9be91e509 100644 (file)
@@ -4,12 +4,23 @@ extern int __mulhi3 (int, int);
 int
 __mulhi3 (int x, int y)
 {
-  volatile int rv = 0;
+  char bit;
+  int neg = 0;
+  int rv = 0;
 
-  while (y > 0)
+  if (y < 0)
     {
-      rv += x;
-      y --;
+      y = - y;
+      neg = 1;
     }
-  return rv;
+
+  for (bit = 0; y && bit < sizeof (y) * 8; bit ++)
+    {
+      if (y & 1)
+       rv += x;
+      x <<= 1;
+      y >>= 1;
+    }  
+
+  return neg ? - rv : rv;
 }
index 5c0cccd5b3e54e6b8a0aa97b6661bb2650de5af9..3ac995583820536cde98886abb7fb57fe4b600e2 100644 (file)
@@ -35,7 +35,6 @@ LIB2ADD = \
        $(srcdir)/config/msp430/srai.S \
        $(srcdir)/config/msp430/srli.S \
        $(srcdir)/config/msp430/cmpsi2.S \
-       $(srcdir)/config/msp430/lib2hw_mul.S \
        $(srcdir)/config/msp430/floatunhisf.c \
        $(srcdir)/config/msp430/floatunhidf.c \
        $(srcdir)/config/msp430/floathidf.c \
@@ -44,6 +43,33 @@ LIB2ADD = \
 
 HOST_LIBGCC2_CFLAGS += -Os -ffunction-sections -fdata-sections -mhwmult=none
 
+lib2_mul_none.o: $(srcdir)/config/msp430/lib2mul.c
+       $(gcc_compile) $^ -c -DMUL_NONE
+
+lib2_mul_16bit.o: $(srcdir)/config/msp430/lib2mul.c
+       $(gcc_compile) $^ -c -DMUL_16
+
+lib2hw_mul_16.o: $(srcdir)/config/msp430/lib2hw_mul.S
+       $(gcc_compile) $^ -c -DMUL_16
+
+lib2hw_mul_32.o: $(srcdir)/config/msp430/lib2hw_mul.S
+       $(gcc_compile) $^ -c -DMUL_32
+
+lib2hw_mul_f5.o: $(srcdir)/config/msp430/lib2hw_mul.S
+       $(gcc_compile) $^ -c -DMUL_F5
+
+libmul_none.a: lib2_mul_none.o
+       $(AR_CREATE_FOR_TARGET) $@ $^
+
+libmul_16.a: lib2hw_mul_16.o lib2_mul_16bit.o
+       $(AR_CREATE_FOR_TARGET) $@ $^
+
+libmul_32.a: lib2hw_mul_32.o
+       $(AR_CREATE_FOR_TARGET) $@ $^
+
+libmul_f5.a: lib2hw_mul_f5.o
+       $(AR_CREATE_FOR_TARGET) $@ $^
+
 # Local Variables:
 # mode: Makefile
 # End:
This page took 0.157153 seconds and 5 git commands to generate.