File tree 5 files changed +22
-82
lines changed 5 files changed +22
-82
lines changed Original file line number Diff line number Diff line change 19
19
#include " src/__support/macros/properties/cpu_features.h" // LIBC_TARGET_CPU_HAS_FMA
20
20
#include " src/math/generic/sincos_eval.h"
21
21
22
- #ifdef LIBC_TARGET_CPU_HAS_FMA
23
- #include " range_reduction_double_fma.h"
24
-
25
- using LIBC_NAMESPACE::fma::FAST_PASS_EXPONENT;
26
- using LIBC_NAMESPACE::fma::ONE_TWENTY_EIGHT_OVER_PI;
27
- using LIBC_NAMESPACE::fma::range_reduction_small;
28
- using LIBC_NAMESPACE::fma::SIN_K_PI_OVER_128;
29
-
30
- LIBC_INLINE constexpr bool NO_FMA = false ;
31
- #else
32
- #include " range_reduction_double_nofma.h"
33
-
34
- using LIBC_NAMESPACE::nofma::FAST_PASS_EXPONENT;
35
- using LIBC_NAMESPACE::nofma::ONE_TWENTY_EIGHT_OVER_PI;
36
- using LIBC_NAMESPACE::nofma::range_reduction_small;
37
- using LIBC_NAMESPACE::nofma::SIN_K_PI_OVER_128;
38
-
39
- LIBC_INLINE constexpr bool NO_FMA = true ;
40
- #endif // LIBC_TARGET_CPU_HAS_FMA
41
-
42
22
// TODO: We might be able to improve the performance of large range reduction of
43
23
// non-FMA targets further by operating directly on 25-bit chunks of 128/pi and
44
24
// pre-split SIN_K_PI_OVER_128, but that might double the memory footprint of
Original file line number Diff line number Diff line change 18
18
#include " src/__support/integer_literals.h"
19
19
#include " src/__support/macros/config.h"
20
20
21
+ #ifdef LIBC_TARGET_CPU_HAS_FMA
22
+ #include " range_reduction_double_fma.h"
23
+
24
+ // With FMA, we limit the maxmimum exponent to be 2^16, so that the error bound
25
+ // from the fma::range_reduction_small is bounded by 2^-88 instead of 2^-72.
26
+ #define FAST_PASS_EXPONENT 16
27
+ using LIBC_NAMESPACE::fma::ONE_TWENTY_EIGHT_OVER_PI;
28
+ using LIBC_NAMESPACE::fma::range_reduction_small;
29
+ using LIBC_NAMESPACE::fma::SIN_K_PI_OVER_128;
30
+
31
+ LIBC_INLINE constexpr bool NO_FMA = false ;
32
+ #else
33
+ #include " range_reduction_double_nofma.h"
34
+
35
+ using LIBC_NAMESPACE::nofma::FAST_PASS_EXPONENT;
36
+ using LIBC_NAMESPACE::nofma::ONE_TWENTY_EIGHT_OVER_PI;
37
+ using LIBC_NAMESPACE::nofma::range_reduction_small;
38
+ using LIBC_NAMESPACE::nofma::SIN_K_PI_OVER_128;
39
+
40
+ LIBC_INLINE constexpr bool NO_FMA = true ;
41
+ #endif // LIBC_TARGET_CPU_HAS_FMA
42
+
21
43
namespace LIBC_NAMESPACE_DECL {
22
44
23
45
namespace generic {
Original file line number Diff line number Diff line change 20
20
#include " src/__support/macros/properties/cpu_features.h" // LIBC_TARGET_CPU_HAS_FMA
21
21
#include " src/math/generic/sincos_eval.h"
22
22
23
- #ifdef LIBC_TARGET_CPU_HAS_FMA
24
- #include " range_reduction_double_fma.h"
25
-
26
- using LIBC_NAMESPACE::fma::FAST_PASS_EXPONENT;
27
- using LIBC_NAMESPACE::fma::ONE_TWENTY_EIGHT_OVER_PI;
28
- using LIBC_NAMESPACE::fma::range_reduction_small;
29
- using LIBC_NAMESPACE::fma::SIN_K_PI_OVER_128;
30
-
31
- LIBC_INLINE constexpr bool NO_FMA = false ;
32
- #else
33
- #include " range_reduction_double_nofma.h"
34
-
35
- using LIBC_NAMESPACE::nofma::FAST_PASS_EXPONENT;
36
- using LIBC_NAMESPACE::nofma::ONE_TWENTY_EIGHT_OVER_PI;
37
- using LIBC_NAMESPACE::nofma::range_reduction_small;
38
- using LIBC_NAMESPACE::nofma::SIN_K_PI_OVER_128;
39
-
40
- LIBC_INLINE constexpr bool NO_FMA = true ;
41
- #endif // LIBC_TARGET_CPU_HAS_FMA
42
-
43
23
// TODO: We might be able to improve the performance of large range reduction of
44
24
// non-FMA targets further by operating directly on 25-bit chunks of 128/pi and
45
25
// pre-split SIN_K_PI_OVER_128, but that might double the memory footprint of
Original file line number Diff line number Diff line change 21
21
#include " src/__support/macros/properties/cpu_features.h" // LIBC_TARGET_CPU_HAS_FMA
22
22
#include " src/math/generic/sincos_eval.h"
23
23
24
- #ifdef LIBC_TARGET_CPU_HAS_FMA
25
- #include " range_reduction_double_fma.h"
26
-
27
- using LIBC_NAMESPACE::fma::FAST_PASS_EXPONENT;
28
- using LIBC_NAMESPACE::fma::ONE_TWENTY_EIGHT_OVER_PI;
29
- using LIBC_NAMESPACE::fma::range_reduction_small;
30
- using LIBC_NAMESPACE::fma::SIN_K_PI_OVER_128;
31
-
32
- LIBC_INLINE constexpr bool NO_FMA = false ;
33
- #else
34
- #include " range_reduction_double_nofma.h"
35
-
36
- using LIBC_NAMESPACE::nofma::FAST_PASS_EXPONENT;
37
- using LIBC_NAMESPACE::nofma::ONE_TWENTY_EIGHT_OVER_PI;
38
- using LIBC_NAMESPACE::nofma::range_reduction_small;
39
- using LIBC_NAMESPACE::nofma::SIN_K_PI_OVER_128;
40
-
41
- LIBC_INLINE constexpr bool NO_FMA = true ;
42
- #endif // LIBC_TARGET_CPU_HAS_FMA
43
-
44
24
// TODO: We might be able to improve the performance of large range reduction of
45
25
// non-FMA targets further by operating directly on 25-bit chunks of 128/pi and
46
26
// pre-split SIN_K_PI_OVER_128, but that might double the memory footprint of
Original file line number Diff line number Diff line change 21
21
#include " src/__support/macros/optimization.h" // LIBC_UNLIKELY
22
22
#include " src/__support/macros/properties/cpu_features.h" // LIBC_TARGET_CPU_HAS_FMA
23
23
24
- #ifdef LIBC_TARGET_CPU_HAS_FMA
25
- #include " range_reduction_double_fma.h"
26
-
27
- // With FMA, we limit the maxmimum exponent to be 2^16, so that the error bound
28
- // from the fma::range_reduction_small is bounded by 2^-88 instead of 2^-72.
29
- #define FAST_PASS_EXPONENT 16
30
- using LIBC_NAMESPACE::fma::ONE_TWENTY_EIGHT_OVER_PI;
31
- using LIBC_NAMESPACE::fma::range_reduction_small;
32
- using LIBC_NAMESPACE::fma::SIN_K_PI_OVER_128;
33
-
34
- LIBC_INLINE constexpr bool NO_FMA = false ;
35
- #else
36
- #include " range_reduction_double_nofma.h"
37
-
38
- using LIBC_NAMESPACE::nofma::FAST_PASS_EXPONENT;
39
- using LIBC_NAMESPACE::nofma::ONE_TWENTY_EIGHT_OVER_PI;
40
- using LIBC_NAMESPACE::nofma::range_reduction_small;
41
- using LIBC_NAMESPACE::nofma::SIN_K_PI_OVER_128;
42
-
43
- LIBC_INLINE constexpr bool NO_FMA = true ;
44
- #endif // LIBC_TARGET_CPU_HAS_FMA
45
-
46
24
// TODO: We might be able to improve the performance of large range reduction of
47
25
// non-FMA targets further by operating directly on 25-bit chunks of 128/pi and
48
26
// pre-split SIN_K_PI_OVER_128, but that might double the memory footprint of
You can’t perform that action at this time.
0 commit comments