diff options
author | Paolo Bonzini <bonzini@gnu.org> | 2009-04-09 10:57:03 +0000 |
---|---|---|
committer | Paolo Bonzini <bonzini@gcc.gnu.org> | 2009-04-09 10:57:03 +0000 |
commit | 4a77c72b6b82fe31fa897ef5ced8579b706c9dfc (patch) | |
tree | ece9481c78c8bf125765823a7704da2edc3e28dd /gcc/doc | |
parent | bf080c96e02d9b10dd18d7e900ed0c84d0d214af (diff) | |
download | gcc-4a77c72b6b82fe31fa897ef5ced8579b706c9dfc.zip gcc-4a77c72b6b82fe31fa897ef5ced8579b706c9dfc.tar.gz gcc-4a77c72b6b82fe31fa897ef5ced8579b706c9dfc.tar.bz2 |
i386.md (cmpcc): New.
2009-04-09 Paolo Bonzini <bonzini@gnu.org>
* config/i386/i386.md (cmpcc): New.
* config/i386/sync.md (sync_compare_and_swap*): Set FLAGS_REG.
(sync_compare_and_swap_cc*): Delete.
* config/s390/s390.c (s390_compare_emitted): Remove.
(s390_emit_compare): Handle MODE_CC s390_compare_op0 like
s390_compare_emitted used to be handled. Assert that modes match.
(s390_emit_compare_and_swap): Use s390_emit_compare, do not
refer to sync_compare_and_swap_ccsi.
* config/s390/s390.h (s390_compare_emitted): Remove.
* config/s390/s390.md (seq): Look for MODE_CC s390_compare_op0
instead of s390_compare_emitted.
(stack_protect_test, sync_compare_and_swap_cc): Set s390_compare_op0
instead of s390_compare_emitted.
* config/s390/s390.md (cmpcc): New.
(sync_compare_and_swapqi, sync_compare_and_swaphi): Clobber
CC_REGNUM, do not pretend it's set.
(sync_compare_and_swap_cc*): Delete.
* config/s390/predicates.md (cc_reg_operand): New.
* expr.c (sync_compare_and_swap_cc): Delete.
* optabs.h (sync_compare_and_swap_cc): Delete.
* optabs.c (prepare_cmp_insn): Ignore which specific CCmode
is being used with can_compare_p.
(emit_cmp_and_jump_insn_1): Likewise when looking in the optab.
(find_cc_set): New.
(expand_bool_compare_and_swap): Do not use sync_compare_and_swap_cc,
look for a MODE_CC set instead. Use emit_store_flag.
(expand_compare_and_swap_loop): Likewise, with some additional
complication to avoid a force_reg when useless. Use
emit_cmp_and_jump_insns.
* genopinit.c (optabs): Delete sync_compare_and_swap_cc.
* doc/md.texi (sync_compare_and_swap_cc): Merge with
sync_compare_and_swap documentation.
java:
2009-04-09 Paolo Bonzini <bonzini@gnu.org>
* builtins.c (compareAndSwapLong_builtin,
compareAndSwapInt_builtin, compareAndSwapObject_builtin,
VMSupportsCS8_builtin): Do not look at sync_compare_and_swap_cc.
From-SVN: r145825
Diffstat (limited to 'gcc/doc')
-rw-r--r-- | gcc/doc/md.texi | 22 |
1 files changed, 9 insertions, 13 deletions
diff --git a/gcc/doc/md.texi b/gcc/doc/md.texi index 25de8b1..a78233c 100644 --- a/gcc/doc/md.texi +++ b/gcc/doc/md.texi @@ -5091,19 +5091,15 @@ memory operations before the atomic operation occur before the atomic operation and all memory operations after the atomic operation occur after the atomic operation. -@cindex @code{sync_compare_and_swap_cc@var{mode}} instruction pattern -@item @samp{sync_compare_and_swap_cc@var{mode}} - -This pattern is just like @code{sync_compare_and_swap@var{mode}}, except -it should act as if compare part of the compare-and-swap were issued via -@code{cmp@var{m}}. This comparison will only be used with @code{EQ} and -@code{NE} branches and @code{setcc} operations. - -Some targets do expose the success or failure of the compare-and-swap -operation via the status flags. Ideally we wouldn't need a separate -named pattern in order to take advantage of this, but the combine pass -does not handle patterns with multiple sets, which is required by -definition for @code{sync_compare_and_swap@var{mode}}. +For targets where the success or failure of the compare-and-swap +operation is available via the status flags, it is possible +to avoid a separate compare operation and issue the subsequent +setcc or branch immediately after the compare-and-swap. To this +end, GCC will look for a @code{MODE_CC} set in the output of +@code{sync_compare_and_swap@var{mode}}; if the machine description +includes such a set, the target should also define a special @code{cmpcc} +instruction. GCC will then be able to take the destination of the +@code{MODE_CC} set and use it as the first operand of @code{cmpcc}. @cindex @code{sync_add@var{mode}} instruction pattern @cindex @code{sync_sub@var{mode}} instruction pattern |