From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 51904 invoked by alias); 26 Feb 2018 18:16:15 -0000 Mailing-List: contact gcc-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-owner@gcc.gnu.org Received: (qmail 51806 invoked by uid 89); 26 Feb 2018 18:16:10 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.7 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_LOW,T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 spammy=irrespective, HContent-Transfer-Encoding:8bit X-HELO: mx1.redhat.com Received: from mx3-rdu2.redhat.com (HELO mx1.redhat.com) (66.187.233.73) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 26 Feb 2018 18:16:09 +0000 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 04AF58D6EF; Mon, 26 Feb 2018 18:15:58 +0000 (UTC) Received: from oldenburg.str.redhat.com (ovpn-116-28.ams2.redhat.com [10.36.116.28]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 8BAC4AFD47; Mon, 26 Feb 2018 18:15:57 +0000 (UTC) Subject: Re: GCC interpretation of C11 atomics (DR 459) To: nruslan_devel@yahoo.com References: <1615980330.4453149.1519617655582.ref@mail.yahoo.com> <1615980330.4453149.1519617655582@mail.yahoo.com> Cc: gcc@gcc.gnu.org From: Florian Weimer Message-ID: <45a88b2b-2e64-58e7-f68b-a1a7511b6528@redhat.com> Date: Mon, 26 Feb 2018 18:16:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: <1615980330.4453149.1519617655582@mail.yahoo.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-IsSubscribed: yes X-SW-Source: 2018-02/txt/msg00202.txt.bz2 On 02/26/2018 05:00 AM, Ruslan Nikolaev via gcc wrote: > If I understand correctly, the redirection to libatomic was made for 2 reasons: > 1. cmpxchg16b is not available on early amd64 processors. (However, mcx16 flag already specifies that you use CPUs that have this instruction, so it should not be a concern when the flag is specified.) > 2. atomic_load on read-only memory. I think x86-64 should be able to do atomic load and store via SSE2 registers, but perhaps if the memory is suitably aligned (which is the other problem—the libatomic code will work irrespective of alignment, as far as I understand it). Thanks, Florian