Skip to content

use gcc assembly for arm 6 #5073

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 2 commits into from
Sep 12, 2017
Merged

use gcc assembly for arm 6 #5073

merged 2 commits into from
Sep 12, 2017

Conversation

studavekar
Copy link
Contributor

@studavekar studavekar commented Sep 12, 2017

Description

fix the armc6 compile error, ARM 6 is compatible with GCC so unify GCC and ARM 6 code

00:00:44.012         [DEBUG] Output: ./TESTS/mbed_hal/flash/functional_tests/main.cpp:82:11: error: no flag-preserving variant of this instruction available
00:00:44.012         [DEBUG] Output:     "%=:\n\t"
00:00:44.013         [DEBUG] Output:           ^
00:00:44.013         [DEBUG] Output: <inline asm>:2:2: note: instantiated into assembly here
00:00:44.013         [DEBUG] Output:         SUB  r0, #1

__asm behavior between arm 5 and arm 6

arm compiler 6.8 :

  1. For embedded assembly, you cannot use the __asm keyword on the function declaration.
  2. The __asm keyword can incorporate inline GCC syntax assembly code into a function
    reference 6.8

arm compiler 5.06:

The __asm keyword can declare or define an embedded assembly function reference 5.06

Related PRs

#4949

@studavekar
Copy link
Contributor Author

/morph test

@studavekar studavekar changed the title gaurd thumb instruction for amrc6 use gcc assembly for arm 6 Sep 12, 2017
@0xc0170
Copy link
Contributor

0xc0170 commented Sep 12, 2017

LGTM, but we should use toolchain generic macros

@studavekar
Copy link
Contributor Author

/morph test

@mbed-bot
Copy link

Result: SUCCESS

Your command has finished executing! Here's what you wrote!

/morph test

Output

mbed Build Number: 1285

All builds and test passed!

@mbed-bot
Copy link

Result: SUCCESS

Your command has finished executing! Here's what you wrote!

/morph test

Output

mbed Build Number: 1286

All builds and test passed!

@@ -74,13 +74,13 @@ static void delay_loop(uint32_t count)
: "cc"
);
}
#else // GCC
#elif defined ( __GNUC__ ) || (defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050))
Copy link
Contributor

Choose a reason for hiding this comment

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

It looks like this will work but I don't usually like #elif without a corresponding default #else case. I think we can live with it for now though

@adbridge adbridge self-requested a review September 12, 2017 09:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants