From patchwork Sun Jan 13 22:23:24 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [2/2] Support __ATOMIC_HLE_RELEASE for __atomic_clear/store_n Date: Sun, 13 Jan 2013 12:23:24 -0000 From: Uros Bizjak X-Patchwork-Id: 211658 Message-Id: To: Andi Kleen Cc: gcc-patches@gcc.gnu.org On Sun, Jan 13, 2013 at 11:12 PM, Andi Kleen wrote: >> >> +(define_insn "atomic_store_1" >> >> + [(set (match_operand:ATOMIC 0 "memory_operand" "=m") >> >> + (unspec:ATOMIC [(match_operand:ATOMIC 1 "" "") >> >> + (match_operand:SI 2 "const_int_operand")] >> >> + UNSPEC_MOVA))] >> >> + "" >> >> + "%K2mov{}\t{%1, %0|%0, %1}") >> > >> > Is that the updated pattern you wanted? It looks similar to mine. >> >> Yes the attached patch actually implements all proposed fixes. > > Ok great. Can you just commit it then? It looks good to me. No problem, but what about this part: Middle-end support should be implemented before target support is committed. So, please figure out how to emit correct error on unsupported models and get middle-end patch reviewed first. We do get "Error: instruction `mov' after `xacquire' not allowed" assembler error with "xacquire movb $0,mem" asm, though. Uros. diff --git a/gcc/builtins.c b/gcc/builtins.c index 2b615a1..c283869 100644 --- a/gcc/builtins.c +++ b/gcc/builtins.c @@ -5556,6 +5556,8 @@ expand_builtin_atomic_clear (tree exp) return const0_rtx; } + /* need target hook there to check for not hle acquire */ + if (HAVE_atomic_clear) { emit_insn (gen_atomic_clear (mem, model));