Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-devel / 2020-04

What is the best match for for -mfpu=fpv4-sp-d16 on fpc-arm?

11 messages · 4 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Michael Ring

I have now set up new target freertos-arm and want to start playing arround with freertos.

I have compiled freertos with STM32CubeIDE, only 'problem' is that I need to compile with floting point enabled, with Soft-Float the build fails.

For STM32F401RE Chip the C-compiler selects

-mfpu=fpv4-sp-d16 -mfloat-abi=hard

but Freepascal doex not seem to support exactly this abi, I see: NONE
SOFT
LIBGCC
FPA
FPA10
FPA11
VFPV2
VFPV3
NEON_VFPV3
VFPV3_D16
FPV4_S16
VFPV4
NEON_VFPV4

Which setting should I use? VFPV3_D16 or something else?

Thank you,

Michael

Reply by email

Florian Klaempfl
to Michael Ring
Michael Ring wrote 27 lines
I have now set up new target freertos-arm and want to start playing arround with freertos. I have compiled freertos with STM32CubeIDE, only 'problem' is that I need to compile with floting point enabled, with Soft-Float the build fails. For STM32F401RE Chip the C-compiler selects -mfpu=fpv4-sp-d16 -mfloat-abi=hard but Freepascal doex not seem to support exactly this abi, I see: NONE SOFT LIBGCC FPA FPA10 FPA11 VFPV2 VFPV3 NEON_VFPV3 VFPV3_D16 FPV4_S16 VFPV4 NEON_VFPV4 Which setting should I use? VFPV3_D16 or something else?

Let's just add it. What properties does it have? Do you have know some reference by heard?

Reply by email

Michael Ring
to Florian Klaempfl

I found this reference manual for floating point instructions:

https://www.st.com/resource/en/programming_manual/dm00046982-stm32-cortexm4-mcus-and-mpus-programming-manual-stmicroelectronics.pdf

and this high level overview:

https://embeddedartistry.com/blog/2017/10/11/demystifying-arm-floating-point-compiler-options/

What is funny is that I did not find FPV4_S16 in the link above, only *VFPv4-D32,**VFPv4-D16 and ***VFPv4U**

Here:
https://sourceware.org/binutils/docs/as/ARM-Options.html#ARM-Options I only find |vfpv4|, |vfpv4-d16|, |fpv4-sp-d16| so no idea what FPV4_S16 actually is..

Michael

Florian Klaempfl wrote 36 lines
Am 11.04.2020 um 21:03 schrieb Michael Ring via fpc-devel: > I have now set up new target freertos-arm and want to start playing > arround with freertos. > > I have compiled freertos with STM32CubeIDE, only 'problem' is that I > need to compile with floting point enabled, with Soft-Float the build > fails. > > For STM32F401RE Chip the C-compiler selects > > -mfpu=fpv4-sp-d16 -mfloat-abi=hard > > but Freepascal doex not seem to support exactly this abi, I see: > NONE > SOFT > LIBGCC > FPA > FPA10 > FPA11 > VFPV2 > VFPV3 > NEON_VFPV3 > VFPV3_D16 > FPV4_S16 > VFPV4 > NEON_VFPV4 > > Which setting should I use? VFPV3_D16 or something else? Let's just add it. What properties does it have? Do you have know some reference by heard? _______________________________________________ fpc-devel maillist  -  https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel

Reply by email

Florian Klämpfl
to Michael Ring
Michael Ring wrote 10 lines
I found this reference manual for floating point instructions: https://www.st.com/resource/en/programming_manual/dm00046982-stm32-cortexm4-mcus-and-mpus-programming-manual-stmicroelectronics.pdf and this high level overview: https://embeddedartistry.com/blog/2017/10/11/demystifying-arm-floating-point-compiler-options/ What is funny is that I did not find FPV4_S16 in the link above, only *VFPv4-D32,**VFPv4-D16 and ***VFPv4U**

It is probably what Cortex-M4 needs. However, it does not seem to be completely correct. I'll add fpv4-sp-d16 (it means: single precision only with 32 registers, but for load/store/move they can be considered as 16 double registers) and fix everything

Reply by email

Florian Klämpfl
to Unknown author

Am 12.04.20 um 10:49 schrieb

I'm pretty sure that's what fpv4_s16 is. That was implemented for cortex m4. Don't have the spec here currently though

Yes. It looks like this. Nevertheless, for consistent naming I'll add fpv4-sp-d16 with the same fpu capabilities as fpv4_s16 (which appears to be broken currently).

Reply by email

Michael Ring
to Florian Klämpfl

Thank you very much for your effort!

Michael

Florian Klämpfl wrote 10 lines
Am 12.04.20 um 10:49 schrieb > I'm pretty sure that's what fpv4_s16 is. That was implemented for > cortex m4. Don't have the spec here currently though Yes. It looks like this. Nevertheless, for consistent naming I'll add fpv4-sp-d16 with the same fpu capabilities as fpv4_s16 (which appears to be broken currently). _______________________________________________ fpc-devel maillist  -  https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel

Reply by email

Michael Ring
to Florian Klämpfl

Thanks, but unfortunately this created some issues, both when I build plain armv6m/armv7em embedded compiler+rtl and my freertos target (Errors are the same)

armv6m embedded from trunk compiling without -Cf flag:

/Users/ring/fpcupdeluxe/fpc/bin/x86_64-darwin/ppcarm -Cparmv6m -Ur -Tembedded -Parm -XParm-embedded- -Xr -Ur -Xs -O2 -n -Fi../inc -Fi../arm -FD/Users/ring/fpcupdeluxe/fpc/bin/x86_64-darwin -FE. -FU/Users/ring/devel/fpc/rtl/units/arm-embedded -vw-n-h-l-d-u-t-p-c- -ap -darm -dRELEASE ../inc/iso7185.pp
iso7185.pp(267,13) Fatal: Internal error 2009112404

armv7em compiling with -CfFPV4_SP_D16

/Library/Developer/CommandLineTools/usr/bin/make -C embedded all /Users/ring/fpcupdeluxe/fpc/bin/x86_64-darwin/ppcarm -Cparmv7em -Ur -Tembedded -Parm -XParm-embedded- -Xr -Ur -Xs -O2 -n -Fi../inc -Fi../arm -FD/Users/ring/fpcupdeluxe/fpc/bin/x86_64-darwin -FE. -FU/Users/ring/devel/fpc/rtl/units/arm-embedded -vw-n-h-l-d-u-t-p-c- -ap -CfFPV4_SP_D16 -darm -dRELEASE  -Us -Sg system.pp @system.cfg {standard input}: Assembler messages:
{standard input}:19643: Error: selected FPU does not support instruction -- `vmov d0,r0,r1'

{standard input}:19659: Error: selected FPU does not support instruction -- `vmov d0,r0,r1'

Compiling the compiler+rtl worked fine before applying the following changes:

Updating 6d7560f142..94d20ceb05
Fast-forward
 compiler/arm/aasmcpu.pas  |  1 +
 compiler/arm/cgcpu.pas    | 43 +++++++++++++++++++++++++++----------------  compiler/arm/cpuinfo.pas  | 40 ++++++++++++++++++++++------------------  compiler/arm/narmadd.pas  |  6 +++---
 compiler/arm/narmcnv.pas  |  6 +++---
 compiler/arm/narminl.pas  | 12 ++++++------
 compiler/arm/narmmat.pas  |  4 ++--
 compiler/arm/narmutil.pas |  1 +
 compiler/globals.pas      |  1 +
 9 files changed, 66 insertions(+), 48 deletions(-)

In case you need the freertos target, it is here, work in progress, I am now creating freertos bindings:

http://temp.michael-ring.org/targetarmfreertos.patch

Florian Klämpfl wrote 7 lines
Am 12.04.20 um 14:13 schrieb Michael Ring via fpc-devel: > Thank you very much for your effort! I added FPV4_SP_D16. _______________________________________________ fpc-devel maillist  -  https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel

Reply by email

Florian Klämpfl
to Michael Ring
Michael Ring wrote 27 lines
Thanks, but unfortunately this created some issues, both when I build plain armv6m/armv7em embedded compiler+rtl and my freertos target (Errors are the same) armv6m embedded from trunk compiling without -Cf flag: /Users/ring/fpcupdeluxe/fpc/bin/x86_64-darwin/ppcarm -Cparmv6m -Ur -Tembedded -Parm -XParm-embedded- -Xr -Ur -Xs -O2 -n -Fi../inc -Fi../arm -FD/Users/ring/fpcupdeluxe/fpc/bin/x86_64-darwin -FE. -FU/Users/ring/devel/fpc/rtl/units/arm-embedded -vw-n-h-l-d-u-t-p-c- -ap -darm -dRELEASE ../inc/iso7185.pp iso7185.pp(267,13) Fatal: Internal error 2009112404 armv7em compiling with -CfFPV4_SP_D16 /Library/Developer/CommandLineTools/usr/bin/make -C embedded all /Users/ring/fpcupdeluxe/fpc/bin/x86_64-darwin/ppcarm -Cparmv7em -Ur -Tembedded -Parm -XParm-embedded- -Xr -Ur -Xs -O2 -n -Fi../inc -Fi../arm -FD/Users/ring/fpcupdeluxe/fpc/bin/x86_64-darwin -FE. -FU/Users/ring/devel/fpc/rtl/units/arm-embedded -vw-n-h-l-d-u-t-p-c- -ap -CfFPV4_SP_D16 -darm -dRELEASE  -Us -Sg system.pp @system.cfg {standard input}: Assembler messages: {standard input}:19643: Error: selected FPU does not support instruction -- `vmov d0,r0,r1' {standard input}:19659: Error: selected FPU does not support instruction -- `vmov d0,r0,r1'

Hopefully all fixed.

Reply by email

Michael Ring
to Michael Ring: Thanks, but unfortunately this created some issues, both when I build plain…

Compile compiler&rtl works again!

Michael

Michael Ring wrote 65 lines
Thanks, but unfortunately this created some issues, both when I build plain armv6m/armv7em embedded compiler+rtl and my freertos target (Errors are the same) armv6m embedded from trunk compiling without -Cf flag: /Users/ring/fpcupdeluxe/fpc/bin/x86_64-darwin/ppcarm -Cparmv6m -Ur -Tembedded -Parm -XParm-embedded- -Xr -Ur -Xs -O2 -n -Fi../inc -Fi../arm -FD/Users/ring/fpcupdeluxe/fpc/bin/x86_64-darwin -FE. -FU/Users/ring/devel/fpc/rtl/units/arm-embedded -vw-n-h-l-d-u-t-p-c- -ap -darm -dRELEASE ../inc/iso7185.pp iso7185.pp(267,13) Fatal: Internal error 2009112404 armv7em compiling with -CfFPV4_SP_D16 /Library/Developer/CommandLineTools/usr/bin/make -C embedded all /Users/ring/fpcupdeluxe/fpc/bin/x86_64-darwin/ppcarm -Cparmv7em -Ur -Tembedded -Parm -XParm-embedded- -Xr -Ur -Xs -O2 -n -Fi../inc -Fi../arm -FD/Users/ring/fpcupdeluxe/fpc/bin/x86_64-darwin -FE. -FU/Users/ring/devel/fpc/rtl/units/arm-embedded -vw-n-h-l-d-u-t-p-c- -ap -CfFPV4_SP_D16 -darm -dRELEASE  -Us -Sg system.pp @system.cfg {standard input}: Assembler messages: {standard input}:19643: Error: selected FPU does not support instruction -- `vmov d0,r0,r1' {standard input}:19659: Error: selected FPU does not support instruction -- `vmov d0,r0,r1' Compiling the compiler+rtl worked fine before applying the following changes: Updating 6d7560f142..94d20ceb05 Fast-forward  compiler/arm/aasmcpu.pas  |  1 +  compiler/arm/cgcpu.pas    | 43 +++++++++++++++++++++++++++----------------  compiler/arm/cpuinfo.pas  | 40 ++++++++++++++++++++++------------------  compiler/arm/narmadd.pas  |  6 +++---  compiler/arm/narmcnv.pas  |  6 +++---  compiler/arm/narminl.pas  | 12 ++++++------  compiler/arm/narmmat.pas  |  4 ++--  compiler/arm/narmutil.pas |  1 +  compiler/globals.pas      |  1 +  9 files changed, 66 insertions(+), 48 deletions(-) In case you need the freertos target, it is here, work in progress, I am now creating freertos bindings: http://temp.michael-ring.org/targetarmfreertos.patch Am 12.04.20 um 16:26 schrieb Florian Klämpfl: > Am 12.04.20 um 14:13 schrieb Michael Ring via fpc-devel: >> Thank you very much for your effort! > > I added FPV4_SP_D16. > _______________________________________________ > fpc-devel maillist  -  > https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel _______________________________________________ fpc-devel maillist  -  https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel

Reply by email