Skip to content

Commit

Permalink
fbc: add ARM hard float cpu/arch options
Browse files Browse the repository at this point in the history
- add FB_CPUTYPE_ARMV6_FP for -march=armv6+fp
- add FB_CPUTYPE_ARMV7A_FP for -march=armv7-a+fp
- starting with gcc 8 -march accepts '+fp' feature specifier, however
  appears that on some platforms since porting fbc to ARM, gcc has been
  configured to have hard-float by default even if only
  -march=armv6|armv7-a was passed to gcc
- and this appears to have change in at least debian 12 / gcc 12
  hard-float is not implicitly enabled if only -march=armv6|armv7-a
  was passed

example:
  fbc -arch=armv6 ...
  fbc -arch=armv6+fp ...
  fbc -arch=armv7-a ...
  fbc -arch=armv7-a+fp ...
  • Loading branch information
jayrm committed Dec 28, 2023
1 parent b7cfdf9 commit 66f9c8a
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 0 deletions.
2 changes: 2 additions & 0 deletions changelog.txt
Expand Up @@ -3,6 +3,8 @@ Version 1.10.2
[changed]

[added]
fbc: add FB_CPUTYPE_ARMV6_FP for -march=armv6+fp
fbc: add FB_CPUTYPE_ARMV7A_FP for -march=armv7-a+fp

[fixed]

Expand Down
2 changes: 2 additions & 0 deletions src/compiler/fb.bas
Expand Up @@ -268,7 +268,9 @@ dim shared as FBCPUTYPEINFO cputypeinfo(0 to FB_CPUTYPE__COUNT-1) = _
( @"prescott", @"pentium4-sse3", FB_CPUFAMILY_X86 , 32, FALSE ), _ '' FB_CPUTYPE_PENTIUMSSE3
( NULL , @"x86-64" , FB_CPUFAMILY_X86_64 , 64, FALSE ), _ '' FB_CPUTYPE_X86_64
( NULL , @"armv6" , FB_CPUFAMILY_ARM , 32, FALSE ), _ '' FB_CPUTYPE_ARMV6
( NULL , @"armv6+fp" , FB_CPUFAMILY_ARM , 32, FALSE ), _ '' FB_CPUTYPE_ARMV6_FP
( NULL , @"armv7-a" , FB_CPUFAMILY_ARM , 32, FALSE ), _ '' FB_CPUTYPE_ARMV7A
( NULL , @"armv7-a+fp" , FB_CPUFAMILY_ARM , 32, FALSE ), _ '' FB_CPUTYPE_ARMV7A_FP
( @"armv8-a" , @"aarch64" , FB_CPUFAMILY_AARCH64, 64, FALSE ), _ '' FB_CPUTYPE_AARCH64
( NULL , @"powerpc" , FB_CPUFAMILY_PPC , 32, TRUE ), _ '' FB_CPUTYPE_PPC
( NULL , @"powerpc64" , FB_CPUFAMILY_PPC64 , 64, TRUE ), _ '' FB_CPUTYPE_PPC64
Expand Down
2 changes: 2 additions & 0 deletions src/compiler/fb.bi
Expand Up @@ -164,7 +164,9 @@ enum FB_CPUTYPE
FB_CPUTYPE_PENTIUMSSE3
FB_CPUTYPE_X86_64
FB_CPUTYPE_ARMV6
FB_CPUTYPE_ARMV6_FP
FB_CPUTYPE_ARMV7A
FB_CPUTYPE_ARMV7A_FP
FB_CPUTYPE_AARCH64
FB_CPUTYPE_PPC
FB_CPUTYPE_PPC64
Expand Down
2 changes: 2 additions & 0 deletions src/compiler/fbc.bas
Expand Up @@ -1510,7 +1510,9 @@ dim shared as FBGNUARCHINFO gnuarchmap(0 to ...) => _
(@"x86_64" , FB_DEFAULT_CPUTYPE_X86_64 ), _
(@"amd64" , FB_DEFAULT_CPUTYPE_X86_64 ), _
(@"armv6" , FB_CPUTYPE_ARMV6 ), _
(@"armv6+fp" , FB_CPUTYPE_ARMV6_FP ), _
(@"armv7a" , FB_CPUTYPE_ARMV7A ), _
(@"armv7a+fp" , FB_CPUTYPE_ARMV7A_FP ), _
(@"arm" , FB_DEFAULT_CPUTYPE_ARM ), _
(@"aarch64" , FB_DEFAULT_CPUTYPE_AARCH64), _
(@"ppc" , FB_DEFAULT_CPUTYPE_PPC ), _
Expand Down

0 comments on commit 66f9c8a

Please sign in to comment.