VirtualBox

source: kBuild/trunk/src/grep/m4/fpieee.m4

Last change on this file was 3529, checked in by bird, 3 years ago

Imported grep 3.7 from grep-3.7.tar.gz (sha256: c22b0cf2d4f6bbe599c902387e8058990e1eee99aef333a203829e5fd3dbb342), applying minimal auto-props.

  • Property svn:eol-style set to LF
File size: 2.2 KB
Line 
1# fpieee.m4 serial 2 -*- coding: utf-8 -*-
2dnl Copyright (C) 2007, 2009-2021 Free Software Foundation, Inc.
3dnl This file is free software; the Free Software Foundation
4dnl gives unlimited permission to copy and/or distribute it,
5dnl with or without modifications, as long as this notice is preserved.
6
7dnl IEEE 754 standardized three items:
8dnl - The formats of single-float and double-float - nowadays commonly
9dnl available as 'float' and 'double' in C and C++.
10dnl No autoconf test needed.
11dnl - The overflow and division by zero behaviour: The result are values
12dnl '±Inf' and 'NaN', rather than exceptions as it was before.
13dnl This file provides an autoconf macro for ensuring this behaviour of
14dnl floating-point operations.
15dnl - A set of conditions (overflow, underflow, inexact, etc.) which can
16dnl be configured to trigger an exception.
17dnl This cannot be done in a portable way: it depends on the compiler,
18dnl libc, kernel, and CPU. No autoconf macro is provided for this.
19
20dnl Ensure non-trapping behaviour of floating-point overflow and
21dnl floating-point division by zero.
22dnl (For integer overflow, see gcc's -ftrapv option; for integer division by
23dnl zero, see the autoconf macro in intdiv0.m4.)
24
25AC_DEFUN([gl_FP_IEEE],
26[
27 AC_REQUIRE([AC_PROG_CC])
28 AC_REQUIRE([AC_CANONICAL_HOST])
29 # IEEE behaviour is the default on all CPUs except Alpha and SH
30 # (according to the test results of Bruno Haible's ieeefp/fenv_default.m4
31 # and the GCC 4.1.2 manual).
32 case "$host_cpu" in
33 alpha*)
34 # On Alpha systems, a compiler option provides the behaviour.
35 # See the ieee(3) manual page, also available at
36 # <https://backdrift.org/man/tru64/man3/ieee.3.html>
37 if test -n "$GCC"; then
38 # GCC has the option -mieee.
39 # For full IEEE compliance (rarely needed), use option -mieee-with-inexact.
40 CPPFLAGS="$CPPFLAGS -mieee"
41 else
42 # Compaq (ex-DEC) C has the option -ieee, equivalent to -ieee_with_no_inexact.
43 # For full IEEE compliance (rarely needed), use option -ieee_with_inexact.
44 CPPFLAGS="$CPPFLAGS -ieee"
45 fi
46 ;;
47 sh*)
48 if test -n "$GCC"; then
49 # GCC has the option -mieee.
50 CPPFLAGS="$CPPFLAGS -mieee"
51 fi
52 ;;
53 esac
54])
Note: See TracBrowser for help on using the repository browser.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette