+2015-06-11 David Edelsohn <dje.gcc@gmail.com>
+
+ * config/rs6000/rs6000.c (rs6000_pre_atomic_barrier): Remove SYNC
+ variants cases from switch.
+ (rs6000_post_atomic_barrier): Same.
+ (rs6000_expand_atomic_compare_and_swap): Use memmodel_base.
+ (rs6000_expand_atomic_exchange): Same.
+ (rs6000_expand_atomic_op): Same.
+ * config/rs6000/sync.md (mem_thread_fence): Use memodel_base. Remove
+ SYNC variants cases from switch.
+ (atomic_load): Same.
+ (atomic_store): Same.
+
2015-06-11 John David Anglin <danglin@gcc.gnu.org>
* config/pa/pa.c (pa_output_global_address): Handle LABEL_REF plus
case MEMMODEL_RELAXED:
case MEMMODEL_CONSUME:
case MEMMODEL_ACQUIRE:
- case MEMMODEL_SYNC_ACQUIRE:
break;
case MEMMODEL_RELEASE:
- case MEMMODEL_SYNC_RELEASE:
case MEMMODEL_ACQ_REL:
emit_insn (gen_lwsync ());
break;
case MEMMODEL_SEQ_CST:
- case MEMMODEL_SYNC_SEQ_CST:
emit_insn (gen_hwsync ());
break;
default:
case MEMMODEL_RELAXED:
case MEMMODEL_CONSUME:
case MEMMODEL_RELEASE:
- case MEMMODEL_SYNC_RELEASE:
break;
case MEMMODEL_ACQUIRE:
- case MEMMODEL_SYNC_ACQUIRE:
case MEMMODEL_ACQ_REL:
case MEMMODEL_SEQ_CST:
- case MEMMODEL_SYNC_SEQ_CST:
emit_insn (gen_isync ());
break;
default:
oldval = operands[3];
newval = operands[4];
is_weak = (INTVAL (operands[5]) != 0);
- mod_s = memmodel_from_int (INTVAL (operands[6]));
- mod_f = memmodel_from_int (INTVAL (operands[7]));
+ mod_s = memmodel_base (INTVAL (operands[6]));
+ mod_f = memmodel_base (INTVAL (operands[7]));
orig_mode = mode = GET_MODE (mem);
mask = shift = NULL_RTX;
retval = operands[0];
mem = operands[1];
val = operands[2];
- model = (enum memmodel) INTVAL (operands[3]);
+ model = memmodel_base (INTVAL (operands[3]));
mode = GET_MODE (mem);
mask = shift = NULL_RTX;
rs6000_expand_atomic_op (enum rtx_code code, rtx mem, rtx val,
rtx orig_before, rtx orig_after, rtx model_rtx)
{
- enum memmodel model = (enum memmodel) INTVAL (model_rtx);
+ enum memmodel model = memmodel_base (INTVAL (model_rtx));
machine_mode mode = GET_MODE (mem);
machine_mode store_mode = mode;
rtx label, x, cond, mask, shift;
[(match_operand:SI 0 "const_int_operand" "")] ;; model
""
{
- enum memmodel model = memmodel_from_int (INTVAL (operands[0]));
+ enum memmodel model = memmodel_base (INTVAL (operands[0]));
switch (model)
{
case MEMMODEL_RELAXED:
break;
case MEMMODEL_CONSUME:
case MEMMODEL_ACQUIRE:
- case MEMMODEL_SYNC_ACQUIRE:
case MEMMODEL_RELEASE:
- case MEMMODEL_SYNC_RELEASE:
case MEMMODEL_ACQ_REL:
emit_insn (gen_lwsync ());
break;
case MEMMODEL_SEQ_CST:
- case MEMMODEL_SYNC_SEQ_CST:
emit_insn (gen_hwsync ());
break;
default:
if (<MODE>mode == TImode && !TARGET_SYNC_TI)
FAIL;
- enum memmodel model = memmodel_from_int (INTVAL (operands[2]));
+ enum memmodel model = memmodel_base (INTVAL (operands[2]));
if (is_mm_seq_cst (model))
emit_insn (gen_hwsync ());
break;
case MEMMODEL_CONSUME:
case MEMMODEL_ACQUIRE:
- case MEMMODEL_SYNC_ACQUIRE:
case MEMMODEL_SEQ_CST:
- case MEMMODEL_SYNC_SEQ_CST:
emit_insn (gen_loadsync_<mode> (operands[0]));
break;
default:
if (<MODE>mode == TImode && !TARGET_SYNC_TI)
FAIL;
- enum memmodel model = memmodel_from_int (INTVAL (operands[2]));
+ enum memmodel model = memmodel_base (INTVAL (operands[2]));
switch (model)
{
case MEMMODEL_RELAXED:
break;
case MEMMODEL_RELEASE:
- case MEMMODEL_SYNC_RELEASE:
emit_insn (gen_lwsync ());
break;
case MEMMODEL_SEQ_CST:
- case MEMMODEL_SYNC_SEQ_CST:
emit_insn (gen_hwsync ());
break;
default: