File: ireg.m4

package info (click to toggle)
ffcall 2.1-2
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 5,808 kB
  • sloc: asm: 43,409; ansic: 23,224; sh: 5,383; makefile: 1,517; cpp: 2
file content (40 lines) | stat: -rw-r--r-- 1,528 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
dnl -*- Autoconf -*-
dnl Copyright (C) 1993-2017 Free Software Foundation, Inc.
dnl This file is free software, distributed under the terms of the GNU
dnl General Public License as published by the Free Software Foundation;
dnl either version 2 of the License, or (at your option) any later version.
dnl As a special exception to the GNU General Public License, this file
dnl may be distributed as part of a program that contains a configuration
dnl script generated by Autoconf, under the same distribution terms as
dnl the rest of that program.

dnl From Bruno Haible, Marcus Daniels, Sam Steingold.

AC_PREREQ([2.13])

AC_DEFUN([IREG_DOC],[whether floats are returned in integer registers])
AC_DEFUN([FFCALL_IREG_FLOAT_RETURN],
[
  AC_CACHE_CHECK([IREG_DOC], [ffcall_cv_c_float_return_ireg],
    [AC_TRY_RUN(GL_NOCRASH
       [float x = (float)1.2;
        float y = (float)1.3;
        float fun () { return x*y; }
        int main()
        { nocrash_init();
         {int val = (* (int (*) ()) fun) ();
          return !(val == 0x3FC7AE15 || val == 0x15AEC73F);
        }}
       ],
       [ffcall_cv_c_float_return_ireg=yes],
       [ffcall_cv_c_float_return_ireg=no],
       [dnl When cross-compiling, assume no, because that's how it comes out on
        dnl most platforms with floating-point unit, including m68k-linux.
        ffcall_cv_c_float_return_ireg="guessing no"
       ])
    ])
  case "$ffcall_cv_c_float_return_ireg" in
    *yes) AC_DEFINE([__IREG_FLOAT_RETURN__], [], IREG_DOC) ;;
    *no) ;;
  esac
])