From patchwork Wed Aug 30 01:58:04 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yang Yujie X-Patchwork-Id: 13748 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:a7d1:0:b0:3f2:4152:657d with SMTP id p17csp4274684vqm; Tue, 29 Aug 2023 19:02:11 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGgcwoUfsmYnX9pKV1TUdd19xYZY+RuwhwMXEtD9+KBO3x4wbO95zisQXGHMTXaMlCXjY96 X-Received: by 2002:a17:906:768f:b0:9a1:db2e:9dbf with SMTP id o15-20020a170906768f00b009a1db2e9dbfmr525209ejm.14.1693360931318; Tue, 29 Aug 2023 19:02:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1693360931; cv=none; d=google.com; s=arc-20160816; b=K9uCPAx4SbkPULBJO49eX2LGJ1TZHCWGSYkNRuEVSep0HQI6VKG/byYK9iJIQoxBj1 ISos3wYvbDaTkbYyhubLw5CtM7OqE/heKcYYKB+87N3pv3SCHPFdAzjnYy2JIv9YlpxF BHx+SgCvSJusH/YtcRB44CIa9YzuUI1EIM5figfY8giLGq9eQdXQhmkdKQH4AcBoFaTT GFUEzF9PChFpHa/01dAycDNrIjubLhVkl7xJI9fIZj2AyiNIIoym7GNCsrPcAMEUDY8O h5uy7OuYYbuviVmfyDm31HnGXbxJL/nWSNt/znLXeAw8a8aOHA2c98rVeGqmmuGDCHaV j4+A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:message-id:date:subject:to:from:dmarc-filter :delivered-to; bh=93FOk1+mc7xwYaTKPZkw77+uW7W2W/JiLjRgw3WIujc=; fh=+5OiTSMMV8nLi07UPeKgIdk5HIrUS95Zc7GG9BSSpdE=; b=SSEBAM70dVzVifJI6DYx8BbI7c+CoeihHaV3EeQBIMmvQFEY62OYjqumxVgMlTm3O5 wKqww4QyuFnPtDcrT37fTpNTUivlT9l9D16feQhRIsqErfe5aIAHqiivjk6mG7NVQ8FD hMUscBlApMsW2E3y8HvtHeLqth9DOUasMk/OQ8vw9hHK3s2L/2hsgMMzKC+eBVbsMOgb AEubj4fD0Ik11NGVnA8/bKVjS9V97A5KLCbJYpfoBi/OOf+H6odArmUO7Nwdg2szRhow vupPwexsiFgStAYlNwz3h+wfkEgSFeY+5QSdB89xL5QPTTMgBiC66Faupo+cB5UICXBD ZLBg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org" Received: from server2.sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id oy26-20020a170907105a00b0099ca4f61a8dsi4676267ejb.680.2023.08.29.19.02.11 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 29 Aug 2023 19:02:11 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) client-ip=2620:52:3:1:0:246e:9693:128c; Authentication-Results: mx.google.com; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org" Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id CC3D63853837 for ; Wed, 30 Aug 2023 01:59:47 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from eggs.gnu.org (eggs.gnu.org [IPv6:2001:470:142:3::10]) by sourceware.org (Postfix) with ESMTPS id 305873853D21 for ; Wed, 30 Aug 2023 01:58:41 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 305873853D21 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 1qbATc-0004v3-Rn for gcc-patches@gcc.gnu.org; Tue, 29 Aug 2023 21:58:40 -0400 Received: from loongson.cn (unknown [192.168.100.1]) by gateway (Coremail) with SMTP id _____8BxY_A+ou5k4fQcAA--.59175S3; Wed, 30 Aug 2023 09:58:22 +0800 (CST) Received: from localhost.localdomain (unknown [192.168.100.1]) by localhost.localdomain (Coremail) with SMTP id AQAAf8Bxicw5ou5knONmAA--.26621S2; Wed, 30 Aug 2023 09:58:17 +0800 (CST) From: Yang Yujie To: gcc-patches@gcc.gnu.org Subject: [PATCH 0/4] LoongArch: target configuration interface update Date: Wed, 30 Aug 2023 09:58:04 +0800 Message-ID: <20230830015808.19870-1-yangyujie@loongson.cn> X-Mailer: git-send-email 2.41.0 MIME-Version: 1.0 X-CM-TRANSID: AQAAf8Bxicw5ou5knONmAA--.26621S2 X-CM-SenderInfo: 51dqw5pxmlvqxorr0wxvrqhubq/ X-Coremail-Antispam: 1Uk129KBj93XoW7uF1kCF1fCrW3CF1fWF45Jwc_yoW8KFy8pr ZruwnIyF48JrsaqrnrJ3yfWws8X3srGr12va13tr18C3y7ZryUZF18Gr9xXF17uws5Xry2 vr1rKa1jva1UG3gCm3ZEXasCq-sJn29KB7ZKAUJUUUUU529EdanIXcx71UUUUU7KY7ZEXa sCq-sGcSsGvfJ3Ic02F40EFcxC0VAKzVAqx4xG6I80ebIjqfuFe4nvWSU5nxnvy29KBjDU 0xBIdaVrnRJUUUkFb4IE77IF4wAFF20E14v26r1j6r4UM7CY07I20VC2zVCF04k26cxKx2 IYs7xG6rWj6s0DM7CIcVAFz4kK6r106r15M28lY4IEw2IIxxk0rwA2F7IY1VAKz4vEj48v e4kI8wA2z4x0Y4vE2Ix0cI8IcVAFwI0_Jr0_JF4l84ACjcxK6xIIjxv20xvEc7CjxVAFwI 0_Jr0_Gr1l84ACjcxK6I8E87Iv67AKxVW8Jr0_Cr1UM28EF7xvwVC2z280aVCY1x0267AK xVW8Jr0_Cr1UM2AIxVAIcxkEcVAq07x20xvEncxIr21l57IF6xkI12xvs2x26I8E6xACxx 1l5I8CrVACY4xI64kE6c02F40Ex7xfMcIj6xIIjxv20xvE14v26r1j6r18McIj6I8E87Iv 67AKxVWUJVW8JwAm72CE4IkC6x0Yz7v_Jr0_Gr1lF7xvr2IYc2Ij64vIr41l42xK82IYc2 Ij64vIr41l4I8I3I0E4IkC6x0Yz7v_Jr0_Gr1lx2IqxVAqx4xG67AKxVWUJVWUGwC20s02 6x8GjcxK67AKxVWUGVWUWwC2zVAF1VAY17CE14v26r126r1DMIIYrxkI7VAKI48JMIIF0x vE2Ix0cI8IcVAFwI0_Jr0_JF4lIxAIcVC0I7IYx2IY6xkF7I0E14v26r1j6r4UMIIF0xvE 42xK8VAvwI8IcIk0rVWUJVWUCwCI42IY6I8E87Iv67AKxVWUJVW8JwCI42IY6I8E87Iv6x kF7I0E14v26r1j6r4UYxBIdaVFxhVjvjDU0xZFpf9x07j8yCJUUUUU= Received-SPF: pass client-ip=114.242.206.163; envelope-from=yangyujie@loongson.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=-6.6 required=5.0 tests=BAYES_00, KAM_DMARC_STATUS, KAM_SHORT, 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 X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: xuchenghua@loongson.cn, panchenghui@loongson.cn, chenglulu@loongson.cn Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1775617631927192430 X-GMAIL-MSGID: 1775617631927192430 This is an update of https://gcc.gnu.org/pipermail/gcc-patches/2023-August/627275.html Changes since the last patchset: 1. Add new configure option --with-strict-align-lib to control whether -mstrict-align should be used when building libraries. This facilitates building toolchains targeting both LA264 (Loongson 2k1000la) and non-LA264 cores. 2. Define preprocessing macros __loongarch_sx / __loongarch_asx / __loongarch_simd_width that indicates the enabled SIMD extensions. 3. Keep the current non-symmetric multidir layout, but do not build duplicate multilib variants with the same ABI option. Make --with-abi= obsolete to ensure a consistent directory layout. (ABI type of the "toplevel" libraries can be inferred from the target triplet) 4. Using "-mno-lasx" do not cause a fallback to "-msimd=none" as long as the -march= architecture or the default --with-simd= setting has LSX support. 5. Other bug fixes. Yang Yujie (4): LoongArch: improved target configuration interface LoongArch: define preprocessing macros "__loongarch_{arch,tune}" LoongArch: add new configure option --with-strict-align-lib LoongArch: support loongarch*-elf target config-ml.in | 10 + gcc/config.gcc | 408 ++++++++++-------- gcc/config/loongarch/elf.h | 52 +++ .../loongarch/genopts/loongarch-strings | 8 +- gcc/config/loongarch/genopts/loongarch.opt.in | 62 ++- gcc/config/loongarch/la464.md | 32 +- gcc/config/loongarch/loongarch-c.cc | 22 +- gcc/config/loongarch/loongarch-cpu.cc | 263 ++++++----- gcc/config/loongarch/loongarch-cpu.h | 3 +- gcc/config/loongarch/loongarch-def.c | 67 +-- gcc/config/loongarch/loongarch-def.h | 57 +-- gcc/config/loongarch/loongarch-driver.cc | 208 +++++---- gcc/config/loongarch/loongarch-driver.h | 40 +- gcc/config/loongarch/loongarch-opts.cc | 372 +++++++++++----- gcc/config/loongarch/loongarch-opts.h | 59 +-- gcc/config/loongarch/loongarch-str.h | 7 +- gcc/config/loongarch/loongarch.cc | 87 ++-- gcc/config/loongarch/loongarch.opt | 60 ++- gcc/config/loongarch/t-linux | 32 +- gcc/doc/install.texi | 46 +- gcc/doc/invoke.texi | 32 +- libgcc/config.host | 9 +- 22 files changed, 1254 insertions(+), 682 deletions(-) create mode 100644 gcc/config/loongarch/elf.h