346 |
|
AC_CHECK_FUNCS(sigaction signal) |
347 |
|
AC_CHECK_FUNCS(mmap mprotect munmap) |
348 |
|
AC_CHECK_FUNCS(vm_allocate vm_deallocate vm_protect) |
349 |
< |
AC_CHECK_FUNCS(posix_memalign memalign valloc) |
350 |
< |
AC_CHECK_FUNCS(exp2f log2f exp2 log2 trunc) |
349 |
> |
AC_CHECK_FUNCS(exp2f log2f exp2 log2) |
350 |
> |
AC_CHECK_FUNCS(floorf roundf ceilf truncf floor round ceil trunc) |
351 |
|
|
352 |
|
dnl Darwin seems to define mach_task_self() instead of task_self(). |
353 |
|
AC_CHECK_FUNCS(mach_task_self task_self) |
999 |
|
fi |
1000 |
|
AC_MSG_RESULT($WANT_ADDRESSING_MODE) |
1001 |
|
|
1002 |
+ |
dnl Utility macro used by next two tests. |
1003 |
+ |
dnl AC_EXAMINE_OBJECT(C source code, |
1004 |
+ |
dnl commands examining object file, |
1005 |
+ |
dnl [commands to run if compile failed]): |
1006 |
+ |
dnl |
1007 |
+ |
dnl Compile the source code to an object file; then convert it into a |
1008 |
+ |
dnl printable representation. All unprintable characters and |
1009 |
+ |
dnl asterisks (*) are replaced by dots (.). All white space is |
1010 |
+ |
dnl deleted. Newlines (ASCII 0x10) in the input are preserved in the |
1011 |
+ |
dnl output, but runs of newlines are compressed to a single newline. |
1012 |
+ |
dnl Finally, line breaks are forcibly inserted so that no line is |
1013 |
+ |
dnl longer than 80 columns and the file ends with a newline. The |
1014 |
+ |
dnl result of all this processing is in the file conftest.dmp, which |
1015 |
+ |
dnl may be examined by the commands in the second argument. |
1016 |
+ |
dnl |
1017 |
+ |
AC_DEFUN([gcc_AC_EXAMINE_OBJECT], |
1018 |
+ |
[AC_LANG_SAVE |
1019 |
+ |
AC_LANG_C |
1020 |
+ |
dnl Next bit cribbed from AC_TRY_COMPILE. |
1021 |
+ |
cat > conftest.$ac_ext <<EOF |
1022 |
+ |
[#line __oline__ "configure" |
1023 |
+ |
#include "confdefs.h" |
1024 |
+ |
$1 |
1025 |
+ |
]EOF |
1026 |
+ |
if AC_TRY_EVAL(ac_compile); then |
1027 |
+ |
od -c conftest.o | |
1028 |
+ |
sed ['s/^[0-7]*[ ]*/ / |
1029 |
+ |
s/\*/./g |
1030 |
+ |
s/ \\n/*/g |
1031 |
+ |
s/ [0-9][0-9][0-9]/./g |
1032 |
+ |
s/ \\[^ ]/./g'] | |
1033 |
+ |
tr -d ' |
1034 |
+ |
' | tr -s '*' ' |
1035 |
+ |
' | fold | sed '$a\ |
1036 |
+ |
' > conftest.dmp |
1037 |
+ |
$2 |
1038 |
+ |
ifelse($3, , , else |
1039 |
+ |
$3 |
1040 |
+ |
)dnl |
1041 |
+ |
fi |
1042 |
+ |
rm -rf conftest* |
1043 |
+ |
AC_LANG_RESTORE]) |
1044 |
+ |
|
1045 |
+ |
dnl Floating point format probe. |
1046 |
+ |
dnl The basic concept is the same as the above: grep the object |
1047 |
+ |
dnl file for an interesting string. We have to watch out for |
1048 |
+ |
dnl rounding changing the values in the object, however; this is |
1049 |
+ |
dnl handled by ignoring the least significant byte of the float. |
1050 |
+ |
dnl |
1051 |
+ |
dnl Does not know about VAX G-float or C4x idiosyncratic format. |
1052 |
+ |
dnl It does know about PDP-10 idiosyncratic format, but this is |
1053 |
+ |
dnl not presently supported by GCC. S/390 "binary floating point" |
1054 |
+ |
dnl is in fact IEEE (but maybe we should have that in EBCDIC as well |
1055 |
+ |
dnl as ASCII?) |
1056 |
+ |
dnl |
1057 |
+ |
AC_DEFUN([gcc_AC_C_FLOAT_FORMAT], |
1058 |
+ |
[AC_CACHE_CHECK(floating point format, ac_cv_c_float_format, |
1059 |
+ |
[gcc_AC_EXAMINE_OBJECT( |
1060 |
+ |
[/* This will not work unless sizeof(double) == 8. */ |
1061 |
+ |
extern char sizeof_double_must_be_8 [sizeof(double) == 8 ? 1 : -1]; |
1062 |
+ |
|
1063 |
+ |
/* This structure must have no internal padding. */ |
1064 |
+ |
struct possibility { |
1065 |
+ |
char prefix[8]; |
1066 |
+ |
double candidate; |
1067 |
+ |
char postfix[8]; |
1068 |
+ |
}; |
1069 |
+ |
|
1070 |
+ |
#define C(cand) { "\nformat:", cand, ":tamrof\n" } |
1071 |
+ |
struct possibility table [] = |
1072 |
+ |
{ |
1073 |
+ |
C( 3.25724264705901305206e+01), /* @@IEEEFP - IEEE 754 */ |
1074 |
+ |
C( 3.53802595280598432000e+18), /* D__float - VAX */ |
1075 |
+ |
C( 5.32201830133125317057e-19), /* D.PDP-10 - PDP-10 - the dot is 0x13a */ |
1076 |
+ |
C( 1.77977764695171661377e+10), /* IBMHEXFP - s/390 format, ascii */ |
1077 |
+ |
C(-5.22995989424860458374e+10) /* IBMHEXFP - s/390 format, EBCDIC */ |
1078 |
+ |
};], |
1079 |
+ |
[if grep 'format:.@IEEEF.:tamrof' conftest.dmp >/dev/null 2>&1; then |
1080 |
+ |
ac_cv_c_float_format='IEEE (big-endian)' |
1081 |
+ |
elif grep 'format:.I@@PFE.:tamrof' conftest.dmp >/dev/null 2>&1; then |
1082 |
+ |
ac_cv_c_float_format='IEEE (big-endian)' |
1083 |
+ |
elif grep 'format:.FEEEI@.:tamrof' conftest.dmp >/dev/null 2>&1; then |
1084 |
+ |
ac_cv_c_float_format='IEEE (little-endian)' |
1085 |
+ |
elif grep 'format:.EFP@@I.:tamrof' conftest.dmp >/dev/null 2>&1; then |
1086 |
+ |
ac_cv_c_float_format='IEEE (little-endian)' |
1087 |
+ |
elif grep 'format:.__floa.:tamrof' conftest.dmp >/dev/null 2>&1; then |
1088 |
+ |
ac_cv_c_float_format='VAX D-float' |
1089 |
+ |
elif grep 'format:..PDP-1.:tamrof' conftest.dmp >/dev/null 2>&1; then |
1090 |
+ |
ac_cv_c_float_format='PDP-10' |
1091 |
+ |
elif grep 'format:.BMHEXF.:tamrof' conftest.dmp >/dev/null 2>&1; then |
1092 |
+ |
ac_cv_c_float_format='IBM 370 hex' |
1093 |
+ |
else |
1094 |
+ |
AC_MSG_ERROR(Unknown floating point format) |
1095 |
+ |
fi], |
1096 |
+ |
[AC_MSG_ERROR(compile failed)]) |
1097 |
+ |
]) |
1098 |
+ |
# IEEE is the default format. If the float endianness isn't the same |
1099 |
+ |
# as the integer endianness, we have to set FLOAT_WORDS_BIG_ENDIAN |
1100 |
+ |
# (which is a tristate: yes, no, default). This is only an issue with |
1101 |
+ |
# IEEE; the other formats are only supported by a few machines each, |
1102 |
+ |
# all with the same endianness. |
1103 |
+ |
format=IEEE_FLOAT_FORMAT |
1104 |
+ |
fbigend= |
1105 |
+ |
case $ac_cv_c_float_format in |
1106 |
+ |
'IEEE (big-endian)' ) |
1107 |
+ |
if test $ac_cv_c_bigendian = no; then |
1108 |
+ |
fbigend=1 |
1109 |
+ |
fi |
1110 |
+ |
;; |
1111 |
+ |
'IEEE (little-endian)' ) |
1112 |
+ |
if test $ac_cv_c_bigendian = yes; then |
1113 |
+ |
fbigend=0 |
1114 |
+ |
fi |
1115 |
+ |
;; |
1116 |
+ |
'VAX D-float' ) |
1117 |
+ |
format=VAX_FLOAT_FORMAT |
1118 |
+ |
;; |
1119 |
+ |
'PDP-10' ) |
1120 |
+ |
format=PDP10_FLOAT_FORMAT |
1121 |
+ |
;; |
1122 |
+ |
'IBM 370 hex' ) |
1123 |
+ |
format=IBM_FLOAT_FORMAT |
1124 |
+ |
;; |
1125 |
+ |
esac |
1126 |
+ |
AC_DEFINE_UNQUOTED(HOST_FLOAT_FORMAT, $format, |
1127 |
+ |
[Define to the floating point format of the host machine.]) |
1128 |
+ |
if test -n "$fbigend"; then |
1129 |
+ |
AC_DEFINE_UNQUOTED(HOST_FLOAT_WORDS_BIG_ENDIAN, $fbigend, |
1130 |
+ |
[Define to 1 if the host machine stores floating point numbers in |
1131 |
+ |
memory with the word containing the sign bit at the lowest address, |
1132 |
+ |
or to 0 if it does it the other way around. |
1133 |
+ |
|
1134 |
+ |
This macro should not be defined if the ordering is the same as for |
1135 |
+ |
multi-word integers.]) |
1136 |
+ |
fi |
1137 |
+ |
]) |
1138 |
+ |
|
1139 |
+ |
dnl Check for host float format |
1140 |
+ |
gcc_AC_C_FLOAT_FORMAT |
1141 |
+ |
|
1142 |
|
dnl Platform specific binary postprocessor |
1143 |
|
AC_PATH_PROG(BLESS, "true") |
1144 |
|
if [[ "x$ac_cv_pagezero_hack" = "xyes" ]]; then |
1197 |
|
if [[ "x$EMULATED_PPC" = "xyes" ]]; then |
1198 |
|
CPUSRCS="\ |
1199 |
|
../kpx_cpu/src/mathlib/ieeefp.cpp \ |
1200 |
+ |
../kpx_cpu/src/mathlib/mathlib.cpp \ |
1201 |
|
../kpx_cpu/src/cpu/ppc/ppc-cpu.cpp \ |
1202 |
|
../kpx_cpu/src/cpu/ppc/ppc-decode.cpp \ |
1203 |
|
../kpx_cpu/src/cpu/ppc/ppc-execute.cpp \ |
1238 |
|
done |
1239 |
|
fi |
1240 |
|
fi |
1241 |
< |
if [[ -z "$DYNGEN_CC" ]] || ! { echo '#include <limits>' | $DYNGEN_CC -xc++ -c -o /dev/null - >& /dev/null; }; then |
1241 |
> |
if [[ -z "$DYNGEN_CC" ]]; then |
1242 |
|
ac_cv_use_dyngen=no |
1243 |
|
fi |
1244 |
|
]) |
1284 |
|
AC_CACHE_CHECK([whether static data regions are executable], |
1285 |
|
ac_cv_have_static_data_exec, [ |
1286 |
|
AC_TRY_RUN([int main(void) { |
1287 |
< |
#if defined(__powerpc__) |
1287 |
> |
#if defined(__powerpc__) || defined(__ppc__) |
1288 |
|
static unsigned int p[8] = {0x4e800020,}; |
1289 |
|
asm volatile("dcbst 0,%0" : : "r" (p) : "memory"); |
1290 |
|
asm volatile("sync" : : : "memory"); |