From owner-svn-src-projects@FreeBSD.ORG Fri Aug 2 14:35:44 2013 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 932BFA9A; Fri, 2 Aug 2013 14:35:44 +0000 (UTC) (envelope-from asmrookie@gmail.com) Received: from mail-wg0-x22e.google.com (mail-wg0-x22e.google.com [IPv6:2a00:1450:400c:c00::22e]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id CFB9229DC; Fri, 2 Aug 2013 14:35:43 +0000 (UTC) Received: by mail-wg0-f46.google.com with SMTP id k13so570123wgh.25 for ; Fri, 02 Aug 2013 07:35:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:reply-to:sender:in-reply-to:references:date:message-id :subject:from:to:cc:content-type; bh=0DjF5/8hrqJYr9dSa8EimqGyEHh3VRUI/zpCCHWfXEA=; b=guVwD00CdlprkQJqEz3zkvY7Nh0tQDm7ArqzmKG4p9haiN7hrb7YAHwhw2wk5w/MAE sJ1ZYDcwvCJkXd+2rrURVbfm3+vxuYwoKhdUi7OyVvtlGjMDgtE8GheQRgVtQIhnaiXA qGDxjkp9jUzOYd4a6V/ovuwSY8eV6uYQwT7oftY0970udeLwV8ZPrEBP5S+0Wgy5gPhR 2AeWQAi5G+ikZUXp2jBOx9M8yWpZX5b0+c1Au8s6h38+7pdyIIiIWpIZgGLZ+zlPQvV1 Lc1FJyaifzQp49rZlw60zBN5kDdcCw6P1Pi8yj40ACPOqKip9/JmUCsyvZUtStPktoRW pbSg== MIME-Version: 1.0 X-Received: by 10.181.13.7 with SMTP id eu7mr2053005wid.54.1375454142199; Fri, 02 Aug 2013 07:35:42 -0700 (PDT) Sender: asmrookie@gmail.com Received: by 10.217.142.76 with HTTP; Fri, 2 Aug 2013 07:35:42 -0700 (PDT) In-Reply-To: <201308020008.r7208033096591@svn.freebsd.org> References: <201308020008.r7208033096591@svn.freebsd.org> Date: Fri, 2 Aug 2013 16:35:42 +0200 X-Google-Sender-Auth: hZYk4n91fNfK74wgXbogRJ5TVSg Message-ID: Subject: Re: svn commit: r253876 - in projects/atomic64/sys/i386: i386 include From: Attilio Rao To: Jung-uk Kim Content-Type: text/plain; charset=UTF-8 Cc: svn-src-projects@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: attilio@FreeBSD.org List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Aug 2013 14:35:44 -0000 On Fri, Aug 2, 2013 at 2:08 AM, Jung-uk Kim wrote: > Author: jkim > Date: Fri Aug 2 00:08:00 2013 > New Revision: 253876 > URL: http://svnweb.freebsd.org/changeset/base/253876 > > Log: > - Implement atomic_cmpset_64(), atomic_swap_64(), and atomic_testandset_64() > for i386. > - Reimplement atomic_*_64_i386() in C to make it more pleasant to read. > Note the generated code may not be optimal but much easier to maintain. Please don't do this. The reason why we never had 64 bits atomic on 32-bits architectures is because we never could implement them in efficient way, namely without disabling interrupts. If we make 64 bits atomics available on every 32 bits architecure by implementing the slow way we could end up developing some patterns in MI layers which depend on them that end up by being much slower than expected. If you want to implement such functions to use only on i386 internal code it is a different story but you must absolutely use a different name by atomic_xxx_64() to stress-out the difference, either comment out that they are heavier than expected and should be careful used. Attilio -- Peace can only be achieved by understanding - A. Einstein