From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2314 invoked by alias); 16 Jul 2004 17:11:41 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 2303 invoked by uid 48); 16 Jul 2004 17:11:40 -0000 Date: Fri, 16 Jul 2004 17:11:00 -0000 Message-ID: <20040716171140.2302.qmail@sourceware.org> From: "aron-gcc at sightspeed dot com" To: gcc-bugs@gcc.gnu.org In-Reply-To: <20040716024656.16584.aron-gcc@sightspeed.com> References: <20040716024656.16584.aron-gcc@sightspeed.com> Reply-To: gcc-bugzilla@gcc.gnu.org Subject: [Bug c/16584] -msse2 also enabling -mfpmath=sse option causing illegal instruction errors X-Bugzilla-Reason: CC X-SW-Source: 2004-07/txt/msg02016.txt.bz2 List-Id: ------- Additional Comments From aron-gcc at sightspeed dot com 2004-07-16 17:11 ------- Three responses too this: 1. Just using -msse does not trigger the same behiavor with SSE1 floating point calls in regular code. 2. Even if (1) was performing this: The man page section under -mfpmath states that the -mfpmath option must explicitly be passed for normal floating point code to be repalced with SSE code. Even if you explicity pass -mfpmath=387 - msse2, it will still generate SSE2 for non-intrinsics code. 3. If you description is correct, How are you supposed to generate binaries that are processor safe on x86. We ship a Linux program that has sections optimized (using Intrinsics) that are protected by runtime CPUID detection. The man pages that I have for GCC state for -msse2 These switches enable or disable the use of built-in functions that allow direct access to the MMX, SSE, SSE2, SSE3 and 3Dnow extensions of the instruction set. ------> To have SSE/SSE2 instructions generated automatically from floating-point code, see -mfpmath=sse. -mfpmath=unit Generate floating point arithmetics for selected unit unit. The choices for unit are: 387 Use the standard 387 floating point coprocessor present majority of chips and emulated otherwise. Code compiled with this option will run almost everywhere. The temporary results are computed in 80bit precision instead of precision specified by the type resulting in slightly different results compared to most of other chips. See -ffloat-store for more detailed description. This is the default choice for i386 compiler. sse Use scalar floating point instructions present in the SSE instruction set. This instruction set is supported by Pentium3 and newer chips, in the AMD line by Athlon-4, Athlon-xp and Athlon-mp chips. The earlier version of SSE instruction set supĀ­ ports only single precision arithmetics, thus the double and extended precision arithmetics is still done using 387. Later version, present only in Pentium4 and the future AMD x86-64 chips supports double precision arithmetics too. For i387 you need to use -march=cpu-type, -msse or -msse2 switches to enable SSE extensions and make this option effective. For x86-64 compiler, these extensions are enabled by default. Thank You. Aron Rosenberg http://www.sightspeed.com -- What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |UNCONFIRMED Resolution|INVALID | http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16584