* include/ruby/defines.h (FLUSH_REGISTER_WINDOWS): move sparc asm code
to a separete file sparc.c for preventing inlining optimization. Patched by Jurij Smakov. [Bug #5244] [ruby-core:40685] * sparc.c (rb_sparc_flush_register_windows): ditto. * configure.in: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33757 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
9cdd62bd19
commit
fa00b6516c
@ -1,3 +1,11 @@
|
|||||||
|
Tue Nov 15 13:38:14 2011 Naohisa Goto <ngotogenome@gmail.com>
|
||||||
|
|
||||||
|
* include/ruby/defines.h (FLUSH_REGISTER_WINDOWS): move sparc asm code
|
||||||
|
to a separete file sparc.c for preventing inlining optimization.
|
||||||
|
Patched by Jurij Smakov. [Bug #5244] [ruby-core:40685]
|
||||||
|
* sparc.c (rb_sparc_flush_register_windows): ditto.
|
||||||
|
* configure.in: ditto.
|
||||||
|
|
||||||
Tue Nov 15 13:11:35 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
|
Tue Nov 15 13:11:35 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
|
||||||
|
|
||||||
* include/ruby/ruby.h: get rid of gcc specific rb_long2int(),
|
* include/ruby/ruby.h: get rid of gcc specific rb_long2int(),
|
||||||
|
@ -1087,7 +1087,8 @@ AS_CASE(["$target_cpu"],
|
|||||||
[CFLAGS="-mieee $CFLAGS"],
|
[CFLAGS="-mieee $CFLAGS"],
|
||||||
[osf*], # ccc
|
[osf*], # ccc
|
||||||
[CFLAGS="-ieee $CFLAGS"],
|
[CFLAGS="-ieee $CFLAGS"],
|
||||||
)])
|
)],
|
||||||
|
[sparc*], [AC_LIBOBJ([sparc])])
|
||||||
|
|
||||||
ac_cv_header_net_socket_h=${ac_cv_header_net_socket_h=no}
|
ac_cv_header_net_socket_h=${ac_cv_header_net_socket_h=no}
|
||||||
if test "$ac_cv_header_net_socket_h" = yes; then
|
if test "$ac_cv_header_net_socket_h" = yes; then
|
||||||
|
@ -198,21 +198,8 @@ void xfree(void*);
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(__sparc)
|
#if defined(__sparc)
|
||||||
static inline void
|
void rb_sparc_flush_register_windows();
|
||||||
flush_register_windows(void)
|
# define FLUSH_REGISTER_WINDOWS rb_sparc_flush_register_windows()
|
||||||
{
|
|
||||||
asm
|
|
||||||
#ifdef __GNUC__
|
|
||||||
volatile
|
|
||||||
#endif
|
|
||||||
# if SIZEOF_VOIDP > 4 /* workaround for Debian Sparc quirk */
|
|
||||||
("flushw")
|
|
||||||
# else
|
|
||||||
("ta 0x03")
|
|
||||||
# endif /* trap always to flush register windows if we are on a Sparc system */
|
|
||||||
;
|
|
||||||
}
|
|
||||||
# define FLUSH_REGISTER_WINDOWS flush_register_windows()
|
|
||||||
#elif defined(__ia64)
|
#elif defined(__ia64)
|
||||||
void *rb_ia64_bsp(void);
|
void *rb_ia64_bsp(void);
|
||||||
void rb_ia64_flushrs(void);
|
void rb_ia64_flushrs(void);
|
||||||
|
30
sparc.c
Normal file
30
sparc.c
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
/********************************************************************
|
||||||
|
Flush register windows on sparc.
|
||||||
|
|
||||||
|
This function is in a separate file to prevent inlining. The "flushw"
|
||||||
|
assembler instruction used on sparcv9 flushes all register windows
|
||||||
|
except the current one, so if it is inlined, the current register
|
||||||
|
window of the process executing the instruction will not be flushed
|
||||||
|
correctly.
|
||||||
|
|
||||||
|
See http://redmine.ruby-lang.org/issues/5244 for discussion.
|
||||||
|
*********************************************************************/
|
||||||
|
void rb_sparc_flush_register_windows()
|
||||||
|
{
|
||||||
|
asm
|
||||||
|
#ifdef __GNUC__
|
||||||
|
__volatile__
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* This condition should be in sync with one in configure.in */
|
||||||
|
#if defined(__sparcv9) || defined(__sparc_v9__) || defined(__arch64__)
|
||||||
|
# ifdef __GNUC__
|
||||||
|
("flushw" : : : "%o7")
|
||||||
|
# else
|
||||||
|
("flushw")
|
||||||
|
# endif /* __GNUC__ */
|
||||||
|
#else
|
||||||
|
("ta 0x03")
|
||||||
|
#endif
|
||||||
|
;
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user