-
Notifications
You must be signed in to change notification settings - Fork 14k
[AVR] Add support for many new AVR MCUs #143914
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Thank you for submitting a Pull Request (PR) to the LLVM Project! This PR will be automatically labeled and the relevant teams will be notified. If you wish to, you can add reviewers by using the "Reviewers" section on this page. If this is not working for you, it is probably because you do not have write permissions for the repository. In which case you can instead tag reviewers by name in a comment by using If you have received no comments on your PR for a week, you can request a review by "ping"ing the PR by adding a comment “Ping”. The common courtesy "ping" rate is once a week. Please remember that you are asking for valuable time from other developers. If you have further questions, they may be answered by the LLVM GitHub User Guide. You can also ask questions in a comment on this PR, on the LLVM Discord or on the forums. |
@llvm/pr-subscribers-clang-driver @llvm/pr-subscribers-clang Author: Tom Vijlbrief (tomtor) ChangesShould fix #116116 Full diff: https://github.com/llvm/llvm-project/pull/143914.diff 3 Files Affected:
diff --git a/clang/lib/Basic/Targets/AVR.cpp b/clang/lib/Basic/Targets/AVR.cpp
index 85ca4bc30c461..72268a50a247a 100644
--- a/clang/lib/Basic/Targets/AVR.cpp
+++ b/clang/lib/Basic/Targets/AVR.cpp
@@ -344,6 +344,51 @@ static MCUInfo AVRMcus[] = {
{"atmega3209", "__AVR_ATmega3209__", "103", 1},
{"atmega4808", "__AVR_ATmega4808__", "103", 1},
{"atmega4809", "__AVR_ATmega4809__", "103", 1},
+
+ // gcc 14 additions:
+
+ {"avr16dd20", "__AVR_AVR16DD20__", "103", 1},
+ {"avr16dd28", "__AVR_AVR16DD28__", "103", 1},
+ {"avr16dd32", "__AVR_AVR16DD32__", "103", 1},
+ {"avr16du14", "__AVR_AVR16DU14__", "103", 1},
+ {"avr16du20", "__AVR_AVR16DU20__", "103", 1},
+ {"avr16du28", "__AVR_AVR16DU28__", "103", 1},
+ {"avr16du32", "__AVR_AVR16DU32__", "103", 1},
+ {"avr32da28", "__AVR_AVR32DA28__", "103", 1},
+ {"avr32da32", "__AVR_AVR32DA32__", "103", 1},
+ {"avr32da48", "__AVR_AVR32DA48__", "103", 1},
+ {"avr32db28", "__AVR_AVR32DB28__", "103", 1},
+ {"avr32db32", "__AVR_AVR32DB32__", "103", 1},
+ {"avr32db48", "__AVR_AVR32DB48__", "103", 1},
+ {"avr32dd14", "__AVR_AVR32DD14__", "103", 1},
+ {"avr32dd20", "__AVR_AVR32DD20__", "103", 1},
+ {"avr32dd28", "__AVR_AVR32DD28__", "103", 1},
+ {"avr32dd32", "__AVR_AVR32DD32__", "103", 1},
+ {"avr32du14", "__AVR_AVR32DU14__", "103", 1},
+ {"avr32du20", "__AVR_AVR32DU20__", "103", 1},
+ {"avr32du28", "__AVR_AVR32DU28__", "103", 1},
+ {"avr32du32", "__AVR_AVR32DU32__", "103", 1},
+ {"avr16eb14", "__AVR_AVR16EB14__", "103", 1},
+ {"avr16eb20", "__AVR_AVR16EB20__", "103", 1},
+ {"avr16eb28", "__AVR_AVR16EB28__", "103", 1},
+ {"avr16eb32", "__AVR_AVR16EB32__", "103", 1},
+ {"avr16ea28", "__AVR_AVR16EA28__", "103", 1},
+ {"avr16ea32", "__AVR_AVR16EA32__", "103", 1},
+ {"avr16ea48", "__AVR_AVR16EA48__", "103", 1},
+ {"avr32ea28", "__AVR_AVR32EA28__", "103", 1},
+ {"avr32ea32", "__AVR_AVR32EA32__", "103", 1},
+ {"avr32ea48", "__AVR_AVR32EA48__", "103", 1},
+ {"avr32sd20", "__AVR_AVR32SD20__", "103", 1},
+ {"avr32sd28", "__AVR_AVR32SD28__", "103", 1},
+ {"avr32sd32", "__AVR_AVR32SD32__", "103", 1},
+ {"avr128da28", "__AVR_AVR128DA28__", "104", 2},
+ {"avr128da32", "__AVR_AVR128DA32__", "104", 2},
+ {"avr128da48", "__AVR_AVR128DA48__", "104", 2},
+ {"avr128da64", "__AVR_AVR128DA64__", "104", 2},
+ {"avr128db28", "__AVR_AVR128DB28__", "104", 2},
+ {"avr128db32", "__AVR_AVR128DB32__", "104", 2},
+ {"avr128db48", "__AVR_AVR128DB48__", "104", 2},
+ {"avr128db64", "__AVR_AVR128DB64__", "104", 2},
};
} // namespace targets
diff --git a/clang/lib/Driver/ToolChains/AVR.cpp b/clang/lib/Driver/ToolChains/AVR.cpp
index f1529f857eef8..2ea80a039a7ff 100644
--- a/clang/lib/Driver/ToolChains/AVR.cpp
+++ b/clang/lib/Driver/ToolChains/AVR.cpp
@@ -328,6 +328,52 @@ constexpr struct {
{"attiny1627", "avrxmega3", "avrxmega3", 0x803800},
{"attiny3216", "avrxmega3", "avrxmega3", 0x803800},
{"attiny3217", "avrxmega3", "avrxmega3", 0x803800},
+
+ // gcc 14 additions:
+
+ {"avr16dd20", "avrxmega3", "avrxmega3", 0x807800},
+ {"avr16dd28", "avrxmega3", "avrxmega3", 0x807800},
+ {"avr16dd32", "avrxmega3", "avrxmega3", 0x807800},
+ {"avr16du14", "avrxmega3", "avrxmega3", 0x807800},
+ {"avr16du20", "avrxmega3", "avrxmega3", 0x807800},
+ {"avr16du28", "avrxmega3", "avrxmega3", 0x807800},
+ {"avr16du32", "avrxmega3", "avrxmega3", 0x807800},
+ {"avr32da28", "avrxmega3", "avrxmega3", 0x807000},
+ {"avr32da32", "avrxmega3", "avrxmega3", 0x807000},
+ {"avr32da48", "avrxmega3", "avrxmega3", 0x807000},
+ {"avr32db28", "avrxmega3", "avrxmega3", 0x807000},
+ {"avr32db32", "avrxmega3", "avrxmega3", 0x807000},
+ {"avr32db48", "avrxmega3", "avrxmega3", 0x807000},
+ {"avr32dd14", "avrxmega3", "avrxmega3", 0x807000},
+ {"avr32dd20", "avrxmega3", "avrxmega3", 0x807000},
+ {"avr32dd28", "avrxmega3", "avrxmega3", 0x807000},
+ {"avr32dd32", "avrxmega3", "avrxmega3", 0x807000},
+ {"avr32du14", "avrxmega3", "avrxmega3", 0x807000},
+ {"avr32du20", "avrxmega3", "avrxmega3", 0x807000},
+ {"avr32du28", "avrxmega3", "avrxmega3", 0x807000},
+ {"avr32du32", "avrxmega3", "avrxmega3", 0x807000},
+ {"avr16eb14", "avrxmega3", "avrxmega3", 0x807800},
+ {"avr16eb20", "avrxmega3", "avrxmega3", 0x807800},
+ {"avr16eb28", "avrxmega3", "avrxmega3", 0x807800},
+ {"avr16eb32", "avrxmega3", "avrxmega3", 0x807800},
+ {"avr16ea28", "avrxmega3", "avrxmega3", 0x807800},
+ {"avr16ea32", "avrxmega3", "avrxmega3", 0x807800},
+ {"avr16ea48", "avrxmega3", "avrxmega3", 0x807800},
+ {"avr32ea28", "avrxmega3", "avrxmega3", 0x807000},
+ {"avr32ea32", "avrxmega3", "avrxmega3", 0x807000},
+ {"avr32ea48", "avrxmega3", "avrxmega3", 0x807000},
+ {"avr32sd20", "avrxmega3", "avrxmega3", 0x807000},
+ {"avr32sd28", "avrxmega3", "avrxmega3", 0x807000},
+ {"avr32sd32", "avrxmega3", "avrxmega3", 0x807000},
+ {"avr128da28", "avrxmega4", "avrxmega4", 0x804000},
+ {"avr128da32", "avrxmega4", "avrxmega4", 0x804000},
+ {"avr128da48", "avrxmega4", "avrxmega4", 0x804000},
+ {"avr128da64", "avrxmega4", "avrxmega4", 0x804000},
+ {"avr128db28", "avrxmega4", "avrxmega4", 0x804000},
+ {"avr128db32", "avrxmega4", "avrxmega4", 0x804000},
+ {"avr128db48", "avrxmega4", "avrxmega4", 0x804000},
+ {"avr128db64", "avrxmega4", "avrxmega4", 0x804000},
+
};
std::string GetMCUSubPath(StringRef MCUName) {
diff --git a/llvm/lib/Target/AVR/AVRDevices.td b/llvm/lib/Target/AVR/AVRDevices.td
index 56147bb473bc4..f72cbe7257930 100644
--- a/llvm/lib/Target/AVR/AVRDevices.td
+++ b/llvm/lib/Target/AVR/AVRDevices.td
@@ -215,6 +215,13 @@ def FamilyXMEGA3 : Family<"xmega3",
FeatureMultiplication, FeatureMOVW, FeatureLPMX,
FeatureBREAK, FeatureLowByteFirst]>;
+def FamilyXMEGA4 : Family<"xmega4",
+ [FamilyAVR0, FeatureLPM, FeatureIJMPCALL,
+ FeatureADDSUBIW, FeatureSRAM, FeatureJMPCALL,
+ FeatureMultiplication, FeatureMOVW, FeatureLPMX,
+ FeatureEIJMPCALL, FeatureELPM,
+ FeatureBREAK, FeatureLowByteFirst]>;
+
def FamilyXMEGA : Family<"xmega",
[FamilyAVR0, FeatureLPM, FeatureIJMPCALL,
FeatureADDSUBIW, FeatureSRAM, FeatureJMPCALL,
@@ -575,3 +582,48 @@ def : Device<"atmega3208", FamilyXMEGA3, ELFArchXMEGA3>;
def : Device<"atmega3209", FamilyXMEGA3, ELFArchXMEGA3>;
def : Device<"atmega4808", FamilyXMEGA3, ELFArchXMEGA3>;
def : Device<"atmega4809", FamilyXMEGA3, ELFArchXMEGA3>;
+
+// Additions from gcc 14:
+
+def : Device<"avr16dd20", FamilyXMEGA3, ELFArchXMEGA3>;
+def : Device<"avr16dd28", FamilyXMEGA3, ELFArchXMEGA3>;
+def : Device<"avr16dd32", FamilyXMEGA3, ELFArchXMEGA3>;
+def : Device<"avr16du14", FamilyXMEGA3, ELFArchXMEGA3>;
+def : Device<"avr16du20", FamilyXMEGA3, ELFArchXMEGA3>;
+def : Device<"avr16du28", FamilyXMEGA3, ELFArchXMEGA3>;
+def : Device<"avr16du32", FamilyXMEGA3, ELFArchXMEGA3>;
+def : Device<"avr32da28", FamilyXMEGA3, ELFArchXMEGA3>;
+def : Device<"avr32da32", FamilyXMEGA3, ELFArchXMEGA3>;
+def : Device<"avr32da48", FamilyXMEGA3, ELFArchXMEGA3>;
+def : Device<"avr32db28", FamilyXMEGA3, ELFArchXMEGA3>;
+def : Device<"avr32db32", FamilyXMEGA3, ELFArchXMEGA3>;
+def : Device<"avr32db48", FamilyXMEGA3, ELFArchXMEGA3>;
+def : Device<"avr32dd14", FamilyXMEGA3, ELFArchXMEGA3>;
+def : Device<"avr32dd20", FamilyXMEGA3, ELFArchXMEGA3>;
+def : Device<"avr32dd28", FamilyXMEGA3, ELFArchXMEGA3>;
+def : Device<"avr32dd32", FamilyXMEGA3, ELFArchXMEGA3>;
+def : Device<"avr32du14", FamilyXMEGA3, ELFArchXMEGA3>;
+def : Device<"avr32du20", FamilyXMEGA3, ELFArchXMEGA3>;
+def : Device<"avr32du28", FamilyXMEGA3, ELFArchXMEGA3>;
+def : Device<"avr32du32", FamilyXMEGA3, ELFArchXMEGA3>;
+def : Device<"avr16eb14", FamilyXMEGA3, ELFArchXMEGA3>;
+def : Device<"avr16eb20", FamilyXMEGA3, ELFArchXMEGA3>;
+def : Device<"avr16eb28", FamilyXMEGA3, ELFArchXMEGA3>;
+def : Device<"avr16eb32", FamilyXMEGA3, ELFArchXMEGA3>;
+def : Device<"avr16ea28", FamilyXMEGA3, ELFArchXMEGA3>;
+def : Device<"avr16ea32", FamilyXMEGA3, ELFArchXMEGA3>;
+def : Device<"avr16ea48", FamilyXMEGA3, ELFArchXMEGA3>;
+def : Device<"avr32ea28", FamilyXMEGA3, ELFArchXMEGA3>;
+def : Device<"avr32ea32", FamilyXMEGA3, ELFArchXMEGA3>;
+def : Device<"avr32ea48", FamilyXMEGA3, ELFArchXMEGA3>;
+def : Device<"avr32sd20", FamilyXMEGA3, ELFArchXMEGA3>;
+def : Device<"avr32sd28", FamilyXMEGA3, ELFArchXMEGA3>;
+def : Device<"avr32sd32", FamilyXMEGA3, ELFArchXMEGA3>;
+def : Device<"avr128da28", FamilyXMEGA4, ELFArchXMEGA4>;
+def : Device<"avr128da32", FamilyXMEGA4, ELFArchXMEGA4>;
+def : Device<"avr128da48", FamilyXMEGA4, ELFArchXMEGA4>;
+def : Device<"avr128da64", FamilyXMEGA4, ELFArchXMEGA4>;
+def : Device<"avr128db28", FamilyXMEGA4, ELFArchXMEGA4>;
+def : Device<"avr128db32", FamilyXMEGA4, ELFArchXMEGA4>;
+def : Device<"avr128db48", FamilyXMEGA4, ELFArchXMEGA4>;
+def : Device<"avr128db64", FamilyXMEGA4, ELFArchXMEGA4>;
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me, cc @benshi001?
I noticed that GCC 14 has also some avr64 definitions that I missed. @Patryk27 probably better I add these as well? |
Removed EIJMP for avr128 devices, see: https://onlinedocs.microchip.com/oxy/GUID-0B644D8F-67E7-49E6-82C9-1B2B9ABE6A0D-en-US-23/GUID-3F578DEB-6EE6-4081-AEF2-B505FF2AE8A5.html |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@tomtor Congratulations on having your first Pull Request (PR) merged into the LLVM Project! Your changes will be combined with recent changes from other authors, then tested by our build bots. If there is a problem with a build, you may receive a report in an email or a comment on this PR. Please check whether problems have been caused by your change specifically, as the builds can include changes from many authors. It is not uncommon for your change to be included in a build that fails due to someone else's changes, or infrastructure issues. How to do this, and the rest of the post-merge process, is covered in detail here. If your change does cause a problem, it may be reverted, or you can revert it yourself. This is a normal part of LLVM development. You can fix your changes and open a new PR to merge them again. If you don't get any reports, no action is required from you. Your changes are working as expected, well done! |
LLVM Buildbot has detected a new failure on builder Full details are available at: https://lab.llvm.org/buildbot/#/builders/55/builds/12788 Here is the relevant piece of the build log for the reference
|
LLVM Buildbot has detected a new failure on builder Full details are available at: https://lab.llvm.org/buildbot/#/builders/6/builds/9864 Here is the relevant piece of the build log for the reference
|
LLVM Buildbot has detected a new failure on builder Full details are available at: https://lab.llvm.org/buildbot/#/builders/153/builds/34834 Here is the relevant piece of the build log for the reference
|
LLVM Buildbot has detected a new failure on builder Full details are available at: https://lab.llvm.org/buildbot/#/builders/60/builds/30265 Here is the relevant piece of the build log for the reference
|
LLVM Buildbot has detected a new failure on builder Full details are available at: https://lab.llvm.org/buildbot/#/builders/174/builds/19412 Here is the relevant piece of the build log for the reference
|
LLVM Buildbot has detected a new failure on builder Full details are available at: https://lab.llvm.org/buildbot/#/builders/200/builds/11295 Here is the relevant piece of the build log for the reference
|
LLVM Buildbot has detected a new failure on builder Full details are available at: https://lab.llvm.org/buildbot/#/builders/137/builds/20353 Here is the relevant piece of the build log for the reference
|
LLVM Buildbot has detected a new failure on builder Full details are available at: https://lab.llvm.org/buildbot/#/builders/33/builds/18281 Here is the relevant piece of the build log for the reference
|
LLVM Buildbot has detected a new failure on builder Full details are available at: https://lab.llvm.org/buildbot/#/builders/32/builds/19980 Here is the relevant piece of the build log for the reference
|
LLVM Buildbot has detected a new failure on builder Full details are available at: https://lab.llvm.org/buildbot/#/builders/16/builds/20810 Here is the relevant piece of the build log for the reference
|
LLVM Buildbot has detected a new failure on builder Full details are available at: https://lab.llvm.org/buildbot/#/builders/185/builds/20132 Here is the relevant piece of the build log for the reference
|
LLVM Buildbot has detected a new failure on builder Full details are available at: https://lab.llvm.org/buildbot/#/builders/108/builds/14085 Here is the relevant piece of the build log for the reference
|
LLVM Buildbot has detected a new failure on builder Full details are available at: https://lab.llvm.org/buildbot/#/builders/8/builds/16765 Here is the relevant piece of the build log for the reference
|
LLVM Buildbot has detected a new failure on builder Full details are available at: https://lab.llvm.org/buildbot/#/builders/59/builds/19362 Here is the relevant piece of the build log for the reference
|
LLVM Buildbot has detected a new failure on builder Full details are available at: https://lab.llvm.org/buildbot/#/builders/56/builds/28435 Here is the relevant piece of the build log for the reference
|
LLVM Buildbot has detected a new failure on builder Full details are available at: https://lab.llvm.org/buildbot/#/builders/187/builds/6889 Here is the relevant piece of the build log for the reference
|
LLVM Buildbot has detected a new failure on builder Full details are available at: https://lab.llvm.org/buildbot/#/builders/88/builds/12821 Here is the relevant piece of the build log for the reference
|
LLVM Buildbot has detected a new failure on builder Full details are available at: https://lab.llvm.org/buildbot/#/builders/144/builds/27652 Here is the relevant piece of the build log for the reference
|
LLVM Buildbot has detected a new failure on builder Full details are available at: https://lab.llvm.org/buildbot/#/builders/65/builds/18125 Here is the relevant piece of the build log for the reference
|
LLVM Buildbot has detected a new failure on builder Full details are available at: https://lab.llvm.org/buildbot/#/builders/51/builds/17950 Here is the relevant piece of the build log for the reference
|
LLVM Buildbot has detected a new failure on builder Full details are available at: https://lab.llvm.org/buildbot/#/builders/10/builds/7351 Here is the relevant piece of the build log for the reference
|
@tomtor @benshi001 @Patryk27 I've landed 62d8e00 to revert this PR. I'm getting:
I'm happy to try your revised patch. Thanks! |
LLVM Buildbot has detected a new failure on builder Full details are available at: https://lab.llvm.org/buildbot/#/builders/66/builds/15382 Here is the relevant piece of the build log for the reference
|
LLVM Buildbot has detected a new failure on builder Full details are available at: https://lab.llvm.org/buildbot/#/builders/3/builds/17510 Here is the relevant piece of the build log for the reference
|
LLVM Buildbot has detected a new failure on builder Full details are available at: https://lab.llvm.org/buildbot/#/builders/169/builds/12241 Here is the relevant piece of the build log for the reference
|
LLVM Buildbot has detected a new failure on builder Full details are available at: https://lab.llvm.org/buildbot/#/builders/133/builds/17813 Here is the relevant piece of the build log for the reference
|
LLVM Buildbot has detected a new failure on builder Full details are available at: https://lab.llvm.org/buildbot/#/builders/168/builds/13147 Here is the relevant piece of the build log for the reference
|
LLVM Buildbot has detected a new failure on builder Full details are available at: https://lab.llvm.org/buildbot/#/builders/140/builds/25030 Here is the relevant piece of the build log for the reference
|
LLVM Buildbot has detected a new failure on builder Full details are available at: https://lab.llvm.org/buildbot/#/builders/190/builds/21446 Here is the relevant piece of the build log for the reference
|
LLVM Buildbot has detected a new failure on builder Full details are available at: https://lab.llvm.org/buildbot/#/builders/46/builds/18437 Here is the relevant piece of the build log for the reference
|
LLVM Buildbot has detected a new failure on builder Full details are available at: https://lab.llvm.org/buildbot/#/builders/27/builds/11566 Here is the relevant piece of the build log for the reference
|
LLVM Buildbot has detected a new failure on builder Full details are available at: https://lab.llvm.org/buildbot/#/builders/11/builds/17313 Here is the relevant piece of the build log for the reference
|
LLVM Buildbot has detected a new failure on builder Full details are available at: https://lab.llvm.org/buildbot/#/builders/154/builds/17433 Here is the relevant piece of the build log for the reference
|
LLVM Buildbot has detected a new failure on builder Full details are available at: https://lab.llvm.org/buildbot/#/builders/23/builds/11254 Here is the relevant piece of the build log for the reference
|
This reverts commit 10bc17f. Multiple buildbot failures have been reported: llvm/llvm-project#143914
This reverts commit 10bc17f. Multiple buildbot failures have been reported: llvm#143914
Should fix #116116