Sign in Join

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

Mailing lists / fpc-devel / 2012-03

freepascal on armhf again

3 messages · 2 people · –

Reply by email Subscribe to this list Your subscription

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

peter green

I decided to take another look at the freepascal armhf issue and decided that the first step would be to build freepascal with vfp enabled but still the softfloat ABI then once that was working.

(note: i'm currently working on upstream fpc svn, if/when I get things working reasonablly on armhf I will look into backporting to the version in debian)

Unfortunately when I try to build freepascal with vfp enabled

make all 'OPT=-dFPC_ARMEL -CfVFPV3'

I get assembler errors.

/fpc/rtl/units/arm-linux/system.s:43697: Error: selected processor does not support ARM mode `fmdrr d0,r2,r3'
/fpc/rtl/units/arm-linux/system.s:43698: Error: selected processor does not support ARM mode `fmrrd r2,r3,d0'
/fpc/rtl/units/arm-linux/system.s:45460: Error: selected processor does not support ARM mode `fmsr s0,r0'
/fpc/rtl/units/arm-linux/system.s:45461: Error: selected processor does not support ARM mode `fuitod d0,s0'
/fpc/rtl/units/arm-linux/system.s:45463: Error: selected processor does not support ARM mode `fldd d1,[r0]'
/fpc/rtl/units/arm-linux/system.s:45464: Error: selected processor does not support ARM mode `fmuld d0,d0,d1'
/fpc/rtl/units/arm-linux/system.s:45465: Error: selected processor does not support ARM mode `fmrrd r0,r1,d0'
/fpc/rtl/units/arm-linux/system.s:47271: Error: selected processor does not support ARM mode `fstmiax r0!,{d8,d9,d10,d11,d12,d13,d14,d15}' /fpc/rtl/units/arm-linux/system.s:47294: Error: selected processor does not support ARM mode `fldmiax r12!,{d8,d9,d10,d11,d12,d13,d14,d15}' /fpc/rtl/units/arm-linux/system.s:55773: Error: selected processor does not support ARM mode `fldd d0,[r11,#4]'
/fpc/rtl/units/arm-linux/system.s:55795: Error: selected processor does not support ARM mode `fmrrd r2,r3,d0'
/fpc/rtl/units/arm-linux/system.s:55827: Error: selected processor does not support ARM mode `fldd d0,[r11,#4]'
/fpc/rtl/units/arm-linux/system.s:55849: Error: selected processor does not support ARM mode `fmrrd r2,r3,d0'

Any idea what exactly these errors mean (e.g. do any processors support these instructions and if so which ones), what is causing this (e.g. why is freepascal generating these instructions) and what if anything I can do about it?

Reply by email

Sven Barth
to peter green
peter green wrote 45 lines
I decided to take another look at the freepascal armhf issue and decided that the first step would be to build freepascal with vfp enabled but still the softfloat ABI then once that was working. (note: i'm currently working on upstream fpc svn, if/when I get things working reasonablly on armhf I will look into backporting to the version in debian) Unfortunately when I try to build freepascal with vfp enabled make all 'OPT=-dFPC_ARMEL -CfVFPV3' I get assembler errors. /fpc/rtl/units/arm-linux/system.s:43697: Error: selected processor does not support ARM mode `fmdrr d0,r2,r3' /fpc/rtl/units/arm-linux/system.s:43698: Error: selected processor does not support ARM mode `fmrrd r2,r3,d0' /fpc/rtl/units/arm-linux/system.s:45460: Error: selected processor does not support ARM mode `fmsr s0,r0' /fpc/rtl/units/arm-linux/system.s:45461: Error: selected processor does not support ARM mode `fuitod d0,s0' /fpc/rtl/units/arm-linux/system.s:45463: Error: selected processor does not support ARM mode `fldd d1,[r0]' /fpc/rtl/units/arm-linux/system.s:45464: Error: selected processor does not support ARM mode `fmuld d0,d0,d1' /fpc/rtl/units/arm-linux/system.s:45465: Error: selected processor does not support ARM mode `fmrrd r0,r1,d0' /fpc/rtl/units/arm-linux/system.s:47271: Error: selected processor does not support ARM mode `fstmiax r0!,{d8,d9,d10,d11,d12,d13,d14,d15}' /fpc/rtl/units/arm-linux/system.s:47294: Error: selected processor does not support ARM mode `fldmiax r12!,{d8,d9,d10,d11,d12,d13,d14,d15}' /fpc/rtl/units/arm-linux/system.s:55773: Error: selected processor does not support ARM mode `fldd d0,[r11,#4]' /fpc/rtl/units/arm-linux/system.s:55795: Error: selected processor does not support ARM mode `fmrrd r2,r3,d0' /fpc/rtl/units/arm-linux/system.s:55827: Error: selected processor does not support ARM mode `fldd d0,[r11,#4]' /fpc/rtl/units/arm-linux/system.s:55849: Error: selected processor does not support ARM mode `fmrrd r2,r3,d0' Any idea what exactly these errors mean (e.g. do any processors support these instructions and if so which ones), what is causing this (e.g. why is freepascal generating these instructions) and what if anything I can do about it?

Maybe this will help you:
http://wiki.freepascal.org/FPC_New_Features_2.6.0#Support_for_VFPv2_and_VFPv3

Thus additionially defining -Cparmv6 might allow the build to be completed.

Regards,
Sven

Reply by email

peter green
to Sven Barth
Show quoted text 7 lines
Maybe this will help you: http://wiki.freepascal.org/FPC_New_Features_2.6.0#Support_for_VFPv2_and_VFPv3 Thus additionially defining -Cparmv6 might allow the build to be completed.

It didn't.

I did find the issue though, it seems freepascal wasn't passing a fpu type parameter to the assembler for any case except softfloat.

I fixed that but in the process discovered that freepascals vfpv3 support is the "d32" version of vfpv3 (yes arm floating point is a mess) so I decided to try and add a vfpv3_d16 "fpu type". However when I did so the compiler started outputting a rfs and wfs instruction when compling the system unit which the assembler didn't like. I eventually tracked that down to inline assembler in the RTL. Maybe we should add a FPU_VFP define that is defined for all VFP variants so we don't have to mess with the ifdefs in the RTL every time we want to add a variant of VFP (afaict there are a lot of VFP variants).

In the process of working on that I discovered another problem, according to a comment in the source freepascal's register allocation does not currently understand the concept of two single precision registers that overlap with one double precision register, this will make correctly implementing the "eabi vfp hardfloat" calling convention difficult but i'm going to get passing doubles working before I worry about the complications involved in passing singles (and even worse passing a mixture of singles and doubles).

I've attatched the diff of what i've done so far.

P.S. (mostly as a note to self) i'm currently using the following commands to build

make compiler_cycle 'OPT=-dFPC_ARMEL' 2>&1 | tee ../buildlog cp compiler/ppcarm /
make compiler_cycle PP=/ppcarm 'OPT=-dFPC_ARMEL -CfVFPV3_D16 -CpARMV7' 2>&1 | tee ../buildlog

Next step will be to modify the code in cpupara.pas to actually start passing values in vfp registers.

Reply by email