From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25063 invoked by alias); 17 Oct 2009 17:10:13 -0000 Received: (qmail 25051 invoked by uid 22791); 17 Oct 2009 17:10:12 -0000 X-SWARE-Spam-Status: No, hits=-2.5 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sat, 17 Oct 2009 17:10:08 +0000 Received: from int-mx08.intmail.prod.int.phx2.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id n9HHA43Y008297; Sat, 17 Oct 2009 13:10:05 -0400 Received: from stone.twiddle.home (vpn-226-9.phx2.redhat.com [10.3.226.9]) by int-mx08.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id n9HHA4R7015691; Sat, 17 Oct 2009 13:10:04 -0400 Message-ID: <4AD9FA68.4070708@redhat.com> Date: Sat, 17 Oct 2009 17:14:00 -0000 From: Richard Henderson User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.4pre) Gecko/20090922 Fedora/3.0-2.7.b4.fc11 Thunderbird/3.0b4 MIME-Version: 1.0 To: Ross Ridge CC: gcc-patches@gcc.gnu.org Subject: Re: [CFT] i386 sync functions for PR 39677 References: <20091017060724.CF6AD73F86@caffeine.csclub.uwaterloo.ca> In-Reply-To: <20091017060724.CF6AD73F86@caffeine.csclub.uwaterloo.ca> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org X-SW-Source: 2009-10/txt/msg01144.txt.bz2 On 10/16/2009 11:07 PM, Ross Ridge wrote: > Is really worth support supporting older CPUs? It wouldn't seem > unreasonble to me for GCC to require that the CPU support at least the > CMPXCHG8 instruction (ie. Pentium or better) to use the __sync* functions. > > Not that it really matters, but your CPUID logic seems a bit wrong. > All Intel 80486 CPUs supported CMPXCHG, but only the later ones supported > CPUID. You're quite right -- I'd misremembered cmpxchg in 586. And having slept on the problem I'm sure I don't think we should get into the spinlock thing -- there's too many ways for that to go wrong. I'll simplify the cpuid check to only look for the amd cpu with the eratta, and use the atomic instructions as needed. The resulting sigill will be no different than at present, when we simply compile the libraries with -march=i586. r~