File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 250250
251251 namespace std
252252 {
253- namespace cmath_detail {
254-
255- __attribute__((always_inline)) static inline int isfinitef_impl(float my_x)
256- {
257- unsigned char my_exp { };
258-
259- asm volatile
260- (
261- "mov %0, %C1" "\n\t"
262- "lsl %0" "\n\t"
263- "mov %0, %D1" "\n\t"
264- "rol %0"
265- : "=&r" (my_exp)
266- : "r" (my_x)
267- );
268-
269- return ((my_exp != static_cast<unsigned char>(0xFFU)) ? 1 : 0);
270- }
271-
272- } // namespace cmath_detail
273-
274- inline bool isfinite (float x) { return (::std::cmath_detail::isfinitef_impl(x) == 1); }
275- inline bool isfinite (double x) { return (::std::cmath_detail::isfinitef_impl(static_cast<float>(x)) == 1); }
276- inline bool isfinite (long double x) { return (::std::cmath_detail::isfinitef_impl(static_cast<float>(x)) == 1); }
277253 inline bool isnan (float x) { return (__BUILTIN_ISNANF(x) == 1); }
278254 inline bool isnan (double x) { return (__BUILTIN_ISNAN (x) == 1); }
279255 inline bool isnan (long double x) { return (__BUILTIN_ISNANL(x) == 1); }
293269 inline bool isinf(double x) { return ::std::cmath_detail::isinf_impl(x); }
294270 inline bool isinf(long double x) { return ::std::cmath_detail::isinf_impl(x); }
295271
272+ inline bool isfinite(float x) { return ((!(::std::isinf)(x)) && (!(::std::isnan)(x))); }
273+ inline bool isfinite(double x) { return ((!(::std::isinf)(x)) && (!(::std::isnan)(x))); }
274+ inline bool isfinite(long double x) { return ((!(::std::isinf)(x)) && (!(::std::isnan)(x))); }
275+
296276 namespace cmath_detail {
297277
298278 template<typename FloatType>
You can’t perform that action at this time.
0 commit comments