Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
R
riscv-gcc-1
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lvzhengyang
riscv-gcc-1
Commits
9d465faf
Commit
9d465faf
authored
Feb 08, 2012
by
Ian Lance Taylor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
math: Compile with -mfancy-math-387 -funsafe-optimizations on x86.
From-SVN: r184015
parent
82b37806
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
57 additions
and
5 deletions
+57
-5
gcc/go/gofrontend/expressions.cc
+2
-1
libgo/Makefile.am
+3
-1
libgo/Makefile.in
+4
-1
libgo/configure
+30
-2
libgo/configure.ac
+17
-0
libgo/testsuite/Makefile.in
+1
-0
No files found.
gcc/go/gofrontend/expressions.cc
View file @
9d465faf
...
...
@@ -10027,7 +10027,8 @@ Call_expression::do_get_tree(Translate_context* context)
// This is to support builtin math functions when using 80387 math.
tree
excess_type
=
NULL_TREE
;
if
(
TREE_CODE
(
fndecl
)
==
FUNCTION_DECL
if
(
optimize
&&
TREE_CODE
(
fndecl
)
==
FUNCTION_DECL
&&
DECL_IS_BUILTIN
(
fndecl
)
&&
DECL_BUILT_IN_CLASS
(
fndecl
)
==
BUILT_IN_NORMAL
&&
nargs
>
0
...
...
libgo/Makefile.am
View file @
9d465faf
...
...
@@ -1959,7 +1959,9 @@ log/check: $(CHECK_DEPS)
math/math.lo.dep
:
$(go_math_files)
$(BUILDDEPS)
math/math.lo
:
$(go_math_files)
$(BUILDPACKAGE)
$(MKDIR_P)
$
(
@D
)
files
=
`
echo
$^
| sed
-e
's/[^ ]*\.gox//g'
`
;
\
$(LTGOCOMPILE)
$(MATH_FLAG)
-I
.
-c
-fgo-prefix
=
"libgo_
$
(@D)"
-o
$@
$$
files
math/check
:
$(CHECK_DEPS)
@
$(CHECK)
.PHONY
:
math/check
...
...
libgo/Makefile.in
View file @
9d465faf
...
...
@@ -390,6 +390,7 @@ LN_S = @LN_S@
LTLIBOBJS
=
@LTLIBOBJS@
MAINT
=
@MAINT@
MAKEINFO
=
@MAKEINFO@
MATH_FLAG
=
@MATH_FLAG@
MATH_LIBS
=
@MATH_LIBS@
MKDIR_P
=
@MKDIR_P@
NET_LIBS
=
@NET_LIBS@
...
...
@@ -4512,7 +4513,9 @@ log/check: $(CHECK_DEPS)
math/math.lo.dep
:
$(go_math_files)
$(BUILDDEPS)
math/math.lo
:
$(go_math_files)
$(BUILDPACKAGE)
$(MKDIR_P)
$
(
@D
)
files
=
`
echo
$^
| sed
-e
's/[^ ]*\.gox//g'
`
;
\
$(LTGOCOMPILE)
$(MATH_FLAG)
-I
.
-c
-fgo-prefix
=
"libgo_
$
(@D)"
-o
$@
$$
files
math/check
:
$(CHECK_DEPS)
@
$(CHECK)
.PHONY
:
math/check
...
...
libgo/configure
View file @
9d465faf
...
...
@@ -604,6 +604,7 @@ LTLIBOBJS
LIBOBJS
STRUCT_EPOLL_EVENT_FD_OFFSET
SIZEOF_STRUCT_EPOLL_EVENT
MATH_FLAG
STRINGOPS_FLAG
HAVE_WAIT4_FALSE
HAVE_WAIT4_TRUE
...
...
@@ -11101,7 +11102,7 @@ else
lt_dlunknown
=
0
;
lt_dlno_uscore
=
1
;
lt_dlneed_uscore
=
2
lt_status
=
$lt_dlunknown
cat
>
conftest.
$ac_ext
<<
_LT_EOF
#line 1110
4
"configure"
#line 1110
5
"configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
...
...
@@ -11207,7 +11208,7 @@ else
lt_dlunknown
=
0
;
lt_dlno_uscore
=
1
;
lt_dlneed_uscore
=
2
lt_status
=
$lt_dlunknown
cat
>
conftest.
$ac_ext
<<
_LT_EOF
#line 1121
0
"configure"
#line 1121
1
"configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
...
...
@@ -14707,6 +14708,33 @@ if test "$libgo_cv_c_stringops" = yes; then
fi
{
$as_echo
"
$as_me
:
${
as_lineno
-
$LINENO
}
: checking whether compiler supports -mfancy-math-387"
>
&5
$as_echo_n
"checking whether compiler supports -mfancy-math-387... "
>
&6
;
}
if
test
"
${
libgo_cv_c_fancymath
+set
}
"
=
set
;
then
:
$as_echo_n
"(cached) "
>
&6
else
CFLAGS_hold
=
$CFLAGS
CFLAGS
=
"
$CFLAGS
-mfancy-math-387"
cat
confdefs.h -
<<
_ACEOF
>conftest.
$ac_ext
/* end confdefs.h. */
int i;
_ACEOF
if
ac_fn_c_try_compile
"
$LINENO
"
;
then
:
libgo_cv_c_fancymath
=
yes
else
libgo_cv_c_fancymath
=
no
fi
rm
-f
core conftest.err conftest.
$ac_objext
conftest.
$ac_ext
CFLAGS
=
$CFLAGS_hold
fi
{
$as_echo
"
$as_me
:
${
as_lineno
-
$LINENO
}
: result:
$libgo_cv_c_fancymath
"
>
&5
$as_echo
"
$libgo_cv_c_fancymath
"
>
&6
;
}
MATH_FLAG
=
if
test
"
$libgo_cv_c_fancymath
"
=
yes
;
then
MATH_FLAG
=
"-mfancy-math-387 -funsafe-math-optimizations"
fi
CFLAGS_hold
=
$CFLAGS
CFLAGS
=
"
$CFLAGS
-D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE"
ac_fn_c_check_type
"
$LINENO
"
"off64_t"
"ac_cv_type_off64_t"
"
$ac_includes_default
"
...
...
libgo/configure.ac
View file @
9d465faf
...
...
@@ -522,6 +522,23 @@ if test "$libgo_cv_c_stringops" = yes; then
fi
AC_SUBST(STRINGOPS_FLAG)
dnl For x86 we want to compile the math library with -mfancy-math-387
dnl -funsafe-math-optimizations so that we can use the builtin
dnl instructions directly.
AC_CACHE_CHECK([whether compiler supports -mfancy-math-387],
[libgo_cv_c_fancymath],
[CFLAGS_hold=$CFLAGS
CFLAGS="$CFLAGS -mfancy-math-387"
AC_COMPILE_IFELSE([int i;],
[libgo_cv_c_fancymath=yes],
[libgo_cv_c_fancymath=no])
CFLAGS=$CFLAGS_hold])
MATH_FLAG=
if test "$libgo_cv_c_fancymath" = yes; then
MATH_FLAG="-mfancy-math-387 -funsafe-math-optimizations"
fi
AC_SUBST(MATH_FLAG)
CFLAGS_hold=$CFLAGS
CFLAGS="$CFLAGS -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE"
AC_CHECK_TYPES([off64_t])
...
...
libgo/testsuite/Makefile.in
View file @
9d465faf
...
...
@@ -108,6 +108,7 @@ LN_S = @LN_S@
LTLIBOBJS
=
@LTLIBOBJS@
MAINT
=
@MAINT@
MAKEINFO
=
@MAKEINFO@
MATH_FLAG
=
@MATH_FLAG@
MATH_LIBS
=
@MATH_LIBS@
MKDIR_P
=
@MKDIR_P@
NET_LIBS
=
@NET_LIBS@
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment