This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [cxx-mem-model] Consolidation 2 - the fetch ops.
- From: Richard Henderson <rth at redhat dot com>
- To: Andrew MacLeod <amacleod at redhat dot com>
- Cc: gcc-patches <gcc-patches at gcc dot gnu dot org>
- Date: Thu, 15 Sep 2011 14:02:50 -0700
- Subject: Re: [cxx-mem-model] Consolidation 2 - the fetch ops.
- References: <4E7130E1.80600@redhat.com>
> ! /* Initialize the fields for each supported opcode. */
> ! static struct op_functions add_op = { sync_mem_fetch_add_optab,
> ! sync_mem_add_fetch_optab,
> ! sync_mem_add_optab,
> ! sync_old_add_optab,
> ! sync_new_add_optab,
> ! sync_add_optab,
> ! MINUS
> ! };
Can these be const?
> ! static struct op_functions xor_op = { sync_mem_fetch_xor_optab,
> ! sync_mem_xor_fetch_optab,
> ! sync_mem_xor_optab,
> ! sync_old_xor_optab,
> ! sync_new_xor_optab,
> ! sync_xor_optab,
> ! UNKNOWN
> ! };
XOR is its own reverse. ;-)
> ! if ((result = maybe_emit_op (optab, target, mem, val, true, model, true)))
> ! return result;
Please don't embed = inside IF conditions.
Otherwise this looks ok.
r~