From patchwork Wed Apr 18 10:12:20 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Uros Bizjak X-Patchwork-Id: 153461 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by ozlabs.org (Postfix) with SMTP id 21717B6F6E for ; Wed, 18 Apr 2012 20:13:21 +1000 (EST) Comment: DKIM? See http://www.dkim.org DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=gcc.gnu.org; s=default; x=1335348802; h=Comment: DomainKey-Signature:Received:Received:Received:Received: MIME-Version:Received:Received:In-Reply-To:References:Date: Message-ID:Subject:From:To:Cc:Content-Type:Mailing-List: Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:Sender:Delivered-To; bh=VFyqxrcSklqiRL9HP1MK00UIX3c=; b=Ywa8CCuWCIoWEZt++K2ziXZTFgJh+l0UbnmrByv+dUK9cWXsgXww1CVZ356szU Q46+uqPcr/LeJZeEVd8TcRyWgX6QVeam0SvffEZKU9YkKD2yKTQ77INvKeXXKbu7 cy4/luhZ/Hm9r8jaJamr1eoFdo61IlVuB2AWLQpggas24= Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=gcc.gnu.org; h=Received:Received:X-SWARE-Spam-Status:X-Spam-Check-By:Received:Received:MIME-Version:Received:Received:In-Reply-To:References:Date:Message-ID:Subject:From:To:Cc:Content-Type:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=RNj2oZV1NLl8U52ZERwxndqjvHcezsT/xJFGZNrMWjbpcWw0GM8xUkqE48NvhT ckrQ5iHzKfMEjO+w91Z8ZnnbeyPZD0T2+lcc5LVGDZH0y73nGpg7mwNWlyFuF9lY ORyu6fByoEOscGHd4+jZlmx2QTTBgH6L8MgCt7rXevH9U=; Received: (qmail 32484 invoked by alias); 18 Apr 2012 10:13:13 -0000 Received: (qmail 32473 invoked by uid 22791); 18 Apr 2012 10:13:12 -0000 X-SWARE-Spam-Status: No, hits=-4.9 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 X-Spam-Check-By: sourceware.org Received: from mail-yw0-f47.google.com (HELO mail-yw0-f47.google.com) (209.85.213.47) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 18 Apr 2012 10:12:21 +0000 Received: by yhjj56 with SMTP id j56so3798192yhj.20 for ; Wed, 18 Apr 2012 03:12:20 -0700 (PDT) MIME-Version: 1.0 Received: by 10.236.116.66 with SMTP id f42mr1503988yhh.70.1334743940533; Wed, 18 Apr 2012 03:12:20 -0700 (PDT) Received: by 10.146.124.5 with HTTP; Wed, 18 Apr 2012 03:12:20 -0700 (PDT) In-Reply-To: References: Date: Wed, 18 Apr 2012 12:12:20 +0200 Message-ID: Subject: Re: [PATCH, i386, middle-end, tessuite] Intel TSX's HLE. From: Uros Bizjak To: Kirill Yukhin Cc: Jakub Jelinek , Torvald Riegel , Andrew MacLeod , "H.J. Lu" , "sergos.gnu@gmail.com GCC Patches" Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org On Wed, Apr 18, 2012 at 11:34 AM, Kirill Yukhin wrote: > Hello guys, > Since there is no more objections to my RFC, started here [1], > I've implemented rest __atomic builtins in the same way. > It corresponds to Spec, which can be found here [2]. Can you please implement printing of HLE prefix with %K operand modifier, like sync.md example in attached (untested) patch? Uros. Index: i386/i386.c =================================================================== @@ -13938,6 +13944,7 @@ get_some_local_dynamic_name (void) X -- don't print any sort of PIC '@' suffix for a symbol. & -- print some in-use local-dynamic symbol name. H -- print a memory address offset by 8; used for sse high-parts + K -- print HLE lock prefix Y -- print condition for XOP pcom* instruction. + -- print a branch hint as 'cs' or 'ds' prefix ; -- print a semicolon (after prefixes due to bug in older gas). @@ -14340,6 +14347,22 @@ ix86_print_operand (FILE *file, rtx x, int code) x = adjust_address_nv (x, DImode, 8); break; + case 'K': + gcc_assert (CONST_INT_P (x)); + + if (INTVAL (x) & IX86_HLE_ACQUIRE) +#ifdef HAVE_AS_IX86_HLE + fputs ("xacquire ", file); +#else + fputs ("\n" ASM_BYTE "0xf2\n\t", file); + else if (INTVAL (x) & IX86_HLE_RELEASE) +#ifdef HAVE_AS_IX86_HLE + fputs ("xrelease ", file); +#else + fputs ("\n" ASM_BYTE "0xf3\n\t"); +#endif + break; + case '+': { rtx x; Index: i386/i386.md =================================================================== --- i386/i386.md (revision 186558) +++ i386/i386.md (working copy) @@ -58,6 +58,7 @@ ;; X -- don't print any sort of PIC '@' suffix for a symbol. ;; & -- print some in-use local-dynamic symbol name. ;; H -- print a memory address offset by 8; used for sse high-parts +;; K -- print HLE lock prefix ;; Y -- print condition for XOP pcom* instruction. ;; + -- print a branch hint as 'cs' or 'ds' prefix ;; ; -- print a semicolon (after prefixes due to bug in older gas). Index: i386/sync.md =================================================================== --- i386/sync.md (revision 186558) +++ i386/sync.md (working copy) @@ -455,7 +455,7 @@ (match_operand:SWI 2 "nonmemory_operand" "0"))) (clobber (reg:CC FLAGS_REG))] "TARGET_XADD" - "lock{%;} xadd{}\t{%0, %1|%1, %0}") + "lock{%;} %K3xadd{}\t{%0, %1|%1, %0}") ;; This peephole2 and following insn optimize ;; __sync_fetch_and_add (x, -N) == N into just lock {add,sub,inc,dec}