Skip to content
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

arm: Add minimal support for Arm Cortex-M85 #28

Conversation

thaoluonguw
Copy link

Add minimal support for Arm Cortex-M85:

This cherry picked from https://github.com/gcc-mirror/gcc

ccfd1e7 : arm: Add support for Arm Cortex-M85 CPU.

This minimal support excluded pacbti feature which is causing build error in Zephyr SDK.

This patch adds the -mcpu support for the Arm Cortex-M85 CPU which is
an Armv8.1-M Mainline CPU supporting MVE and PACBTI by default.

-mpcu=cortex-m85 switch by default matches to -march=armv8.1-m.main+pacbti+mve.fp+fp.dp.

Also following options are provided to disable default features.
+nomve.fp (disables MVE Floating point)
+nomve (disables MVE Integer and MVE Floating point)
+nodsp (disables dsp, MVE Integer and MVE Floating point)
+nopacbti (disables pacbti)
+nofp (disables floating point and MVE floating point)

gcc/ChangeLog:

2022-08-12  Srinath Parvathaneni  <srinath.parvathaneni@arm.com>

	* config/arm/arm-cpus.in (cortex-m85): Define new CPU.
	* config/arm/arm-tables.opt: Regenerate.
	* config/arm/arm-tune.md: Likewise.
	* doc/invoke.texi (Arm Options): Document -mcpu=cortex-m85.
	* (-mfix-cmse-cve-2021-35465): Likewise.

gcc/testsuite/ChangeLog:

2022-08-12  Srinath Parvathaneni  <srinath.parvathaneni@arm.com>

	* gcc.target/arm/multilib.exp: Add tests for cortex-m85.

(cherry picked from commit
gcc-mirror@ccfd1e7)

Signed-off-by: Thao Luong <thao.luong.uw@renesas.com>
@thaoluonguw thaoluonguw marked this pull request as draft March 15, 2024 05:08
@thaoluonguw thaoluonguw marked this pull request as ready for review March 18, 2024 03:54
@tejlmand tejlmand requested a review from stephanosio March 25, 2024 14:59
@keith-packard
Copy link
Collaborator

Fixes for pacbti are upstream in gcc and should be easy to backport here; is that something that should be included here?

@stephanosio
Copy link
Member

Fixes for pacbti are upstream in gcc and should be easy to backport here; is that something that should be included here?

@keith-packard Given that PACBTI support was added in GCC 13 and the current Zephyr fork is based on GCC 12, wouldn't it be too risky to attempt this (whole feature) backport?

@keith-packard
Copy link
Collaborator

Fixes for pacbti are upstream in gcc and should be easy to backport here; is that something that should be included here?

@keith-packard Given that PACBTI support was added in GCC 13 and the current Zephyr fork is based on GCC 12, wouldn't it be too risky to attempt this (whole feature) backport?

Sorry, I'd forgotten Zephyr was still on GCC 12.

@thaoluonguw
Copy link
Author

Fixes for pacbti are upstream in gcc and should be easy to backport here; is that something that should be included here?

@keith-packard , @stephanosio : we would like to propose minimal support for CM85 at this time. To support pacbti, it requires more backport. I saw that there is planning to upgrade gcc to v14.2 as information in zephyrproject-rtos/sdk-ng#740, until v14.2 is supported, is it Ok to support for CM85 with this minimal support?

gcc/doc/invoke.texi Outdated Show resolved Hide resolved
Comment on lines +524 to +528
{-mcpu=cortex-m85+nopacbti -mfpu=auto -mfloat-abi=soft} "thumb/v8-m.main/nofp"
{-mcpu=cortex-m85+nopacbti+nofp -mfpu=auto -mfloat-abi=soft} "thumb/v8-m.main/nofp"
{-mcpu=cortex-m85+nopacbti+nomve -mfpu=auto -mfloat-abi=soft} "thumb/v8-m.main/nofp"
{-mcpu=cortex-m85+nopacbti+nodsp -mfpu=auto -mfloat-abi=soft} "thumb/v8-m.main/nofp"
{-mcpu=cortex-m85+nopacbti+nomve.fp -mfpu=auto -mfloat-abi=soft} "thumb/v8-m.main/nofp"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Obviously, these are not going to pass the test; but, we might as well leave it to keep the diff minimal from the original commit.

@ra-fsp-systems
Copy link

ra-fsp-systems commented Mar 27, 2024

Fixes for pacbti are upstream in gcc and should be easy to backport here; is that something that should be included here?

@keith-packard Given that PACBTI support was added in GCC 13 and the current Zephyr fork is based on GCC 12, wouldn't it be too risky to attempt this (whole feature) backport?

@stephanosio Is there a plan for moving ahead to GCC 13?

@stephanosio
Copy link
Member

@stephanosio Is there a plan for moving ahead to GCC 13?

We will likely skip 13 and target 14 (see zephyrproject-rtos/sdk-ng#740 (comment)).

Minimal support gcc for cortex-m85 only
Temporary remove pacbti in cortex-m85

Signed-off-by: Thao Luong <thao.luong.uw@renesas.com>
@thaoluonguw thaoluonguw force-pushed the Add_support_for_CM85 branch from 3a7e000 to d1b1cc5 Compare April 1, 2024 11:25
@stephanosio stephanosio merged commit a5dfaf6 into zephyrproject-rtos:zephyr-gcc-12.2.0 Apr 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants