From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23712 invoked by alias); 13 Jan 2013 22:23:33 -0000 Received: (qmail 23704 invoked by uid 22791); 13 Jan 2013 22:23:32 -0000 X-SWARE-Spam-Status: No, hits=-5.0 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,KHOP_RCVD_TRUST,KHOP_THREADED,RCVD_IN_DNSWL_LOW,RCVD_IN_HOSTKARMA_YE,TW_OV X-Spam-Check-By: sourceware.org Received: from mail-ob0-f178.google.com (HELO mail-ob0-f178.google.com) (209.85.214.178) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sun, 13 Jan 2013 22:23:25 +0000 Received: by mail-ob0-f178.google.com with SMTP id eh20so3374504obb.9 for ; Sun, 13 Jan 2013 14:23:24 -0800 (PST) MIME-Version: 1.0 Received: by 10.182.43.102 with SMTP id v6mr7377509obl.60.1358115804744; Sun, 13 Jan 2013 14:23:24 -0800 (PST) Received: by 10.182.153.201 with HTTP; Sun, 13 Jan 2013 14:23:24 -0800 (PST) In-Reply-To: <20130113221251.GW30577@one.firstfloor.org> References: <20130113203603.GS30577@one.firstfloor.org> <20130113221251.GW30577@one.firstfloor.org> Date: Sun, 13 Jan 2013 22:23:00 -0000 Message-ID: Subject: Re: [PATCH 2/2] Support __ATOMIC_HLE_RELEASE for __atomic_clear/store_n From: Uros Bizjak To: Andi Kleen Cc: gcc-patches@gcc.gnu.org Content-Type: text/plain; charset=ISO-8859-1 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org X-SW-Source: 2013-01/txt/msg00667.txt.bz2 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: 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)); 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.