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 8EBF73858426 for ; Wed, 30 Aug 2023 06:52:01 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 8EBF73858426 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=loongson.cn Authentication-Results: sourceware.org; spf=fail smtp.mailfrom=loongson.cn Received: from mail.loongson.cn ([114.242.206.163]) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qbF3V-0001TA-BJ for gcc-patches@gcc.gnu.org; Wed, 30 Aug 2023 02:52:01 -0400 Received: from loongson.cn (unknown [192.168.100.1]) by gateway (Coremail) with SMTP id _____8CxtPAF5+5kRQIdAA--.60040S3; Wed, 30 Aug 2023 14:51:49 +0800 (CST) Received: from 3a5000 (unknown [192.168.100.1]) by localhost.localdomain (Coremail) with SMTP id AQAAf8Cx1swD5+5ksgdnAA--.27620S2; Wed, 30 Aug 2023 14:51:48 +0800 (CST) Date: Wed, 30 Aug 2023 14:51:49 +0800 From: Yujie Yang To: Xi Ruoyao Cc: Yang Yujie , gcc-patches@gcc.gnu.org, xuchenghua@loongson.cn, chenglulu@loongson.cn, panchenghui@loongson.cn Subject: Re: [PATCH v2 3/4] LoongArch: add new configure option --with-strict-align-lib Message-ID: References: <20230830015808.19870-1-yangyujie@loongson.cn> <20230830015808.19870-4-yangyujie@loongson.cn> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-CM-TRANSID:AQAAf8Cx1swD5+5ksgdnAA--.27620S2 Authentication-Results: localhost.localdomain; spf=neutral smtp.mail=y angyujie@loongson.cn; X-CM-SenderInfo: 51dqw5pxmlvqxorr0wxvrqhubq/ X-Coremail-Antispam: 1Uk129KBj93XoW7ur45GryxKr4xZFyDJF1rXwc_yoW8Xr1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son.cn; helo=mail.loongson.cn X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9,SPF_HELO_NONE=0.001,SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Status: No, score=-5.1 required=5.0 tests=BAYES_00,BODY_8BITS,KAM_DMARC_STATUS,SPF_FAIL,SPF_HELO_PASS,TXREP 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: > > LoongArch processors may not support memory accesses without natural > > alignments.  Building libraries with -mstrict-align may help with > > toolchain binary compatiblity and performance on these implementations > > (e.g. Loongson 2K1000LA). > > > > No significant performance degredation is observed on current mainstream > > LoongArch processors when the option is enabled. > > > > gcc/ChangeLog: > > > >         * config.gcc: use -mstrict-align for building libraries > >         if --with-strict-align-lib is given. > > Isn't this equivalent to --with-default-multilib=mno-strict-align now? > > And I still believe the easiest way for 2K1000LA is adding -march=la264 > support so the user can simply configure with --with-arch=la264. Not exactly -- Options given in --with-multilib-default= will not be applied to multilib variants that have build options specified in --with-multilib-list, but --with-strict-align-lib is always effective. e.g. for the following configuration: --with-multilib-default=mstrict-align --with-multilib-list=lp64d/la464,lp64s The library build options would be: base/lp64d variant: -mabi=lp64d -march=la464 (no -mstrict-align appended) base/lp64s variant: -mabi=lp64s -march=abi-default -mstrict-align Sure, you can do it with --with-arch=la264. It's just a convenient switch that we can use for building generic toolchains.