From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 38912 invoked by alias); 24 Dec 2017 01:26:40 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Received: (qmail 38804 invoked by uid 89); 24 Dec 2017 01:26:39 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-12.6 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_0,RCVD_IN_DNSWL_NONE,SPF_PASS,URIBL_RED autolearn=ham version=3.3.2 spammy=HContent-Transfer-Encoding:8bit X-HELO: mail-pf0-f174.google.com X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:subject:in-reply-to:cc:from:to:message-id :mime-version:content-transfer-encoding; bh=kSK0wM94EQI2XMbhn4ZfWLN98jspEIIZWxTCRof0CJQ=; b=eLyA4/b83Z76cl8vbdGcKjgSTdvQ1LC/F8NffE56BMMWaXWop5Q4LjThXGEjtzS1zG lnzgele9d1wOvQrawlzuRGFy8ccUSpafOa/5IBUc01ewRQ70YZq78zSWaYvqFzrLxiNK 13Si2ladJQSYW2gjvfiLH9yxaNlrm+DyoFJ7as25j5smEBchYTSo9nQ8r7QKUdsJKBow 2iXXTv8bmfPJw4E6stLBDydlLHKdrbGQXwUG1HsukVd1H9hqs3UNG03zmwwa+BydJFuq F0811AE8gPSG+P3WEVU2qxr+X1j9O30KYtYvyV6H3/i/F4z/ioHDYHT8Jx93rG+kKQzW sirg== X-Gm-Message-State: AKGB3mLu8YPqlFCrlCGH/GqrndbmlKlWblGsShvd3WeWHa/M5AKv1xVR 5mlsw6/MYuRRfoJpRTCundZONTl2RSk= X-Google-Smtp-Source: ACJfBovvImHi5pAymApR2/AFVLgM/5qCj7jS9Bg4TxBqW952b+PR91vIBg/+Aes4pUBkYzPgkOAP1Q== X-Received: by 10.99.140.29 with SMTP id m29mr10848426pgd.364.1514078796463; Sat, 23 Dec 2017 17:26:36 -0800 (PST) Date: Sun, 24 Dec 2017 01:26:00 -0000 X-Google-Original-Date: Sat, 23 Dec 2017 17:26:14 PST (-0800) Subject: Re: [PATCH v2 09/15] RISC-V: Atomic and Locking Routines In-Reply-To: CC: libc-alpha@sourceware.org, Andrew Waterman , Darius Rad , dj@redhat.com From: Palmer Dabbelt To: joseph@codesourcery.com Message-ID: Mime-Version: 1.0 (MHng) Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-SW-Source: 2017-12/txt/msg00882.txt.bz2 On Wed, 20 Dec 2017 09:08:18 PST (-0800), joseph@codesourcery.com wrote: > On Tue, 19 Dec 2017, Palmer Dabbelt wrote: > >> This patch implements various atomic and locking routines on RISC-V, >> either via the A extension (when present) or via a Linux system call >> that does a compare-and-exchange. This contains both the library >> routines and the syscall wrapper. > > You said in the introduction that the 'A' extension would be required for > Linux. I think you need to update the patch description - *and* the patch > itself - to reflect that. > >> diff --git a/sysdeps/riscv/rv64/rvd/s_roundeven.c b/sysdeps/riscv/rv64/rvd/s_roundeven.c > > Does not belong in this patch. > >> diff --git a/sysdeps/riscv/rv64/rvf/s_llrintf.c b/sysdeps/riscv/rv64/rvf/s_llrintf.c > > Likewise. > >> +#ifdef __riscv_atomic >> + >> +#define __HAVE_64B_ATOMICS (__riscv_xlen >= 64) >> +#define USE_ATOMIC_COMPILER_BUILTINS 1 >> +#define ATOMIC_EXCHANGE_USES_CAS 0 > > Missing preprocessor indentation. > >> +/* Miscellaneous. */ >> + >> +#define asm_amo(which, ordering, mem, value) ({ \ > > Likewise, in this part of the file. > >> +#else /* __riscv_atomic */ > > And this part of the file should now just have a #error. (Giving an error > for non-A at configure time would be a good idea as well, so the bad > configuration gets detected as early as possible.) I've already made it #error here, and I added a preconfigure check for the atomic extension as well. I'll fix up the commit for the v3. Thanks!