From owner-freebsd-toolchain@FreeBSD.ORG Fri Apr 15 16:39:59 2011 Return-Path: Delivered-To: freebsd-toolchain@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 771E7106566C; Fri, 15 Apr 2011 16:39:59 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from tensor.andric.com (cl-327.ede-01.nl.sixxs.net [IPv6:2001:7b8:2ff:146::2]) by mx1.freebsd.org (Postfix) with ESMTP id 3A6718FC0A; Fri, 15 Apr 2011 16:39:59 +0000 (UTC) Received: from [IPv6:2001:7b8:3a7:0:e08b:5a2b:d410:1403] (unknown [IPv6:2001:7b8:3a7:0:e08b:5a2b:d410:1403]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by tensor.andric.com (Postfix) with ESMTPSA id 229525C59; Fri, 15 Apr 2011 18:39:58 +0200 (CEST) Message-ID: <4DA874F3.9050101@FreeBSD.org> Date: Fri, 15 Apr 2011 18:40:19 +0200 From: Dimitry Andric Organization: The FreeBSD Project User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.17) Gecko/20110415 Lanikai/3.1.11pre MIME-Version: 1.0 To: Alexander Best References: <20110414234106.GA22718@freebsd.org> In-Reply-To: <20110414234106.GA22718@freebsd.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-toolchain@freebsd.org, cfe-commits@cs.uiuc.edu Subject: Re: clang and 3dnow(a) X-BeenThere: freebsd-toolchain@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Maintenance of FreeBSD's integrated toolchain List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Apr 2011 16:39:59 -0000 On 2011-04-15 01:41, Alexander Best wrote: > per coincidence i discovered the following contrary behavior between gcc and > clang: > > -mno-mmx implies -mno-3dnow under gcc. under clang -mno-mmx will *not* imply > -mno-3dnow! > > is this a clang design feature or a bug? fixing it would be trivial (see > attached patch). I don't think it was intentionally designed, nor that it is a bug. It it just arbitrary what you disable when you specify '-mno-mmx'. However, it would probably be nice if clang emulated gcc's behaviour here. Adding cfe-commits@ in the loop, to see if the clang guys think this is desirable. diff --git a/contrib/llvm/tools/clang/lib/Basic/Targets.cpp b/contrib/llvm/tools/clang/lib/Basic/Targets.cpp index 55321f2..1af7c52 100644 --- a/contrib/llvm/tools/clang/lib/Basic/Targets.cpp +++ b/contrib/llvm/tools/clang/lib/Basic/Targets.cpp @@ -1133,8 +1133,9 @@ bool X86TargetInfo::setFeatureEnabled(llvm::StringMap &Features, Features["avx"] = true; } else { if (Name == "mmx") - Features["mmx"] = Features["sse"] = Features["sse2"] = Features["sse3"] = - Features["ssse3"] = Features["sse41"] = Features["sse42"] = false; + Features["mmx"] = Features["3dnow"] = Features["3dnowa"] = + Features["sse"] = Features["sse2"] = Features["sse3"] = + Features["ssse3"] = Features["sse41"] = Features["sse42"] = false; else if (Name == "sse") Features["sse"] = Features["sse2"] = Features["sse3"] = Features["ssse3"] = Features["sse41"] = Features["sse42"] = false;