Skip to content

arch: arm: aarch32: Allow selecting compiler instruction set #22741

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

Merged
merged 3 commits into from
Mar 10, 2020

Conversation

stephanosio
Copy link
Member

This commit makes the following changes to allow choosing either ARM
or Thumb instruction set for C code compilation.

  1. Introduce COMPILER_ISA_THUMB2 symbol to make C code compilation
    using the Thumb instruction set configurable.

  2. When ISA_ARM and ISA_THUMB2 symbols are selected simultaneously
    (i.e. on Cortex-A and Cortex-R processors), make all ASM functions
    use the ARM instruction set by default.

Signed-off-by: Stephanos Ioannidis [email protected]

@zephyrbot
Copy link
Collaborator

zephyrbot commented Feb 12, 2020

All checks are passing now.

Tip: The bot edits this comment instead of posting a new one, so you can check the comment's history to see earlier messages.

@stephanosio
Copy link
Member Author

-:96: ERROR:MULTISTATEMENT_MACRO_USE_DO_WHILE: Macros with multiple statements should be enclosed in a do - while loop
#96: FILE: include/toolchain/gcc.h:242:
+#define FUNC_CODE() .thumb;

It must be very nice having an assembler that supports do-while, I mean really.

@stephanosio stephanosio added this to the v2.3.0 milestone Feb 13, 2020
Copy link
Collaborator

@SebastianBoe SebastianBoe left a comment

Choose a reason for hiding this comment

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

Minor changes requested.

Copy link
Collaborator

@SebastianBoe SebastianBoe left a comment

Choose a reason for hiding this comment

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

Great work.

@ioannisg ioannisg requested a review from pabigot March 10, 2020 12:44
@stephanosio stephanosio requested a review from ulfalizer March 10, 2020 13:27
This commit whitespace-aligns the toolchain flags.

Signed-off-by: Stephanos Ioannidis <[email protected]>
This commit introduces the `COMPILER_ISA_THUMB2` symbol to allow
choosing either the ARM or Thumb instruction set for C code
compilation.

In addition, this commit introduces the `ASSEMBLER_ISA_THUMB2` helper
symbol to specify the default target instruction set for the assembler.

Signed-off-by: Stephanos Ioannidis <[email protected]>
The ARMv7-R architecture supports both Thumb-2 (T32) and ARM (A32)
instruction sets.

This commit selects the `ISA_THUMB2` symbol to indicate that the
ARMv7-R architecture supports the Thumb-2 instruction set, which can
be enabled by selecting the `COMPILER_ISA_THUMB2` symbol.

Signed-off-by: Stephanos Ioannidis <[email protected]>
@ioannisg ioannisg requested a review from carlocaione March 10, 2020 15:55
@ioannisg ioannisg merged commit 7c5db4b into zephyrproject-rtos:master Mar 10, 2020
@stephanosio stephanosio deleted the arm_isa_selection branch April 23, 2020 06:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: API Changes to public APIs area: ARM ARM (32-bit) Architecture area: Build System
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants