-
Notifications
You must be signed in to change notification settings - Fork 61
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
Differentiating between CM33 and CM85 with preprocessor #159
Comments
this seems still to be a shortcoming in GCC. According to ACLE one should be able to detect the architecture by looking to I'll pass this on to our GCC experts. |
@JonatanAntoni thank you. To be clear, both GCC and LLVM both produce Does that match your expectations as well? |
From some more testing of CM85 with multiple toolchains, this is what I am seeing for
So it seems neither paradigm produces correct output across all of these toolchains. |
CMSIS contains the revision number of each core using these defines: Even when a device vendor does not provide the exact revision of the implementation, the fallback ensures that this define exists:
This information is therefore less dependent on Compiler internal defines specified by ACLE and maybe easier to query.
I hope this helps. |
I will give that a try. As far as looking to the future, are the |
In a previous issue submitted to CMSIS 5, I was told that it was no longer advisable to use the arch defines like
__ARM_ARCH_8M_MAIN__
and to instead use__ARM_ARCH
.But dumping preprocessor defines for CM33 and CM85 both yield the same
__ARM_ARCH*
defines:Note that GCC generates
__ARM_ARCH_8M_MAIN__
for both CM33 and CM85.LLVM 17 generates the same as GCC, with the exception that it generates
__ARM_ARCH_8_1M_MAIN__
for CM85.How should CM33 and CM85 be differentiated with the preprocessor?
The text was updated successfully, but these errors were encountered: