Bug 202641 - bsd.cpu.mk: add softfp to MACHINE_CPU
Summary: bsd.cpu.mk: add softfp to MACHINE_CPU
Status: Closed Works As Intended
Alias: None
Product: Base System
Classification: Unclassified
Component: arm (show other bugs)
Version: CURRENT
Hardware: Any Any
: --- Affects Only Me
Assignee: Warner Losh
URL:
Keywords: feature, patch
Depends on:
Blocks:
 
Reported: 2015-08-25 05:30 UTC by Jan Beich
Modified: 2018-11-01 16:06 UTC (History)
2 users (show)

See Also:


Attachments
v0 (431 bytes, patch)
2015-08-25 05:30 UTC, Jan Beich
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jan Beich freebsd_committer freebsd_triage 2015-08-25 05:30:37 UTC
Created attachment 160329 [details]
v0

In case of slow floating point emulation some ports may opt to use integer routines e.g., libvorbis -> libtremor. C preprocessor already defines __SOFTFP__ macro but it cannot be easily used in Makefiles.
Comment 1 Warner Losh freebsd_committer freebsd_triage 2015-08-25 16:12:33 UTC
That's perfect.  I'll add that to the list.
Comment 2 commit-hook freebsd_committer freebsd_triage 2015-08-25 17:12:35 UTC
A commit references this bug:

Author: imp
Date: Tue Aug 25 17:11:50 UTC 2015
New revision: 287137
URL: https://svnweb.freebsd.org/changeset/base/287137

Log:
  Add softfp to MACHINE_CPU more often when we're compiling for soft
  float targets. It is added for booke on powerpc and all arm with hf in
  the string. Also add arm to all arm builds and armv6 to armv6 and
  newer builds.

  PR: 202641

Changes:
  head/share/mk/bsd.cpu.mk
Comment 3 Ian Lepore freebsd_committer freebsd_triage 2015-08-26 02:47:47 UTC
For the record: armv6 does not use "slow floating point emulation" under any circumstances.  It uses library functions which check whether floating point hardware is available.  It is always available on all armv6 systems we support, which causes the library functions to use native floating point hardware instructions.
Comment 4 Warner Losh freebsd_committer freebsd_triage 2015-08-26 16:59:54 UTC
After consulting with the arm folks, some of which were really unhappy, I'm going to back out this change. armv6 is a hybrid at the moment. It is softfp and it isn't softfp. It uses the softfp ABI, so you can't compile -mhardfp. But it does allow use of floating point registers, which would militate against defining it to pick what kind of algorithm to use.

All this confusion will soon go away (arm will be softfp with no hard float at all, and armv6 will be hardfp for both API and register use). Once that happens, we can revisit this issue. Other changes to bsd.cpu.mk are needed to reflect the richness of the ARM ecosystem (like we reflect the richness of the Intel/Amd/etc ecosystem) as well.
Comment 5 Warner Losh freebsd_committer freebsd_triage 2018-11-01 16:06:26 UTC
Nothing to fix.