diff --git a/clang/include/clang/Basic/MSP430Target.def b/clang/include/clang/Basic/MSP430Target.def --- a/clang/include/clang/Basic/MSP430Target.def +++ b/clang/include/clang/Basic/MSP430Target.def @@ -8,238 +8,656 @@ // // This file defines the MSP430 devices and their features. // -//===----------------------------------------------------------------------===// - -#ifndef MSP430_MCU_FEAT -#define MSP430_MCU_FEAT(NAME, HWMULT) MSP430_MCU(NAME) -#endif +// This data is generated from devices.csv v1.212, dated 07/19/21, with the +// following commands: +// $ export LC_ALL=C +// $ grep "^msp430" //include/devices.csv \ +// | awk -F, -f msp430-devices.awk | sort +// +// msp430-devices.awk: +// { +// printf "MSP430_MCU(\"%s\", ", $1; +// if ($2 == 0) printf "CPUMSP430, "; +// else if ($2 == 1) printf "CPUMSP430X, "; +// else if ($2 == 2) printf "CPUMSP430XV2, "; +// +// if ($4 == 0) printf "HWMultNone"; +// else if ($4 == 1 || $4 == 2) printf "HWMult16"; +// else if ($4 == 4) printf "HWMult32"; +// else if ($4 == 8) printf "HWMultF5"; +// +// printf ")\n"; +// } +// +// The "devices.csv" file is distributed with the MSP430-GCC toolchain, +// available at: https://www.ti.com/tool/download/MSP430-GCC-OPENSOURCE. +// +// It is essential for the data to be sorted lexicographically by MCU name, as +// std::lower_bound is used to perform a binary search on the data to +// efficiently find the MCU data record. +// +// Note that the quote character " has smaller ASCII value than any alphanumeric +// characters, so sorting on the full "MSP430_MCU("name", ...)" string delivers +// the expected result. +// ===----------------------------------------------------------------------===// #ifndef MSP430_MCU -#define MSP430_MCU(NAME) +#define MSP430_MCU(NAME, CPU, HWMULT) +#define HWMultNone +#define HWMult16 +#define HWMult32 +#define HWMultF5 +#define CPUMSP430 +#define CPUMSP430X +#define CPUMSP430XV2 #endif -MSP430_MCU("msp430c111") -MSP430_MCU("msp430c1111") -MSP430_MCU("msp430c112") -MSP430_MCU("msp430c1121") -MSP430_MCU("msp430c1331") -MSP430_MCU("msp430c1351") -MSP430_MCU("msp430e112") -MSP430_MCU("msp430f110") -MSP430_MCU("msp430f1101") -MSP430_MCU("msp430f1101a") -MSP430_MCU("msp430f1111") -MSP430_MCU("msp430f1111a") -MSP430_MCU("msp430f112") -MSP430_MCU("msp430f1121") -MSP430_MCU("msp430f1121a") -MSP430_MCU("msp430f1122") -MSP430_MCU("msp430f1132") -MSP430_MCU("msp430f122") -MSP430_MCU("msp430f1222") -MSP430_MCU("msp430f123") -MSP430_MCU("msp430f1232") -MSP430_MCU("msp430f133") -MSP430_MCU("msp430f135") -MSP430_MCU("msp430f155") -MSP430_MCU("msp430f156") -MSP430_MCU("msp430f157") -MSP430_MCU("msp430p112") -MSP430_MCU("msp430f2001") -MSP430_MCU("msp430f2011") -MSP430_MCU("msp430f2002") -MSP430_MCU("msp430f2012") -MSP430_MCU("msp430f2003") -MSP430_MCU("msp430f2013") -MSP430_MCU("msp430f2101") -MSP430_MCU("msp430f2111") -MSP430_MCU("msp430f2121") -MSP430_MCU("msp430f2131") -MSP430_MCU("msp430f2112") -MSP430_MCU("msp430f2122") -MSP430_MCU("msp430f2132") -MSP430_MCU("msp430f2232") -MSP430_MCU("msp430f2252") -MSP430_MCU("msp430f2272") -MSP430_MCU("msp430f2234") -MSP430_MCU("msp430f2254") -MSP430_MCU("msp430f2274") -MSP430_MCU("msp430g2211") -MSP430_MCU("msp430g2201") -MSP430_MCU("msp430g2111") -MSP430_MCU("msp430g2101") -MSP430_MCU("msp430g2001") -MSP430_MCU("msp430g2231") -MSP430_MCU("msp430g2221") -MSP430_MCU("msp430g2131") -MSP430_MCU("msp430g2121") -MSP430_MCU("msp430g2102") -MSP430_MCU("msp430g2202") -MSP430_MCU("msp430g2302") -MSP430_MCU("msp430g2402") -MSP430_MCU("msp430g2132") -MSP430_MCU("msp430g2232") -MSP430_MCU("msp430g2332") -MSP430_MCU("msp430g2432") -MSP430_MCU("msp430g2112") -MSP430_MCU("msp430g2212") -MSP430_MCU("msp430g2312") -MSP430_MCU("msp430g2412") -MSP430_MCU("msp430g2152") -MSP430_MCU("msp430g2252") -MSP430_MCU("msp430g2352") -MSP430_MCU("msp430g2452") -MSP430_MCU("msp430g2113") -MSP430_MCU("msp430g2213") -MSP430_MCU("msp430g2313") -MSP430_MCU("msp430g2413") -MSP430_MCU("msp430g2513") -MSP430_MCU("msp430g2153") -MSP430_MCU("msp430g2253") -MSP430_MCU("msp430g2353") -MSP430_MCU("msp430g2453") -MSP430_MCU("msp430g2553") -MSP430_MCU("msp430g2203") -MSP430_MCU("msp430g2303") -MSP430_MCU("msp430g2403") -MSP430_MCU("msp430g2233") -MSP430_MCU("msp430g2333") -MSP430_MCU("msp430g2433") -MSP430_MCU("msp430g2533") -MSP430_MCU("msp430tch5e") -MSP430_MCU("msp430g2444") -MSP430_MCU("msp430g2544") -MSP430_MCU("msp430g2744") -MSP430_MCU("msp430g2755") -MSP430_MCU("msp430g2855") -MSP430_MCU("msp430g2955") -MSP430_MCU("msp430g2230") -MSP430_MCU("msp430g2210") -MSP430_MCU("msp430c311s") -MSP430_MCU("msp430c312") -MSP430_MCU("msp430c313") -MSP430_MCU("msp430c314") -MSP430_MCU("msp430c315") -MSP430_MCU("msp430c323") -MSP430_MCU("msp430c325") -MSP430_MCU("msp430c412") -MSP430_MCU("msp430c413") -MSP430_MCU("msp430e313") -MSP430_MCU("msp430e315") -MSP430_MCU("msp430e325") -MSP430_MCU("msp430p313") -MSP430_MCU("msp430p315") -MSP430_MCU("msp430p315s") -MSP430_MCU("msp430p325") -MSP430_MCU("msp430f412") -MSP430_MCU("msp430f413") -MSP430_MCU("msp430f415") -MSP430_MCU("msp430f417") -MSP430_MCU("msp430f4132") -MSP430_MCU("msp430f4152") -MSP430_MCU("msp430f435") -MSP430_MCU("msp430f436") -MSP430_MCU("msp430f437") -MSP430_MCU("msp430f4351") -MSP430_MCU("msp430f4361") -MSP430_MCU("msp430f4371") -MSP430_MCU("msp430fe423") -MSP430_MCU("msp430fe425") -MSP430_MCU("msp430fe427") -MSP430_MCU("msp430fe423a") -MSP430_MCU("msp430fe425a") -MSP430_MCU("msp430fe427a") -MSP430_MCU("msp430fe4232") -MSP430_MCU("msp430fe4242") -MSP430_MCU("msp430fe4252") -MSP430_MCU("msp430fe4272") -MSP430_MCU("msp430f4250") -MSP430_MCU("msp430f4260") -MSP430_MCU("msp430f4270") -MSP430_MCU("msp430fg4250") -MSP430_MCU("msp430fg4260") -MSP430_MCU("msp430fg4270") -MSP430_MCU("msp430fw423") -MSP430_MCU("msp430fw425") -MSP430_MCU("msp430fw427") -MSP430_MCU("msp430fw428") -MSP430_MCU("msp430fw429") -MSP430_MCU("msp430fg437") -MSP430_MCU("msp430fg438") -MSP430_MCU("msp430fg439") -MSP430_MCU("msp430f438") -MSP430_MCU("msp430f439") -MSP430_MCU("msp430f477") -MSP430_MCU("msp430f478") -MSP430_MCU("msp430f479") -MSP430_MCU("msp430fg477") -MSP430_MCU("msp430fg478") -MSP430_MCU("msp430fg479") - -// With 16-bit hardware multiplier -MSP430_MCU_FEAT("msp430f147", "16bit") -MSP430_MCU_FEAT("msp430f148", "16bit") -MSP430_MCU_FEAT("msp430f149", "16bit") -MSP430_MCU_FEAT("msp430f1471", "16bit") -MSP430_MCU_FEAT("msp430f1481", "16bit") -MSP430_MCU_FEAT("msp430f1491", "16bit") -MSP430_MCU_FEAT("msp430f167", "16bit") -MSP430_MCU_FEAT("msp430f168", "16bit") -MSP430_MCU_FEAT("msp430f169", "16bit") -MSP430_MCU_FEAT("msp430f1610", "16bit") -MSP430_MCU_FEAT("msp430f1611", "16bit") -MSP430_MCU_FEAT("msp430f1612", "16bit") -MSP430_MCU_FEAT("msp430c336", "16bit") -MSP430_MCU_FEAT("msp430c337", "16bit") -MSP430_MCU_FEAT("msp430e337", "16bit") -MSP430_MCU_FEAT("msp430p337", "16bit") -MSP430_MCU_FEAT("msp430f423", "16bit") -MSP430_MCU_FEAT("msp430f425", "16bit") -MSP430_MCU_FEAT("msp430f427", "16bit") -MSP430_MCU_FEAT("msp430f423a", "16bit") -MSP430_MCU_FEAT("msp430f425a", "16bit") -MSP430_MCU_FEAT("msp430f427a", "16bit") -MSP430_MCU_FEAT("msp430f4481", "16bit") -MSP430_MCU_FEAT("msp430f4491", "16bit") -MSP430_MCU_FEAT("msp430f447", "16bit") -MSP430_MCU_FEAT("msp430f448", "16bit") -MSP430_MCU_FEAT("msp430f449", "16bit") -MSP430_MCU_FEAT("msp430f2330", "16bit") -MSP430_MCU_FEAT("msp430f2350", "16bit") -MSP430_MCU_FEAT("msp430f2370", "16bit") -MSP430_MCU_FEAT("msp430f233", "16bit") -MSP430_MCU_FEAT("msp430f235", "16bit") -MSP430_MCU_FEAT("msp430f247", "16bit") -MSP430_MCU_FEAT("msp430f248", "16bit") -MSP430_MCU_FEAT("msp430f249", "16bit") -MSP430_MCU_FEAT("msp430f2410", "16bit") -MSP430_MCU_FEAT("msp430f2471", "16bit") -MSP430_MCU_FEAT("msp430f2481", "16bit") -MSP430_MCU_FEAT("msp430f2491", "16bit") -MSP430_MCU_FEAT("msp430i2020", "16bit") -MSP430_MCU_FEAT("msp430i2021", "16bit") -MSP430_MCU_FEAT("msp430i2030", "16bit") -MSP430_MCU_FEAT("msp430i2031", "16bit") -MSP430_MCU_FEAT("msp430i2040", "16bit") -MSP430_MCU_FEAT("msp430i2041", "16bit") -MSP430_MCU_FEAT("msp430afe221", "16bit") -MSP430_MCU_FEAT("msp430afe231", "16bit") -MSP430_MCU_FEAT("msp430afe251", "16bit") -MSP430_MCU_FEAT("msp430afe222", "16bit") -MSP430_MCU_FEAT("msp430afe232", "16bit") -MSP430_MCU_FEAT("msp430afe252", "16bit") -MSP430_MCU_FEAT("msp430afe223", "16bit") -MSP430_MCU_FEAT("msp430afe233", "16bit") -MSP430_MCU_FEAT("msp430afe253", "16bit") - -// With 32 Bit Hardware Multiplier -MSP430_MCU_FEAT("msp430f4783", "32bit") -MSP430_MCU_FEAT("msp430f4793", "32bit") -MSP430_MCU_FEAT("msp430f4784", "32bit") -MSP430_MCU_FEAT("msp430f4794", "32bit") - -// Generic MCUs -MSP430_MCU("msp430i2xxgeneric") - -#undef MSP430_MCU -#undef MSP430_MCU_FEAT +MSP430_MCU("msp430afe221", CPUMSP430, HWMult16) +MSP430_MCU("msp430afe222", CPUMSP430, HWMult16) +MSP430_MCU("msp430afe223", CPUMSP430, HWMult16) +MSP430_MCU("msp430afe231", CPUMSP430, HWMult16) +MSP430_MCU("msp430afe232", CPUMSP430, HWMult16) +MSP430_MCU("msp430afe233", CPUMSP430, HWMult16) +MSP430_MCU("msp430afe251", CPUMSP430, HWMult16) +MSP430_MCU("msp430afe252", CPUMSP430, HWMult16) +MSP430_MCU("msp430afe253", CPUMSP430, HWMult16) +MSP430_MCU("msp430bt5190", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430c091", CPUMSP430, HWMultNone) +MSP430_MCU("msp430c092", CPUMSP430, HWMultNone) +MSP430_MCU("msp430c111", CPUMSP430, HWMultNone) +MSP430_MCU("msp430c1111", CPUMSP430, HWMultNone) +MSP430_MCU("msp430c112", CPUMSP430, HWMultNone) +MSP430_MCU("msp430c1121", CPUMSP430, HWMultNone) +MSP430_MCU("msp430c1331", CPUMSP430, HWMultNone) +MSP430_MCU("msp430c1351", CPUMSP430, HWMultNone) +MSP430_MCU("msp430c311s", CPUMSP430, HWMultNone) +MSP430_MCU("msp430c312", CPUMSP430, HWMultNone) +MSP430_MCU("msp430c313", CPUMSP430, HWMultNone) +MSP430_MCU("msp430c314", CPUMSP430, HWMultNone) +MSP430_MCU("msp430c315", CPUMSP430, HWMultNone) +MSP430_MCU("msp430c323", CPUMSP430, HWMultNone) +MSP430_MCU("msp430c325", CPUMSP430, HWMultNone) +MSP430_MCU("msp430c336", CPUMSP430, HWMult16) +MSP430_MCU("msp430c337", CPUMSP430, HWMult16) +MSP430_MCU("msp430c412", CPUMSP430, HWMultNone) +MSP430_MCU("msp430c413", CPUMSP430, HWMultNone) +MSP430_MCU("msp430cg4616", CPUMSP430X, HWMult16) +MSP430_MCU("msp430cg4617", CPUMSP430X, HWMult16) +MSP430_MCU("msp430cg4618", CPUMSP430X, HWMult16) +MSP430_MCU("msp430cg4619", CPUMSP430X, HWMult16) +MSP430_MCU("msp430e112", CPUMSP430, HWMultNone) +MSP430_MCU("msp430e313", CPUMSP430, HWMultNone) +MSP430_MCU("msp430e315", CPUMSP430, HWMultNone) +MSP430_MCU("msp430e325", CPUMSP430, HWMultNone) +MSP430_MCU("msp430e337", CPUMSP430, HWMult16) +MSP430_MCU("msp430f110", CPUMSP430, HWMultNone) +MSP430_MCU("msp430f1101", CPUMSP430, HWMultNone) +MSP430_MCU("msp430f1101a", CPUMSP430, HWMultNone) +MSP430_MCU("msp430f1111", CPUMSP430, HWMultNone) +MSP430_MCU("msp430f1111a", CPUMSP430, HWMultNone) +MSP430_MCU("msp430f112", CPUMSP430, HWMultNone) +MSP430_MCU("msp430f1121", CPUMSP430, HWMultNone) +MSP430_MCU("msp430f1121a", CPUMSP430, HWMultNone) +MSP430_MCU("msp430f1122", CPUMSP430, HWMultNone) +MSP430_MCU("msp430f1132", CPUMSP430, HWMultNone) +MSP430_MCU("msp430f122", CPUMSP430, HWMultNone) +MSP430_MCU("msp430f1222", CPUMSP430, HWMultNone) +MSP430_MCU("msp430f123", CPUMSP430, HWMultNone) +MSP430_MCU("msp430f1232", CPUMSP430, HWMultNone) +MSP430_MCU("msp430f133", CPUMSP430, HWMultNone) +MSP430_MCU("msp430f135", CPUMSP430, HWMultNone) +MSP430_MCU("msp430f147", CPUMSP430, HWMult16) +MSP430_MCU("msp430f1471", CPUMSP430, HWMult16) +MSP430_MCU("msp430f148", CPUMSP430, HWMult16) +MSP430_MCU("msp430f1481", CPUMSP430, HWMult16) +MSP430_MCU("msp430f149", CPUMSP430, HWMult16) +MSP430_MCU("msp430f1491", CPUMSP430, HWMult16) +MSP430_MCU("msp430f155", CPUMSP430, HWMultNone) +MSP430_MCU("msp430f156", CPUMSP430, HWMultNone) +MSP430_MCU("msp430f157", CPUMSP430, HWMultNone) +MSP430_MCU("msp430f1610", CPUMSP430, HWMult16) +MSP430_MCU("msp430f1611", CPUMSP430, HWMult16) +MSP430_MCU("msp430f1612", CPUMSP430, HWMult16) +MSP430_MCU("msp430f167", CPUMSP430, HWMult16) +MSP430_MCU("msp430f168", CPUMSP430, HWMult16) +MSP430_MCU("msp430f169", CPUMSP430, HWMult16) +MSP430_MCU("msp430f2001", CPUMSP430, HWMultNone) +MSP430_MCU("msp430f2002", CPUMSP430, HWMultNone) +MSP430_MCU("msp430f2003", CPUMSP430, HWMultNone) +MSP430_MCU("msp430f2011", CPUMSP430, HWMultNone) +MSP430_MCU("msp430f2012", CPUMSP430, HWMultNone) +MSP430_MCU("msp430f2013", CPUMSP430, HWMultNone) +MSP430_MCU("msp430f2101", CPUMSP430, HWMultNone) +MSP430_MCU("msp430f2111", CPUMSP430, HWMultNone) +MSP430_MCU("msp430f2112", CPUMSP430, HWMultNone) +MSP430_MCU("msp430f2121", CPUMSP430, HWMultNone) +MSP430_MCU("msp430f2122", CPUMSP430, HWMultNone) +MSP430_MCU("msp430f2131", CPUMSP430, HWMultNone) +MSP430_MCU("msp430f2132", CPUMSP430, HWMultNone) +MSP430_MCU("msp430f2232", CPUMSP430, HWMultNone) +MSP430_MCU("msp430f2234", CPUMSP430, HWMultNone) +MSP430_MCU("msp430f2252", CPUMSP430, HWMultNone) +MSP430_MCU("msp430f2254", CPUMSP430, HWMultNone) +MSP430_MCU("msp430f2272", CPUMSP430, HWMultNone) +MSP430_MCU("msp430f2274", CPUMSP430, HWMultNone) +MSP430_MCU("msp430f233", CPUMSP430, HWMult16) +MSP430_MCU("msp430f2330", CPUMSP430, HWMult16) +MSP430_MCU("msp430f235", CPUMSP430, HWMult16) +MSP430_MCU("msp430f2350", CPUMSP430, HWMult16) +MSP430_MCU("msp430f2370", CPUMSP430, HWMult16) +MSP430_MCU("msp430f2410", CPUMSP430, HWMult16) +MSP430_MCU("msp430f2416", CPUMSP430X, HWMult16) +MSP430_MCU("msp430f2417", CPUMSP430X, HWMult16) +MSP430_MCU("msp430f2418", CPUMSP430X, HWMult16) +MSP430_MCU("msp430f2419", CPUMSP430X, HWMult16) +MSP430_MCU("msp430f247", CPUMSP430, HWMult16) +MSP430_MCU("msp430f2471", CPUMSP430, HWMult16) +MSP430_MCU("msp430f248", CPUMSP430, HWMult16) +MSP430_MCU("msp430f2481", CPUMSP430, HWMult16) +MSP430_MCU("msp430f249", CPUMSP430, HWMult16) +MSP430_MCU("msp430f2491", CPUMSP430, HWMult16) +MSP430_MCU("msp430f2616", CPUMSP430X, HWMult16) +MSP430_MCU("msp430f2617", CPUMSP430X, HWMult16) +MSP430_MCU("msp430f2618", CPUMSP430X, HWMult16) +MSP430_MCU("msp430f2619", CPUMSP430X, HWMult16) +MSP430_MCU("msp430f412", CPUMSP430, HWMultNone) +MSP430_MCU("msp430f413", CPUMSP430, HWMultNone) +MSP430_MCU("msp430f4132", CPUMSP430, HWMultNone) +MSP430_MCU("msp430f415", CPUMSP430, HWMultNone) +MSP430_MCU("msp430f4152", CPUMSP430, HWMultNone) +MSP430_MCU("msp430f417", CPUMSP430, HWMultNone) +MSP430_MCU("msp430f423", CPUMSP430, HWMult16) +MSP430_MCU("msp430f423a", CPUMSP430, HWMult16) +MSP430_MCU("msp430f425", CPUMSP430, HWMult16) +MSP430_MCU("msp430f4250", CPUMSP430, HWMultNone) +MSP430_MCU("msp430f425a", CPUMSP430, HWMult16) +MSP430_MCU("msp430f4260", CPUMSP430, HWMultNone) +MSP430_MCU("msp430f427", CPUMSP430, HWMult16) +MSP430_MCU("msp430f4270", CPUMSP430, HWMultNone) +MSP430_MCU("msp430f427a", CPUMSP430, HWMult16) +MSP430_MCU("msp430f435", CPUMSP430, HWMultNone) +MSP430_MCU("msp430f4351", CPUMSP430, HWMultNone) +MSP430_MCU("msp430f436", CPUMSP430, HWMultNone) +MSP430_MCU("msp430f4361", CPUMSP430, HWMultNone) +MSP430_MCU("msp430f437", CPUMSP430, HWMultNone) +MSP430_MCU("msp430f4371", CPUMSP430, HWMultNone) +MSP430_MCU("msp430f438", CPUMSP430, HWMultNone) +MSP430_MCU("msp430f439", CPUMSP430, HWMultNone) +MSP430_MCU("msp430f447", CPUMSP430, HWMult16) +MSP430_MCU("msp430f448", CPUMSP430, HWMult16) +MSP430_MCU("msp430f4481", CPUMSP430, HWMult16) +MSP430_MCU("msp430f449", CPUMSP430, HWMult16) +MSP430_MCU("msp430f4491", CPUMSP430, HWMult16) +MSP430_MCU("msp430f4616", CPUMSP430X, HWMult16) +MSP430_MCU("msp430f46161", CPUMSP430X, HWMult16) +MSP430_MCU("msp430f4617", CPUMSP430X, HWMult16) +MSP430_MCU("msp430f46171", CPUMSP430X, HWMult16) +MSP430_MCU("msp430f4618", CPUMSP430X, HWMult16) +MSP430_MCU("msp430f46181", CPUMSP430X, HWMult16) +MSP430_MCU("msp430f4619", CPUMSP430X, HWMult16) +MSP430_MCU("msp430f46191", CPUMSP430X, HWMult16) +MSP430_MCU("msp430f47126", CPUMSP430X, HWMult32) +MSP430_MCU("msp430f47127", CPUMSP430X, HWMult32) +MSP430_MCU("msp430f47163", CPUMSP430X, HWMult32) +MSP430_MCU("msp430f47166", CPUMSP430X, HWMult32) +MSP430_MCU("msp430f47167", CPUMSP430X, HWMult32) +MSP430_MCU("msp430f47173", CPUMSP430X, HWMult32) +MSP430_MCU("msp430f47176", CPUMSP430X, HWMult32) +MSP430_MCU("msp430f47177", CPUMSP430X, HWMult32) +MSP430_MCU("msp430f47183", CPUMSP430X, HWMult32) +MSP430_MCU("msp430f47186", CPUMSP430X, HWMult32) +MSP430_MCU("msp430f47187", CPUMSP430X, HWMult32) +MSP430_MCU("msp430f47193", CPUMSP430X, HWMult32) +MSP430_MCU("msp430f47196", CPUMSP430X, HWMult32) +MSP430_MCU("msp430f47197", CPUMSP430X, HWMult32) +MSP430_MCU("msp430f477", CPUMSP430, HWMultNone) +MSP430_MCU("msp430f478", CPUMSP430, HWMultNone) +MSP430_MCU("msp430f4783", CPUMSP430, HWMult32) +MSP430_MCU("msp430f4784", CPUMSP430, HWMult32) +MSP430_MCU("msp430f479", CPUMSP430, HWMultNone) +MSP430_MCU("msp430f4793", CPUMSP430, HWMult32) +MSP430_MCU("msp430f4794", CPUMSP430, HWMult32) +MSP430_MCU("msp430f5131", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430f5132", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430f5151", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430f5152", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430f5171", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430f5172", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430f5212", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430f5213", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430f5214", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430f5217", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430f5218", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430f5219", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430f5222", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430f5223", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430f5224", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430f5227", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430f5228", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430f5229", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430f5232", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430f5234", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430f5237", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430f5239", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430f5242", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430f5244", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430f5247", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430f5249", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430f5252", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430f5253", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430f5254", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430f5255", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430f5256", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430f5257", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430f5258", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430f5259", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430f5304", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430f5308", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430f5309", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430f5310", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430f5324", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430f5325", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430f5326", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430f5327", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430f5328", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430f5329", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430f5333", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430f5335", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430f5336", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430f5338", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430f5340", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430f5341", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430f5342", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430f5358", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430f5359", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430f5418", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430f5418a", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430f5419", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430f5419a", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430f5435", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430f5435a", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430f5436", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430f5436a", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430f5437", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430f5437a", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430f5438", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430f5438a", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430f5500", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430f5501", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430f5502", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430f5503", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430f5504", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430f5505", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430f5506", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430f5507", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430f5508", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430f5509", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430f5510", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430f5513", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430f5514", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430f5515", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430f5517", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430f5519", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430f5521", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430f5522", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430f5524", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430f5525", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430f5526", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430f5527", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430f5528", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430f5529", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430f5630", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430f5631", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430f5632", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430f5633", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430f5634", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430f5635", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430f5636", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430f5637", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430f5638", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430f5658", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430f5659", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430f5xx_6xxgeneric", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430f6433", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430f6435", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430f6436", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430f6438", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430f6458", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430f6459", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430f6630", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430f6631", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430f6632", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430f6633", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430f6634", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430f6635", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430f6636", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430f6637", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430f6638", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430f6658", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430f6659", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430f6720", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430f6720a", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430f6721", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430f6721a", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430f6723", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430f6723a", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430f6724", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430f6724a", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430f6725", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430f6725a", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430f6726", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430f6726a", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430f6730", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430f6730a", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430f6731", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430f6731a", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430f6733", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430f6733a", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430f6734", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430f6734a", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430f6735", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430f6735a", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430f6736", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430f6736a", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430f6745", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430f67451", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430f67451a", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430f6745a", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430f6746", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430f67461", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430f67461a", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430f6746a", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430f6747", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430f67471", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430f67471a", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430f6747a", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430f6748", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430f67481", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430f67481a", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430f6748a", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430f6749", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430f67491", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430f67491a", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430f6749a", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430f67621", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430f67621a", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430f67641", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430f67641a", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430f6765", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430f67651", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430f67651a", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430f6765a", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430f6766", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430f67661", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430f67661a", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430f6766a", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430f6767", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430f67671", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430f67671a", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430f6767a", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430f6768", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430f67681", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430f67681a", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430f6768a", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430f6769", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430f67691", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430f67691a", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430f6769a", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430f6775", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430f67751", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430f67751a", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430f6775a", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430f6776", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430f67761", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430f67761a", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430f6776a", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430f6777", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430f67771", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430f67771a", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430f6777a", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430f6778", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430f67781", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430f67781a", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430f6778a", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430f6779", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430f67791", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430f67791a", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430f6779a", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430fe423", CPUMSP430, HWMultNone) +MSP430_MCU("msp430fe4232", CPUMSP430, HWMultNone) +MSP430_MCU("msp430fe423a", CPUMSP430, HWMultNone) +MSP430_MCU("msp430fe4242", CPUMSP430, HWMultNone) +MSP430_MCU("msp430fe425", CPUMSP430, HWMultNone) +MSP430_MCU("msp430fe4252", CPUMSP430, HWMultNone) +MSP430_MCU("msp430fe425a", CPUMSP430, HWMultNone) +MSP430_MCU("msp430fe427", CPUMSP430, HWMultNone) +MSP430_MCU("msp430fe4272", CPUMSP430, HWMultNone) +MSP430_MCU("msp430fe427a", CPUMSP430, HWMultNone) +MSP430_MCU("msp430fg4250", CPUMSP430, HWMultNone) +MSP430_MCU("msp430fg4260", CPUMSP430, HWMultNone) +MSP430_MCU("msp430fg4270", CPUMSP430, HWMultNone) +MSP430_MCU("msp430fg437", CPUMSP430, HWMultNone) +MSP430_MCU("msp430fg438", CPUMSP430, HWMultNone) +MSP430_MCU("msp430fg439", CPUMSP430, HWMultNone) +MSP430_MCU("msp430fg4616", CPUMSP430X, HWMult16) +MSP430_MCU("msp430fg4617", CPUMSP430X, HWMult16) +MSP430_MCU("msp430fg4618", CPUMSP430X, HWMult16) +MSP430_MCU("msp430fg4619", CPUMSP430X, HWMult16) +MSP430_MCU("msp430fg477", CPUMSP430, HWMultNone) +MSP430_MCU("msp430fg478", CPUMSP430, HWMultNone) +MSP430_MCU("msp430fg479", CPUMSP430, HWMultNone) +MSP430_MCU("msp430fg6425", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430fg6426", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430fg6625", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430fg6626", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430fr2000", CPUMSP430XV2, HWMultNone) +MSP430_MCU("msp430fr2032", CPUMSP430XV2, HWMultNone) +MSP430_MCU("msp430fr2033", CPUMSP430XV2, HWMultNone) +MSP430_MCU("msp430fr2100", CPUMSP430XV2, HWMultNone) +MSP430_MCU("msp430fr2110", CPUMSP430XV2, HWMultNone) +MSP430_MCU("msp430fr2111", CPUMSP430XV2, HWMultNone) +MSP430_MCU("msp430fr2153", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430fr2155", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430fr2310", CPUMSP430XV2, HWMultNone) +MSP430_MCU("msp430fr2311", CPUMSP430XV2, HWMultNone) +MSP430_MCU("msp430fr2353", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430fr2355", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430fr2422", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430fr2433", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430fr2475", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430fr2476", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430fr2512", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430fr2522", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430fr2532", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430fr2533", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430fr2632", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430fr2633", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430fr2672", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430fr2673", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430fr2675", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430fr2676", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430fr2xx_4xxgeneric", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430fr4131", CPUMSP430XV2, HWMultNone) +MSP430_MCU("msp430fr4132", CPUMSP430XV2, HWMultNone) +MSP430_MCU("msp430fr4133", CPUMSP430XV2, HWMultNone) +MSP430_MCU("msp430fr5041", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430fr5043", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430fr50431", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430fr5720", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430fr5721", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430fr5722", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430fr5723", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430fr5724", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430fr5725", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430fr5726", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430fr5727", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430fr5728", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430fr5729", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430fr5730", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430fr5731", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430fr5732", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430fr5733", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430fr5734", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430fr5735", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430fr5736", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430fr5737", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430fr5738", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430fr5739", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430fr57xxgeneric", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430fr5847", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430fr58471", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430fr5848", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430fr5849", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430fr5857", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430fr5858", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430fr5859", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430fr5867", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430fr58671", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430fr5868", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430fr5869", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430fr5870", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430fr5872", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430fr58721", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430fr5887", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430fr5888", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430fr5889", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430fr58891", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430fr5922", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430fr59221", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430fr5947", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430fr59471", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430fr5948", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430fr5949", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430fr5957", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430fr5958", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430fr5959", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430fr5962", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430fr5964", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430fr5967", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430fr5968", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430fr5969", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430fr59691", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430fr5970", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430fr5972", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430fr59721", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430fr5986", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430fr5987", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430fr5988", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430fr5989", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430fr59891", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430fr5992", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430fr5994", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430fr59941", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430fr5xx_6xxgeneric", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430fr6005", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430fr6007", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430fr6035", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430fr6037", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430fr60371", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430fr6041", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430fr6043", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430fr60431", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430fr6045", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430fr6047", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430fr60471", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430fr6820", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430fr6822", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430fr68221", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430fr6870", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430fr6872", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430fr68721", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430fr6877", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430fr6879", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430fr68791", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430fr6887", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430fr6888", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430fr6889", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430fr68891", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430fr6920", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430fr6922", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430fr69221", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430fr6927", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430fr69271", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430fr6928", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430fr6970", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430fr6972", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430fr69721", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430fr6977", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430fr6979", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430fr69791", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430fr6987", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430fr6988", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430fr6989", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430fr69891", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430fw423", CPUMSP430, HWMultNone) +MSP430_MCU("msp430fw425", CPUMSP430, HWMultNone) +MSP430_MCU("msp430fw427", CPUMSP430, HWMultNone) +MSP430_MCU("msp430fw428", CPUMSP430, HWMultNone) +MSP430_MCU("msp430fw429", CPUMSP430, HWMultNone) +MSP430_MCU("msp430g2001", CPUMSP430, HWMultNone) +MSP430_MCU("msp430g2101", CPUMSP430, HWMultNone) +MSP430_MCU("msp430g2102", CPUMSP430, HWMultNone) +MSP430_MCU("msp430g2111", CPUMSP430, HWMultNone) +MSP430_MCU("msp430g2112", CPUMSP430, HWMultNone) +MSP430_MCU("msp430g2113", CPUMSP430, HWMultNone) +MSP430_MCU("msp430g2121", CPUMSP430, HWMultNone) +MSP430_MCU("msp430g2131", CPUMSP430, HWMultNone) +MSP430_MCU("msp430g2132", CPUMSP430, HWMultNone) +MSP430_MCU("msp430g2152", CPUMSP430, HWMultNone) +MSP430_MCU("msp430g2153", CPUMSP430, HWMultNone) +MSP430_MCU("msp430g2201", CPUMSP430, HWMultNone) +MSP430_MCU("msp430g2202", CPUMSP430, HWMultNone) +MSP430_MCU("msp430g2203", CPUMSP430, HWMultNone) +MSP430_MCU("msp430g2210", CPUMSP430, HWMultNone) +MSP430_MCU("msp430g2211", CPUMSP430, HWMultNone) +MSP430_MCU("msp430g2212", CPUMSP430, HWMultNone) +MSP430_MCU("msp430g2213", CPUMSP430, HWMultNone) +MSP430_MCU("msp430g2221", CPUMSP430, HWMultNone) +MSP430_MCU("msp430g2230", CPUMSP430, HWMultNone) +MSP430_MCU("msp430g2231", CPUMSP430, HWMultNone) +MSP430_MCU("msp430g2232", CPUMSP430, HWMultNone) +MSP430_MCU("msp430g2233", CPUMSP430, HWMultNone) +MSP430_MCU("msp430g2252", CPUMSP430, HWMultNone) +MSP430_MCU("msp430g2253", CPUMSP430, HWMultNone) +MSP430_MCU("msp430g2302", CPUMSP430, HWMultNone) +MSP430_MCU("msp430g2303", CPUMSP430, HWMultNone) +MSP430_MCU("msp430g2312", CPUMSP430, HWMultNone) +MSP430_MCU("msp430g2313", CPUMSP430, HWMultNone) +MSP430_MCU("msp430g2332", CPUMSP430, HWMultNone) +MSP430_MCU("msp430g2333", CPUMSP430, HWMultNone) +MSP430_MCU("msp430g2352", CPUMSP430, HWMultNone) +MSP430_MCU("msp430g2353", CPUMSP430, HWMultNone) +MSP430_MCU("msp430g2402", CPUMSP430, HWMultNone) +MSP430_MCU("msp430g2403", CPUMSP430, HWMultNone) +MSP430_MCU("msp430g2412", CPUMSP430, HWMultNone) +MSP430_MCU("msp430g2413", CPUMSP430, HWMultNone) +MSP430_MCU("msp430g2432", CPUMSP430, HWMultNone) +MSP430_MCU("msp430g2433", CPUMSP430, HWMultNone) +MSP430_MCU("msp430g2444", CPUMSP430, HWMultNone) +MSP430_MCU("msp430g2452", CPUMSP430, HWMultNone) +MSP430_MCU("msp430g2453", CPUMSP430, HWMultNone) +MSP430_MCU("msp430g2513", CPUMSP430, HWMultNone) +MSP430_MCU("msp430g2533", CPUMSP430, HWMultNone) +MSP430_MCU("msp430g2544", CPUMSP430, HWMultNone) +MSP430_MCU("msp430g2553", CPUMSP430, HWMultNone) +MSP430_MCU("msp430g2744", CPUMSP430, HWMultNone) +MSP430_MCU("msp430g2755", CPUMSP430, HWMultNone) +MSP430_MCU("msp430g2855", CPUMSP430, HWMultNone) +MSP430_MCU("msp430g2955", CPUMSP430, HWMultNone) +MSP430_MCU("msp430i2020", CPUMSP430, HWMult16) +MSP430_MCU("msp430i2021", CPUMSP430, HWMult16) +MSP430_MCU("msp430i2030", CPUMSP430, HWMult16) +MSP430_MCU("msp430i2031", CPUMSP430, HWMult16) +MSP430_MCU("msp430i2040", CPUMSP430, HWMult16) +MSP430_MCU("msp430i2041", CPUMSP430, HWMult16) +MSP430_MCU("msp430i2xxgeneric", CPUMSP430, HWMult16) +MSP430_MCU("msp430l092", CPUMSP430, HWMultNone) +MSP430_MCU("msp430p112", CPUMSP430, HWMultNone) +MSP430_MCU("msp430p313", CPUMSP430, HWMultNone) +MSP430_MCU("msp430p315", CPUMSP430, HWMultNone) +MSP430_MCU("msp430p315s", CPUMSP430, HWMultNone) +MSP430_MCU("msp430p325", CPUMSP430, HWMultNone) +MSP430_MCU("msp430p337", CPUMSP430, HWMult16) +MSP430_MCU("msp430sl5438a", CPUMSP430XV2, HWMultF5) +MSP430_MCU("msp430tch5e", CPUMSP430, HWMultNone) +MSP430_MCU("msp430xgeneric", CPUMSP430XV2, HWMultF5) diff --git a/clang/lib/Driver/ToolChains/MSP430.cpp b/clang/lib/Driver/ToolChains/MSP430.cpp --- a/clang/lib/Driver/ToolChains/MSP430.cpp +++ b/clang/lib/Driver/ToolChains/MSP430.cpp @@ -16,6 +16,7 @@ #include "llvm/Option/ArgList.h" #include "llvm/Support/FileSystem.h" #include "llvm/Support/Path.h" +#include using namespace clang::driver; using namespace clang::driver::toolchains; @@ -23,86 +24,148 @@ using namespace clang; using namespace llvm::opt; -static bool isSupportedMCU(const StringRef MCU) { - return llvm::StringSwitch(MCU) -#define MSP430_MCU(NAME) .Case(NAME, true) -#include "clang/Basic/MSP430Target.def" - .Default(false); -} - -static StringRef getSupportedHWMult(const Arg *MCU) { - if (!MCU) - return "none"; +enum CPUKind { CPUMSP430, CPUMSP430X, CPUMSP430XV2 }; +enum HWMultKind { + HWMultAuto, + HWMultNone, + HWMult16, + HWMult32, + HWMultF5, + HWMultInvalid +}; + +struct MCUData { + StringRef Name; + CPUKind CPU = CPUMSP430; + HWMultKind HWMult = HWMultNone; + friend bool operator<(const MCUData &M1, const MCUData &M2) { + return M1.Name < M2.Name; + } + bool isValid() const { return !Name.empty(); } +}; - return llvm::StringSwitch(MCU->getValue()) -#define MSP430_MCU_FEAT(NAME, HWMULT) .Case(NAME, HWMULT) +static constexpr std::array MSP430MCUData = {{ +#define MSP430_MCU(NAME, CPU, HWMULT) {(NAME), (CPU), (HWMULT)}, #include "clang/Basic/MSP430Target.def" - .Default("none"); +}}; + +static HWMultKind getHWMultStringAsEnum(StringRef HWMult) { + return llvm::StringSwitch(HWMult) + .Case("none", HWMultNone) + .Case("auto", HWMultAuto) + .Case("16bit", HWMult16) + .Case("32bit", HWMult32) + .Case("f5series", HWMultF5) + .Default(HWMultInvalid); } -static StringRef getHWMultLib(const ArgList &Args) { - StringRef HWMult = Args.getLastArgValue(options::OPT_mhwmult_EQ, "auto"); - if (HWMult == "auto") { - HWMult = getSupportedHWMult(Args.getLastArg(options::OPT_mmcu_EQ)); +static StringRef getHWMultEnumAsString(HWMultKind HWMult) { + switch (HWMult) { + case HWMultAuto: + return "auto"; + case HWMultNone: + return "none"; + case HWMult16: + return "16bit"; + case HWMult32: + return "32bit"; + case HWMultF5: + return "f5series"; + default: + llvm_unreachable("Unsupported HWMult enum"); } - - return llvm::StringSwitch(HWMult) - .Case("16bit", "-lmul_16") - .Case("32bit", "-lmul_32") - .Case("f5series", "-lmul_f5") - .Default("-lmul_none"); } -void msp430::getMSP430TargetFeatures(const Driver &D, const ArgList &Args, - std::vector &Features) { - const Arg *MCU = Args.getLastArg(options::OPT_mmcu_EQ); - if (MCU && !isSupportedMCU(MCU->getValue())) { - D.Diag(diag::err_drv_clang_unsupported) << MCU->getValue(); - return; - } - +/// Process the -mhwmult= and -mmcu= options to determine which hwmult feature +/// to enable. +/// +/// Diagnose and report any issues with the values passed to these options. +static void processHWMultFeatures(const Driver &D, const ArgList &Args, + std::vector &Features, + HWMultKind SupportedHWMult) { + const Arg *MCUArg = Args.getLastArg(options::OPT_mmcu_EQ); const Arg *HWMultArg = Args.getLastArg(options::OPT_mhwmult_EQ); - if (!MCU && !HWMultArg) + if (!MCUArg && !HWMultArg) return; - StringRef HWMult = HWMultArg ? HWMultArg->getValue() : "auto"; - StringRef SupportedHWMult = getSupportedHWMult(MCU); + HWMultKind HWMult = + (HWMultArg ? getHWMultStringAsEnum(HWMultArg->getValue()) : HWMultAuto); + if (HWMult == HWMultInvalid) { + D.Diag(diag::err_drv_unsupported_option_argument) + << HWMultArg->getAsString(Args) << HWMultArg->getValue(); + return; + } else if (HWMult == HWMultNone) { + return; + } - if (HWMult == "auto") { - // 'auto' - deduce hw multiplier support based on mcu name provided. - // If no mcu name is provided, assume no hw multiplier is supported. - if (!MCU) - D.Diag(clang::diag::warn_drv_msp430_hwmult_no_device); + if (HWMult == HWMultAuto) { + if (!MCUArg) { + D.Diag(diag::warn_drv_msp430_hwmult_no_device); + return; + } HWMult = SupportedHWMult; } - if (HWMult == "none") { - // 'none' - disable hw multiplier. - Features.push_back("-hwmult16"); - Features.push_back("-hwmult32"); - Features.push_back("-hwmultf5"); - return; + if (MCUArg && HWMult != HWMultNone && SupportedHWMult == HWMultNone) { + D.Diag(diag::warn_drv_msp430_hwmult_unsupported) << HWMultArg->getValue(); + } else if (MCUArg && HWMult != SupportedHWMult) { + D.Diag(diag::warn_drv_msp430_hwmult_mismatch) + << getHWMultEnumAsString(SupportedHWMult) << HWMultArg->getValue(); + } else { + switch (HWMult) { + case HWMultNone: + return; + case HWMult16: + Features.push_back("+hwmult16"); + return; + case HWMult32: + Features.push_back("+hwmult32"); + return; + case HWMultF5: + Features.push_back("+hwmultf5"); + return; + default: + llvm_unreachable("Unhandled HWMult version"); + return; + } } +} - if (MCU && SupportedHWMult == "none") - D.Diag(clang::diag::warn_drv_msp430_hwmult_unsupported) << HWMult; - if (MCU && HWMult != SupportedHWMult) - D.Diag(clang::diag::warn_drv_msp430_hwmult_mismatch) - << SupportedHWMult << HWMult; - - if (HWMult == "16bit") { - // '16bit' - for 16-bit only hw multiplier. - Features.push_back("+hwmult16"); - } else if (HWMult == "32bit") { - // '32bit' - for 16/32-bit hw multiplier. - Features.push_back("+hwmult32"); - } else if (HWMult == "f5series") { - // 'f5series' - for 16/32-bit hw multiplier supported by F5 series mcus. - Features.push_back("+hwmultf5"); - } else { - D.Diag(clang::diag::err_drv_unsupported_option_argument) - << HWMultArg->getAsString(Args) << HWMult; +/// Search the MCU data from MSP430Target.def for the MCUData entry with the +/// name \p MCU. +/// +/// Returns a default-constructed MCUData object if an entry with a name exactly +/// matching \p MCU isn't found, otherwise return the entry. +/// +/// std::lower_bound is used to perform an efficient binary search on the data. +static MCUData loadMCUData(const StringRef MCU) { + MCUData MCUDataQuery = {MCU, CPUMSP430, HWMultNone}; + auto it = std::lower_bound(MSP430MCUData.begin(), MSP430MCUData.end(), + MCUDataQuery); + if (it == MSP430MCUData.end() || it->Name != MCU) { + return {}; + } + return *it; +} + +/// Process the -mmcu= and -mhwmult= options to determine the target features. +/// +/// This is the only time Clang will warn about conflicts between these options, +/// or issues with the values passed to them. +void msp430::getMSP430TargetFeatures(const Driver &D, const ArgList &Args, + std::vector &Features) { + const Arg *MCUArg = Args.getLastArg(options::OPT_mmcu_EQ); + HWMultKind SupportedHWMult = HWMultNone; + if (MCUArg) { + MCUData LoadedMCUData = loadMCUData(MCUArg->getValue()); + if (!LoadedMCUData.isValid()) { + D.Diag(diag::err_drv_clang_unsupported) << MCUArg->getValue(); + return; + } + SupportedHWMult = LoadedMCUData.HWMult; } + + processHWMultFeatures(D, Args, Features, SupportedHWMult); } /// MSP430 Toolchain @@ -179,6 +242,41 @@ return new tools::msp430::Linker(*this); } +/// Get the actual hardware multiply version being used. +/// +/// The hardware multiply version to use depends on the values passed to the +/// -mmcu= and -mhwmult= options. +static HWMultKind getHWMult(const ArgList &Args, HWMultKind SupportedHWMult) { + StringRef HWMultArg = Args.getLastArgValue(options::OPT_mhwmult_EQ, "auto"); + if (HWMultArg == "auto") + return SupportedHWMult; + return getHWMultStringAsEnum(HWMultArg); +} + +/// Use the values passed to the -mmcu= and -mhwmult= options to determine the +/// correct hardware multiply library to put on the linker command line. +/// +/// MCUData for the given MCU needs to be loaded again, but since it +/// was already loaded and processed earlier in the driver (see +/// getMSP430TargetFeatures), there's no need to warn or error on invalid +/// input. +static StringRef getHWMultLib(const ArgList &Args) { + MCUData LoadedMCUData; + if (const Arg *MCUArg = Args.getLastArg(options::OPT_mmcu_EQ)) + LoadedMCUData = loadMCUData(MCUArg->getValue()); + + switch (getHWMult(Args, LoadedMCUData.HWMult)) { + case HWMult16: + return "-lmul_16"; + case HWMult32: + return "-lmul_32"; + case HWMultF5: + return "-lmul_f5"; + default: + return "-lmul_none"; + } +} + void msp430::Linker::AddStartFiles(bool UseExceptions, const ArgList &Args, ArgStringList &CmdArgs) const { const ToolChain &ToolChain = getToolChain(); diff --git a/clang/test/Driver/msp430-hwmult.c b/clang/test/Driver/msp430-hwmult.c --- a/clang/test/Driver/msp430-hwmult.c +++ b/clang/test/Driver/msp430-hwmult.c @@ -3,17 +3,13 @@ // RUN: %clang -### -target msp430 %s 2>&1 | FileCheck %s // RUN: %clang -### -target msp430 %s -mhwmult=auto 2>&1 | FileCheck %s +// RUN: %clang -### -target msp430 %s -mhwmult=none 2>&1 | FileCheck %s +// RUN: %clang -### -target msp430 %s -mhwmult=none -mmcu=msp430f147 2>&1 | FileCheck %s +// RUN: %clang -### -target msp430 %s -mhwmult=none -mmcu=msp430f4783 2>&1 | FileCheck %s // CHECK-NOT: "-target-feature" "+hwmult16" // CHECK-NOT: "-target-feature" "+hwmult32" // CHECK-NOT: "-target-feature" "+hwmultf5" -// RUN: %clang -### -target msp430 %s -mhwmult=none 2>&1 | FileCheck --check-prefix=CHECK-NONE %s -// RUN: %clang -### -target msp430 %s -mhwmult=none -mmcu=msp430f147 2>&1 | FileCheck --check-prefix=CHECK-NONE %s -// RUN: %clang -### -target msp430 %s -mhwmult=none -mmcu=msp430f4783 2>&1 | FileCheck --check-prefix=CHECK-NONE %s -// CHECK-NONE: "-target-feature" "-hwmult16" -// CHECK-NONE: "-target-feature" "-hwmult32" -// CHECK-NONE: "-target-feature" "-hwmultf5" - // RUN: %clang -### -target msp430 %s -mhwmult=16bit 2>&1 | FileCheck --check-prefix=CHECK-16 %s // CHECK-16: "-target-feature" "+hwmult16" diff --git a/clang/test/Driver/msp430-mmcu.c b/clang/test/Driver/msp430-mmcu.c --- a/clang/test/Driver/msp430-mmcu.c +++ b/clang/test/Driver/msp430-mmcu.c @@ -1,15 +1,62 @@ +// This file tests that various different values passed to -mmcu= select the +// correct target features and linker scripts, and create MCU-specific defines. + +// Test the lexicographic ordering of MCUs in MSP430Target.def. +// +// The MCU "msp430f110" should appear before "msp430f1101" when the data has +// been sorted lexicographically. Some sorts will put "msp430f110" *after* +// "msp430f1101", so when this happens, Clang will not be able to find this MCU. + +// RUN: %clang %s -### -no-canonical-prefixes -target msp430 -mmcu=msp430f110 2>&1 \ +// RUN: | FileCheck %s + +// RUN: %clang %s -### -no-canonical-prefixes -target msp430 -mmcu=msp430f1101 2>&1 \ +// RUN: | FileCheck %s + +// RUN: %clang %s -### -no-canonical-prefixes -target msp430 -mmcu=msp430f1101a 2>&1 \ +// RUN: | FileCheck %s + +// CHECK-NOT: error: the clang compiler does not support + +// Test the symbol definitions, linker scripts and hardware multiply features +// selected for different MCUs. + // RUN: %clang %s -### -no-canonical-prefixes -target msp430 -mmcu=msp430c111 2>&1 \ // RUN: | FileCheck -check-prefix=MSP430-C111 %s // MSP430-C111: clang{{.*}} "-cc1" {{.*}} "-D__MSP430C111__" +// MSP430-C111-NOT: "-target-feature" "+hwmult16" +// MSP430-C111-NOT: "-target-feature" "+hwmult32" +// MSP430-C111-NOT: "-target-feature" "+hwmultf5" // MSP430-C111: msp430-elf-ld{{.*}} "-Tmsp430c111.ld" // RUN: %clang %s -### -no-canonical-prefixes -target msp430 -mmcu=msp430i2020 2>&1 \ // RUN: | FileCheck -check-prefix=MSP430-I2020 %s // MSP430-I2020: clang{{.*}} "-cc1" {{.*}} "-D__MSP430i2020__" +// MSP430-I2020: "-target-feature" "+hwmult16" // MSP430-I2020: msp430-elf-ld{{.*}} "-Tmsp430i2020.ld" +// RUN: %clang %s -### -no-canonical-prefixes -target msp430 -mmcu=msp430f47126 2>&1 \ +// RUN: | FileCheck -check-prefix=MSP430-F47126 %s + +// MSP430-F47126: clang{{.*}} "-cc1" {{.*}} "-D__MSP430F47126__" +// MSP430-F47126: "-target-feature" "+hwmult32" +// MSP430-F47126: msp430-elf-ld{{.*}} "-Tmsp430f47126.ld" + +// RAN: %clang %s -### -no-canonical-prefixes -target msp430 -mmcu=msp430fr5969 2>&1 \ +// RAN: | FileCheck -check-prefix=MSP430-FR5969 %s + +// MSP430-FR5969: clang{{.*}} "-cc1" {{.*}} "-D__MSP430FR5969__" +// MSP430-FR5969: "-target-feature" "+hwmultf5" +// MSP430-FR5969: msp430-elf-ld{{.*}} "-Tmsp430fr5969.ld" + +// Test for the error message emitted when an invalid MCU is selected. +// +// Note that if this test is ever modified because the expected error message is +// changed, the check prefixes at the top of this file, used to validate the +// ordering of the hard-coded MCU data, also need to be updated. +// // RUN: %clang %s -### -no-canonical-prefixes -target msp430 -mmcu=not-a-mcu 2>&1 \ // RUN: | FileCheck -check-prefix=MSP430-UNSUP %s diff --git a/clang/test/Driver/msp430-toolchain.c b/clang/test/Driver/msp430-toolchain.c --- a/clang/test/Driver/msp430-toolchain.c +++ b/clang/test/Driver/msp430-toolchain.c @@ -253,6 +253,10 @@ // RUN: | FileCheck -check-prefix=HWMult-32BIT %s // HWMult-32BIT: "--start-group" "-lmul_32" +// RUN: %clang %s -### -no-canonical-prefixes -target msp430 -mmcu=msp430fr5969 --sysroot="" 2>&1 \ +// RUN: | FileCheck -check-prefix=HWMult-F5 %s +// RUN: %clang %s -### -no-canonical-prefixes -target msp430 -mmcu=msp430fr5969 -mhwmult=auto --sysroot="" 2>&1 \ +// RUN: | FileCheck -check-prefix=HWMult-F5 %s // RUN: %clang %s -### -no-canonical-prefixes -target msp430 -mhwmult=f5series --sysroot="" 2>&1 \ // RUN: | FileCheck -check-prefix=HWMult-F5 %s // HWMult-F5: "--start-group" "-lmul_f5" @@ -261,4 +265,10 @@ // RUN: | FileCheck -check-prefix=HWMult-NONE %s // RUN: %clang %s -### -no-canonical-prefixes -target msp430 -mhwmult=none -mmcu=msp430f4783 --sysroot="" 2>&1 \ // RUN: | FileCheck -check-prefix=HWMult-NONE %s +// RUN: %clang %s -### -no-canonical-prefixes -target msp430 -mhwmult=auto -mmcu=msp430 --sysroot="" 2>&1 \ +// RUN: | FileCheck -check-prefix=HWMult-NONE %s +// RUN: %clang %s -### -no-canonical-prefixes -target msp430 -mhwmult=auto -mmcu=msp430x --sysroot="" 2>&1 \ +// RUN: | FileCheck -check-prefix=HWMult-NONE %s +// RUN: %clang %s -### -no-canonical-prefixes -target msp430 -mmcu=msp430xv2 --sysroot="" 2>&1 \ +// RUN: | FileCheck -check-prefix=HWMult-NONE %s // HWMult-NONE: "--start-group" "-lmul_none"