fast_math: selectively use GCC rounding builtins when available
authorPaul E. Murphy <pmur@users.noreply.github.com>
Mon, 22 Jul 2019 19:23:49 +0000 (14:23 -0500)
committerPaul E. Murphy <pmur@users.noreply.github.com>
Wed, 7 Aug 2019 20:01:18 +0000 (15:01 -0500)
commit3f92bcc11ab122b6cb5167c3548a0e2ce306c94d
treeed39ac0464a156e0ac37c2bca376bddbc1d83d8d
parentb2135be5942c98cd638f3cef4845672573668d73
fast_math: selectively use GCC rounding builtins when available

Add a new macro definition OPENCV_USE_FASTMATH_GCC_BUILTINS to enable
usage of GCC inline math functions, if available and requested by the
user.

Likewise, enable it for POWER. This is nearly always a substantial
improvement over using integer manipulation as most operations can
be done in several instructions with no branching. The result is a
1.5-1.8x speedup in the ceil/floor operations.

1. As tested with AT 12.0-1 (GCC 8.3.1) compiler on P9 LE.
modules/core/include/opencv2/core/fast_math.hpp