mirror of
git://gcc.gnu.org/git/gcc.git
synced 2025-02-24 21:36:24 +08:00
alpha.c (alpha_atomic_assign_expand_fenv): New.
* config/alpha/alpha.c (alpha_atomic_assign_expand_fenv): New. (TARGET_ATOMIC_ASSIGN_EXPAND_FENV): New define. testsuite/ChangeLog: * lib/target-supports.exp (check_effective_target_fenv_exceptions): Add IEEE options to compile flags. * gcc.dg/atomic/c11-atomic-exec-5.c: Ditto. Add -mieee-with-inexact additional option and lower ITER_COUNT to 100 for alpha*-*-* targets. From-SVN: r212568
This commit is contained in:
parent
6259a78ac3
commit
286934b46d
@ -1,4 +1,9 @@
|
||||
2014-07-14 Jan Hubicka <hubicka@ucw.cz>
|
||||
2014-07-15 Uros Bizjak <ubizjak@gmail.com>
|
||||
|
||||
* config/alpha/alpha.c (alpha_atomic_assign_expand_fenv): New.
|
||||
(TARGET_ATOMIC_ASSIGN_EXPAND_FENV): New define.
|
||||
|
||||
2014-07-15 Jan Hubicka <hubicka@ucw.cz>
|
||||
|
||||
* fold-const.c (fold_checksum_tree): Fix typo in previous patch.
|
||||
|
||||
@ -12,8 +17,7 @@
|
||||
2014-07-15 Michael Matz <matz@suse.de>
|
||||
|
||||
PR rtl-optimization/61772
|
||||
* ifcvt.c (dead_or_predicable): Check jump to be free of side
|
||||
effects.
|
||||
* ifcvt.c (dead_or_predicable): Check jump to be free of side effects.
|
||||
|
||||
2014-07-15 Richard Biener <rguenther@suse.de>
|
||||
|
||||
@ -21,8 +25,7 @@
|
||||
|
||||
2014-07-14 Jan Hubicka <hubicka@ucw.cz>
|
||||
|
||||
* fold-const.c (fold_checksum_tree): Move checking of
|
||||
DECL_RESULT.
|
||||
* fold-const.c (fold_checksum_tree): Move checking of DECL_RESULT.
|
||||
|
||||
2014-07-14 Jan Hubicka <hubicka@ucw.cz>
|
||||
|
||||
@ -117,8 +120,7 @@
|
||||
(TV_IPA_LTO_CTORS_IN, TV_IPA_LTO_CTORS_OUT): New timevar.
|
||||
* cgraph.c (cgraph_get_body): Push GIMPLE_IN timevar.
|
||||
(varpool_get_constructor): Push CTORS_IN timevar.
|
||||
* lto-streamer-out.c (lto_output): Push TV_IPA_LTO_CTORS_OUT
|
||||
timevar.
|
||||
* lto-streamer-out.c (lto_output): Push TV_IPA_LTO_CTORS_OUT timevar.
|
||||
|
||||
2014-07-12 Uros Bizjak <ubizjak@gmail.com>
|
||||
|
||||
|
@ -9888,6 +9888,72 @@ alpha_canonicalize_comparison (int *code, rtx *op0, rtx *op1,
|
||||
*op1 = GEN_INT (255);
|
||||
}
|
||||
}
|
||||
|
||||
/* Implement TARGET_ATOMIC_ASSIGN_EXPAND_FENV. */
|
||||
|
||||
static void
|
||||
alpha_atomic_assign_expand_fenv (tree *hold, tree *clear, tree *update)
|
||||
{
|
||||
const unsigned HOST_WIDE_INT SWCR_STATUS_MASK = (0x3fUL << 17);
|
||||
|
||||
tree fenv_var, get_fpscr, set_fpscr, mask, ld_fenv, masked_fenv;
|
||||
tree new_fenv_var, reload_fenv, restore_fnenv;
|
||||
tree update_call, atomic_feraiseexcept, hold_fnclex;
|
||||
|
||||
/* Assume OSF/1 compatible interfaces. */
|
||||
if (!TARGET_ABI_OSF)
|
||||
return;
|
||||
|
||||
/* Generate the equivalent of :
|
||||
unsigned long fenv_var;
|
||||
fenv_var = __ieee_get_fp_control ();
|
||||
|
||||
unsigned long masked_fenv;
|
||||
masked_fenv = fenv_var & mask;
|
||||
|
||||
__ieee_set_fp_control (masked_fenv); */
|
||||
|
||||
fenv_var = create_tmp_var (long_unsigned_type_node, NULL);
|
||||
get_fpscr
|
||||
= build_fn_decl ("__ieee_get_fp_control",
|
||||
build_function_type_list (long_unsigned_type_node, NULL));
|
||||
set_fpscr
|
||||
= build_fn_decl ("__ieee_set_fp_control",
|
||||
build_function_type_list (void_type_node, NULL));
|
||||
mask = build_int_cst (long_unsigned_type_node, ~SWCR_STATUS_MASK);
|
||||
ld_fenv = build2 (MODIFY_EXPR, long_unsigned_type_node,
|
||||
fenv_var, build_call_expr (get_fpscr, 0));
|
||||
masked_fenv = build2 (BIT_AND_EXPR, long_unsigned_type_node, fenv_var, mask);
|
||||
hold_fnclex = build_call_expr (set_fpscr, 1, masked_fenv);
|
||||
*hold = build2 (COMPOUND_EXPR, void_type_node,
|
||||
build2 (COMPOUND_EXPR, void_type_node, masked_fenv, ld_fenv),
|
||||
hold_fnclex);
|
||||
|
||||
/* Store the value of masked_fenv to clear the exceptions:
|
||||
__ieee_set_fp_control (masked_fenv); */
|
||||
|
||||
*clear = build_call_expr (set_fpscr, 1, masked_fenv);
|
||||
|
||||
/* Generate the equivalent of :
|
||||
unsigned long new_fenv_var;
|
||||
new_fenv_var = __ieee_get_fp_control ();
|
||||
|
||||
__ieee_set_fp_control (fenv_var);
|
||||
|
||||
__atomic_feraiseexcept (new_fenv_var); */
|
||||
|
||||
new_fenv_var = create_tmp_var (long_unsigned_type_node, NULL);
|
||||
reload_fenv = build2 (MODIFY_EXPR, long_unsigned_type_node, new_fenv_var,
|
||||
build_call_expr (get_fpscr, 0));
|
||||
restore_fnenv = build_call_expr (set_fpscr, 1, fenv_var);
|
||||
atomic_feraiseexcept = builtin_decl_implicit (BUILT_IN_ATOMIC_FERAISEEXCEPT);
|
||||
update_call
|
||||
= build_call_expr (atomic_feraiseexcept, 1,
|
||||
fold_convert (integer_type_node, new_fenv_var));
|
||||
*update = build2 (COMPOUND_EXPR, void_type_node,
|
||||
build2 (COMPOUND_EXPR, void_type_node,
|
||||
reload_fenv, restore_fnenv), update_call);
|
||||
}
|
||||
|
||||
/* Initialize the GCC target structure. */
|
||||
#if TARGET_ABI_OPEN_VMS
|
||||
@ -10060,6 +10126,9 @@ alpha_canonicalize_comparison (int *code, rtx *op0, rtx *op1,
|
||||
#undef TARGET_CANONICALIZE_COMPARISON
|
||||
#define TARGET_CANONICALIZE_COMPARISON alpha_canonicalize_comparison
|
||||
|
||||
#undef TARGET_ATOMIC_ASSIGN_EXPAND_FENV
|
||||
#define TARGET_ATOMIC_ASSIGN_EXPAND_FENV alpha_atomic_assign_expand_fenv
|
||||
|
||||
struct gcc_target targetm = TARGET_INITIALIZER;
|
||||
|
||||
|
||||
|
@ -1,3 +1,10 @@
|
||||
2014-07-15 Uros Bizjak <ubizjak@gmail.com>
|
||||
|
||||
* lib/target-supports.exp (check_effective_target_fenv_exceptions):
|
||||
Add IEEE options to compile flags.
|
||||
* gcc.dg/atomic/c11-atomic-exec-5.c: Ditto. Add -mieee-with-inexact
|
||||
additional option and lower ITER_COUNT to 100 for alpha*-*-* targets.
|
||||
|
||||
2014-07-15 Michael Matz <matz@suse.de>
|
||||
|
||||
PR rtl-optimization/61772
|
||||
@ -67,8 +74,7 @@
|
||||
|
||||
2014-07-13 Tobias Burnus <burnus@net-b.de>
|
||||
|
||||
* gfortran.dg/coarray_atomic_4.f90: Avoid using a kind=16
|
||||
integer.
|
||||
* gfortran.dg/coarray_atomic_4.f90: Avoid using a kind=16 integer.
|
||||
|
||||
2014-07-12 Paul Thomas <pault@gcc.gnu.org>
|
||||
|
||||
|
@ -3,7 +3,7 @@
|
||||
out in two threads. */
|
||||
/* { dg-do run } */
|
||||
/* { dg-options "-std=c11 -pedantic-errors -pthread -D_POSIX_C_SOURCE=200809L" } */
|
||||
/* { dg-additional-options "-D_XOPEN_SOURCE=600" { target *-*-solaris2.1[0-9]* } }
|
||||
/* { dg-additional-options "-D_XOPEN_SOURCE=600" { target *-*-solaris2.1[0-9]* } } */
|
||||
/* { dg-require-effective-target pthread } */
|
||||
|
||||
#include <stdint.h>
|
||||
|
@ -4,7 +4,9 @@
|
||||
get properly cleared). */
|
||||
/* { dg-do run } */
|
||||
/* { dg-options "-std=c11 -pedantic-errors -pthread -D_POSIX_C_SOURCE=200809L" } */
|
||||
/* { dg-additional-options "-D_XOPEN_SOURCE=600" { target *-*-solaris2.1[0-9]* } }
|
||||
/* { dg-add-options ieee } */
|
||||
/* { dg-additional-options "-mieee-with-inexact" { target alpha*-*-* } } */
|
||||
/* { dg-additional-options "-D_XOPEN_SOURCE=600" { target *-*-solaris2.1[0-9]* } } */
|
||||
/* { dg-require-effective-target fenv_exceptions } */
|
||||
/* { dg-require-effective-target pthread } */
|
||||
|
||||
@ -21,7 +23,11 @@
|
||||
| FE_OVERFLOW \
|
||||
| FE_UNDERFLOW)
|
||||
|
||||
#define ITER_COUNT 10000
|
||||
#if defined __alpha__
|
||||
#define ITER_COUNT 100
|
||||
#else
|
||||
#define ITER_COUNT 10000
|
||||
#endif
|
||||
|
||||
static volatile _Atomic bool thread_ready, thread_stop;
|
||||
|
||||
|
@ -5923,7 +5923,7 @@ proc check_effective_target_fenv_exceptions {} {
|
||||
else
|
||||
abort ();
|
||||
}
|
||||
} "-std=gnu99"]
|
||||
} [add_options_for_ieee "-std=gnu99"]]
|
||||
}
|
||||
|
||||
# Return 1 if LOGICAL_OP_NON_SHORT_CIRCUIT is set to 0 for the current target.
|
||||
|
Loading…
Reference in New Issue
Block a user