From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from eggs.gnu.org (eggs.gnu.org [IPv6:2001:470:142:3::10]) by sourceware.org (Postfix) with ESMTPS id E73AC3858C60 for ; Fri, 26 May 2023 12:38:26 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org E73AC3858C60 Authentication-Results: sourceware.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=fail smtp.mailfrom=redhat.com Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1q2Whg-00049v-M0 for gcc@gnu.org; Fri, 26 May 2023 08:38:08 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1685104675; h=from:from:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:in-reply-to:in-reply-to: references:references; bh=HvJtQyt9q6vnUYHpP3SbK8wGyyAH2EE88+ue6q+GtFY=; b=SahKVNlIsjBMIADktaCMWBY1hZH3Q1S4NNz9tb/qYtjhXUXskS4YUy5usGTeQsyF0GtV8Y c/5Nb7LERzNIIrwtDgXMK4e/mJQsshgBbFOYic4XFiJUDDxb5hp+MPf4tJ4m+DUM/C1r03 qUhIHN5Lej5MQZcy11CePVNDqDGywbA= Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-594-PumLQIanPfy3zbUr9au30w-1; Fri, 26 May 2023 08:37:54 -0400 X-MC-Unique: PumLQIanPfy3zbUr9au30w-1 Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id B0AE4280AA66; Fri, 26 May 2023 12:37:53 +0000 (UTC) Received: from tucnak.zalov.cz (unknown [10.39.192.17]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 70E59492B00; Fri, 26 May 2023 12:37:53 +0000 (UTC) Received: from tucnak.zalov.cz (localhost [127.0.0.1]) by tucnak.zalov.cz (8.17.1/8.17.1) with ESMTPS id 34QCbohl2460180 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Fri, 26 May 2023 14:37:50 +0200 Received: (from jakub@localhost) by tucnak.zalov.cz (8.17.1/8.17.1/Submit) id 34QCbnTh2460179; Fri, 26 May 2023 14:37:49 +0200 Date: Fri, 26 May 2023 14:37:48 +0200 From: Jakub Jelinek To: Stefan Kanthak Cc: Jonathan Wakely , gcc@gnu.org, Andrew Pinski Subject: Re: Will GCC eventually support SSE2 or SSE4.1? Message-ID: Reply-To: Jakub Jelinek References: <51071A92918346ABBC6B5703179F5174@H270> <896EB515110646CEBAA84E98E273E4B8@H270> <4BD5D8BA8E0F45098CC3E2B188A216E6@H270> MIME-Version: 1.0 In-Reply-To: X-Scanned-By: MIMEDefang 3.1 on 10.11.54.9 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Received-SPF: pass client-ip=170.10.133.124; envelope-from=jakub@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9,DKIMWL_WL_HIGH=-0.001,DKIM_SIGNED=0.1,DKIM_VALID=-0.1,DKIM_VALID_AU=-0.1,DKIM_VALID_EF=-0.1,RCVD_IN_DNSWL_NONE=-0.0001,SPF_HELO_NONE=0.001,SPF_PASS=-0.001,T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Status: No, score=-3.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_PASS,SPF_NONE,TXREP,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On Fri, May 26, 2023 at 02:19:54PM +0200, Stefan Kanthak wrote: > > I find it very SURPRISING that you're only just learning the basics of > > how to use gcc NOW, after YELLING about all the OUCH. > > I'm NOT surprised that you don't grok it! > > gcc -msse4.1 -m32 -march=core2 ... > > Which -m* options win here? > Do -m32 or -march=core2 override -msse4.1? Jonathan told you what to use to find it out (-Q --help=target). -m32/-m64/-mx32/-m16 options don't affect the ISA, they switch the main ABI (ilp32 32-bit code, lp64 64-bit code, ilp32 code running in 64-bit mode, 16-bit code). -march= options selects the ISA base (which CPU family to compile form as minimum), if you don't supply it, the default from how gcc has been configured is selected (e.g. if you configure --with-arch-32=core2, then that will be the -m32 default, if you configure --with-arch=x86-64, that will be the -march default if --with-arch-32= isn't specified, etc.). If more than one -march= is specified, the last one wins. And, the -mISA options then tweak the ISA set. Most ISAs have dependencies, say -msse4.1 enables -mssse3 which enables -msse3 which enables -msse2 etc., and similarly the -mno-ISA options disable what ISAs depend on it, so -mno-avx disables -mno-avx2 which disables -mno-avx512f which disables ... -mtune= option specifies for which CPU family the code should be tuned, it will still run on any code compatible with the implicit or explicit -march=, but will schedule instructions or choose from alternative forms from the selected ISAs to perform best on the -mtune= family. Jakub