From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8284 invoked by alias); 14 Aug 2012 19:33:17 -0000 Received: (qmail 8266 invoked by uid 22791); 14 Aug 2012 19:33:17 -0000 X-SWARE-Spam-Status: No, hits=-3.0 required=5.0 tests=AWL,BAYES_00,KHOP_THREADED,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from usmamail.tilera.com (HELO USMAMAIL.TILERA.COM) (12.216.194.151) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 14 Aug 2012 19:33:02 +0000 Received: from [10.7.0.95] (10.9.0.23) by USMAExch2.tad.internal.tilera.com (10.3.0.33) with Microsoft SMTP Server id 14.0.694.0; Tue, 14 Aug 2012 15:33:01 -0400 Message-ID: <502AA7EC.5020406@tilera.com> Date: Tue, 14 Aug 2012 19:33:00 -0000 From: Chris Metcalf User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:14.0) Gecko/20120713 Thunderbird/14.0 MIME-Version: 1.0 To: Maxim Kuvyrkov CC: Tom de Vries , "Joseph S. Myers" , GLIBC Devel , , Tom de Vries Subject: Re: [PATCH] Optimize libc_lock_lock for MIPS XLP. References: <4FD9DB74.8080905@tilera.com> <40CBC472-71CC-4FF3-A452-073B76701215@codesourcery.com> <4FDAA190.3050706@tilera.com> <15EB7E17-5692-4221-A1B1-FC16EA236BFF@codesourcery.com> <4FEC94AF.40301@tilera.com> <4FF73F75.6060303@mentor.com> <7CC74175-BA9B-4461-8918-9D99DABEC484@codesourcery.com> In-Reply-To: <7CC74175-BA9B-4461-8918-9D99DABEC484@codesourcery.com> Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 7bit X-IsSubscribed: yes Mailing-List: contact libc-ports-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: libc-ports-owner@sourceware.org X-SW-Source: 2012-08/txt/msg00116.txt.bz2 On 8/14/2012 12:00 AM, Maxim Kuvyrkov wrote: > + atomic_compared_and_exchange_acq take the same time to execute. Typo. > + if (__result >= 2) \ > + __result = (atomic_exchange_acq (__futex, 2) != 0); \ Why not just return the old value in memory here (i.e. omit the "!= 0"), as you do with the exchange_and_add above? That seems more parallel in structure, and also more efficient. -- Chris Metcalf, Tilera Corp. http://www.tilera.com