Bug 233037

Summary: math/gmp should enable assembly optimizations by default
Product: Ports & Packages Reporter: Dennis Clarke <dclarke>
Component: Individual Port(s)Assignee: Alex Dupre <ale>
Status: Closed Works As Intended    
Severity: Affects Many People Flags: bugzilla: maintainer-feedback? (ale)
Priority: ---    
Version: Latest   
Hardware: amd64   
OS: Any   

Description Dennis Clarke 2018-11-06 19:09:28 UTC
This is more of an RFE than a "bug" but none the less I see that a
build of libgmp will disable the extensive assembly optimizations
by default. This is a significant performance impact by default and
the lib has been tested more than just about any other I know of.
It would be quite dafe and in fact recommended to enable these code
pieces that are hand crafted for certain architectures. 

Given that gmp and mpfr and mpc and isl are required for gcc bootstrap
this has also been tested extensively without any negative side effects.
Comment 1 Alex Dupre freebsd_committer 2018-11-09 16:58:29 UTC
The reason for the option to be disabled is not the instability of the assembly code. Assembly code is not disabled completely (no --disable-assembly configure arg is used), it's enabled for the generic hardware platform (amd64, i386, etc.).
What the CPU_OPT option does is to enable the very processor specific assembly code (eg. haswell cpu), that works only on the same CPU where you built GMP, so it's not suitable for package building.
Comment 2 Dennis Clarke 2019-07-16 11:13:50 UTC
(In reply to Alex Dupre from comment #1)
Sorry I did not follow up on this. 

Brilliant reply and makes perfect sense for a package that needs
to work across a wide array of hardware.