[cxx-mem-model] Consolidation 2 - the fetch ops.

Richard Henderson rth@redhat.com
Thu Sep 15 21:15:00 GMT 2011


> ! /* 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~



More information about the Gcc-patches mailing list