This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]