+2008-06-26 Richard Sandiford <rdsandiford@googlemail.com>
+
+ * libfuncs.h (LTI_synchronize): New libfunc_index.
+ (synchronize_libfunc): Declare.
+ * builtins.c (expand_builtin_synchronize): Consider using
+ synchronize_libfunc before falling back on an asm blockage.
+ * config/mips/mips.c: Include libfuncs.h
+ (mips_init_libfuncs): Initialize synchronize_libfunc for TARGET_MIPS16.
+
2008-06-26 Nathan Froyd <froydnj@codesourcery.com>
* config/rs6000/rs6000.c (emit_allocate_stack): Add copy_r11
}
#endif
+ if (synchronize_libfunc != NULL_RTX)
+ {
+ emit_library_call (synchronize_libfunc, LCT_NORMAL, VOIDmode, 0);
+ return;
+ }
+
/* If no explicit memory barrier instruction is available, create an
empty asm stmt with a memory clobber. */
x = build4 (ASM_EXPR, void_type_node, build_string (0, ""), NULL, NULL,
#include "function.h"
#include "expr.h"
#include "optabs.h"
+#include "libfuncs.h"
#include "flags.h"
#include "reload.h"
#include "tm_p.h"
else
/* Register the gofast functions if selected using --enable-gofast. */
gofast_maybe_init_libfuncs ();
+
+ /* The MIPS16 ISA does not have an encoding for "sync", so we rely
+ on an external non-MIPS16 routine to implement __sync_synchronize. */
+ if (TARGET_MIPS16)
+ synchronize_libfunc = init_one_libfunc ("__sync_synchronize");
}
/* Return the length of INSN. LENGTH is the initial length computed by
LTI_profile_function_entry,
LTI_profile_function_exit,
+ LTI_synchronize,
+
LTI_gcov_flush,
LTI_MAX
#define profile_function_entry_libfunc (libfunc_table[LTI_profile_function_entry])
#define profile_function_exit_libfunc (libfunc_table[LTI_profile_function_exit])
+#define synchronize_libfunc (libfunc_table[LTI_synchronize])
+
#define gcov_flush_libfunc (libfunc_table[LTI_gcov_flush])
#endif /* GCC_LIBFUNCS_H */