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

irq_armv7m: missing fpu selection for Armcc5 #1266

Open
0xc0170 opened this issue Jul 28, 2021 · 4 comments
Open

irq_armv7m: missing fpu selection for Armcc5 #1266

0xc0170 opened this issue Jul 28, 2021 · 4 comments
Assignees

Comments

@0xc0170
Copy link
Contributor

0xc0170 commented Jul 28, 2021

The file https://github.com/ARM-software/CMSIS_5/blob/develop/CMSIS/RTOS2/RTX/Source/ARM/irq_armv7m.s contains only one FPU selection:

                IF       ({FPU}="FPv4-SP")
FPU_USED        EQU      1
                ELSE
FPU_USED        EQU      0
                ENDIF

There are multiple options of FPU for v7m as I know of. For instance I found it failing for cortex-m4f (using --cpu Cortex-M4.fp.sp ).

It should be (if I got the FPU flags correct):

                IF       ({FPU}="FPv4-SP") || ({FPU}="VFPv4_SP_D16") || ({FPU}="FPv5-SP") || ({FPU}="FPv5_D16")
FPU_USED        EQU      1
                ELSE
FPU_USED        EQU      0
                ENDIF
@0xc0170 0xc0170 changed the title irq_armv7m: missing fpu selection irq_armv7m: missing fpu selection for Armcc5 Jul 28, 2021
@jkrech
Copy link
Collaborator

jkrech commented Jul 28, 2021

Playing with the command line options I could not create FPv4-SP in the info {FPU} but using --fpu option I was able to see VFPv4_D16

--cpu --fpu {FPU}
Cortex-M4.fp.sp VFPv4_SP_D16
Cortex-M4.fp VFPv4_SP_D16
Cortex-M4 FPv4-SP VFPv4_SP_D16
Cortex-M4 VFPv4_D16 VFPv4_D16
Cortex-M7.fp.sp FPv5-SP
Cortex-M7.fp.dp FPv5_D16

@JonatanAntoni
Copy link
Member

JonatanAntoni commented Jul 29, 2021

Partly addressed in #1267

@0xc0170
Copy link
Contributor Author

0xc0170 commented Jul 29, 2021

Playing with the command line options I could not create FPv4-SP in the info {FPU} but using --fpu option I was able to see VFPv4_D16

This would be the correct condition (taking {FPU} from the table above)?

IF ({FPU}="VFPv4_D16") || ({FPU}="VFPv4_SP_D16") || ({FPU}="FPv5-SP") || ({FPU}="FPv5_D16")

@JonatanAntoni
Copy link
Member

@0xc0170, please check with @GorgonMeducer about getting this into a PR. Thanks!

0xc0170 pushed a commit to 0xc0170/mbed-os that referenced this issue Jul 29, 2021
For FPU, use armasm to select fpu selection. This will be fixed upstream in the next version of CMSIS. Meanwhile, we use our local patch.

Taken from --cpu selection for armasm:

--cpu           | {FPU}
Cortex-M4.fp.sp | VFPv4_SP_D16
Cortex-M7.fp.sp | FPv5-SP
Cortex-M7.fp.dp | FPv5_D16

Tracking issue: ARM-software/CMSIS_5#1266
@JonatanAntoni JonatanAntoni added bug and removed review labels Jul 29, 2021
0xc0170 pushed a commit to 0xc0170/mbed-os that referenced this issue Jul 29, 2021
For FPU, use armasm to select fpu selection. This will be fixed upstream in the next version of CMSIS. Meanwhile, we use our local patch.

Taken from --cpu selection for armasm:

--cpu           | {FPU}
Cortex-M4.fp.sp | VFPv4_SP_D16
Cortex-M7.fp.sp | FPv5-SP
Cortex-M7.fp.dp | FPv5_D16

Tracking issue: ARM-software/CMSIS_5#1266
GorgonMeducer added a commit to GorgonMeducer/CMSIS_5 that referenced this issue Oct 3, 2021
JonatanAntoni pushed a commit that referenced this issue Oct 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants