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 EDF0A3858CDB for ; Fri, 26 May 2023 14:08:14 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org EDF0A3858CDB Authentication-Results: sourceware.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=fail smtp.mailfrom=gmail.com Received: from mail-ej1-x630.google.com ([2a00:1450:4864:20::630]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1q2Y73-0001iK-5W for gcc@gnu.org; Fri, 26 May 2023 10:08:14 -0400 Received: by mail-ej1-x630.google.com with SMTP id a640c23a62f3a-96f0678de80so128928966b.3 for ; Fri, 26 May 2023 07:08:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1685110091; x=1687702091; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=OS+98Sxuulvrkhpa5FtYGgASv/QleqpAQYgEhQOqguk=; b=gT4q1D/l3I+NI9p1Boq+7x7syVJOCrVdg6RzEbO3Up6RKX86TMkjDv+lCMs+C9vfC9 oLlrVgA+CkuMaLMDh0LyYXYG2wQcMwmzZuNm0IYgRB58XTtK9f2g2SFMg3B1xddPiPHi 9KnNYEh0v6u5K5ZM6hGUMzvY8JnaGPvDrBnbcLWRavvbYSSN52QQ5hla4G32GV5gAwzJ 6ZY0iUxX9UPhTp9GqZxcc5fSM4M81JmKtgH0qLQLybfJTgkumhj7pDIBW4zYqxUyI4Lv vcFnY9NaqhTl8Y6zOZ6DbUohtwhYupLlpwIbOqFegBNkp9m7c5H33FxSA9T8+1CsTNwt c+GA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685110091; x=1687702091; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=OS+98Sxuulvrkhpa5FtYGgASv/QleqpAQYgEhQOqguk=; b=RvhfiF6Ia1fNr4nTkTHJZpPwbP2Rz9ZV6157YDRNFAJW89oQ1k9W7drszFqYZb0uTD Y1wH8DESpgZmWYNhYAUmz3wL1pbJ14QK3/EmuhNu/ZKNlUtMhEBWLZrrRALnwwg1hQnJ R3iK0K6jh+b7A6329GFnmesqOCLRSHe7nwxeaeKLYfxFT7l6GctE/Cc4GIMNnTuIGLMP YgL84tFjhhTT2W98dWHTiQKNAucHCsZidGOz9CVrqhihBoH1z6iSlqvqexFsazxiA6Yt eIBU7eH3+tndLUGoA7YbuZQSshw4BUZ6fjv4RcttIr2Fq/MJzBcIHzB+eC/7T34As7+u aLbQ== X-Gm-Message-State: AC+VfDw2A0FviTprWeiH2RjKMvgJxA16KXNB6rot2qoOhyBnVHZD8//I NwzkthNARIOug1JUr1Wb+fFtAwgJXB3LIKybEgw= X-Google-Smtp-Source: ACHHUZ6hs0CsKiNs4vZDfc7jjDr2OQpyO/jVqalNYYjveatUxI3MOCI8JYeGYbJE/i+/knhp6NoGaJ8Ump1mDgJeeGk= X-Received: by 2002:a17:907:2684:b0:969:e55f:cca2 with SMTP id bn4-20020a170907268400b00969e55fcca2mr2022236ejc.38.1685110091217; Fri, 26 May 2023 07:08:11 -0700 (PDT) MIME-Version: 1.0 References: <51071A92918346ABBC6B5703179F5174@H270> <896EB515110646CEBAA84E98E273E4B8@H270> <4BD5D8BA8E0F45098CC3E2B188A216E6@H270> In-Reply-To: From: Jonathan Wakely Date: Fri, 26 May 2023 15:07:59 +0100 Message-ID: Subject: Re: Will GCC eventually support SSE2 or SSE4.1? To: Stefan Kanthak Cc: Jakub Jelinek , gcc@gnu.org, Andrew Pinski Content-Type: text/plain; charset="UTF-8" Received-SPF: pass client-ip=2a00:1450:4864:20::630; envelope-from=jwakely.gcc@gmail.com; helo=mail-ej1-x630.google.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,DKIM_SIGNED=0.1,DKIM_VALID=-0.1,DKIM_VALID_AU=-0.1,DKIM_VALID_EF=-0.1,FREEMAIL_FROM=0.001,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=-0.4 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,KAM_SHORT,SPF_HELO_PASS,SPF_SOFTFAIL,TXREP,T_SCC_BODY_TEXT_LINE autolearn=no 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, 26 May 2023 at 14:55, Stefan Kanthak wrote: > > "Jakub Jelinek" wrote: > > > 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). > > PLEASE read your own documentation and specify ANY: > > | -m32 > ... > | generates code that runs on any i386 system. > > The first example of my initial posts falsifies "runs on any i386 system"! Which is why that word "any" has been acknowledged as a bug: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109954 The word "any" is wrong. We know it's wrong. We've acknowledged it's wrong. I've even proposed wording to fix it in that bug report. What part of this is still hard to understand? > > > -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. > > But "the last one wins" does NOT apply to -m32 or -m: the latter > are additive, INDEPENDENT from their position before or after -march=, > what is NOT documented, and -m32 fails to disable all -m not > common to ANY i386 system set before, thus contradicting the documentation. See above. > > 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 ... > > These points are obvious. > NOT obvious is but that -m -march= does not clear any > not supported in , i.e the last one does NOT win here. The last -march option selects the base set of instructions. The -mISA options modify that base.