From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from loongson.cn (mail.loongson.cn [114.242.206.163]) by sourceware.org (Postfix) with ESMTP id 4538B3858D37 for ; Fri, 4 Mar 2022 07:18:34 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 4538B3858D37 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=loongson.cn Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=loongson.cn Received: from 5.5.5 (unknown [10.2.5.5]) by mail.loongson.cn (Coremail) with SMTP id AQAAf9BxgM86vSFilJUCAA--.13364S2; Fri, 04 Mar 2022 15:18:26 +0800 (CST) From: xuchenghua@loongson.cn To: gcc-patches@gcc.gnu.org Cc: joseph@codesourcery.com, paul.hua.gm@gmail.com, xuchenghua@loongson.cn, chenglulu@loongson.cn Subject: [PATCH v8 00/12] Add LoongArch support. Date: Fri, 4 Mar 2022 15:17:57 +0800 Message-Id: <20220304071809.3082015-1-xuchenghua@loongson.cn> X-Mailer: git-send-email 2.31.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-CM-TRANSID: AQAAf9BxgM86vSFilJUCAA--.13364S2 X-Coremail-Antispam: 1UD129KBjvJXoW3JFy8Aw43Jw4rWF1kCw1xKrg_yoW3tF47pr W3Zw13tF48JFsIgr4Dta43Ww1DJr9rKr4a93Waqry8CrW2vryUZFn5Gr9rZFnxXw45XryI vr1rKa1jva1jka7anT9S1TB71UUUUUUqnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDU0xBIdaVrnRJUUUvF14x267AKxVWUJVW8JwAFc2x0x2IEx4CE42xK8VAvwI8IcIk0 rVWrJVCq3wAFIxvE14AKwVWUJVWUGwA2ocxC64kIII0Yj41l84x0c7CEw4AK67xGY2AK02 1l84ACjcxK6xIIjxv20xvE14v26r4j6ryUM28EF7xvwVC0I7IYx2IY6xkF7I0E14v26F4j 6r4UJwA2z4x0Y4vEx4A2jsIE14v26F4UJVW0owA2z4x0Y4vEx4A2jsIEc7CjxVAFwI0_Gc CE3s1le2I262IYc4CY6c8Ij28IcVAaY2xG8wAqx4xG64xvF2IEw4CE5I8CrVC2j2WlYx0E 2Ix0cI8IcVAFwI0_JrI_JrylYx0Ex4A2jsIE14v26r1j6r4UMcvjeVCFs4IE7xkEbVWUJV W8JwACjcxG0xvY0x0EwIxGrwACjI8F5VA0II8E6IAqYI8I648v4I1lw4CEc2x0rVAKj4xx MxkIecxEwVCm-wCF04k20xvY0x0EwIxGrwCFx2IqxVCFs4IE7xkEbVWUJVW8JwC20s026c 02F40E14v26r1j6r18MI8I3I0E7480Y4vE14v26r106r1rMI8E67AF67kF1VAFwI0_JF0_ Jw1lIxkGc2Ij64vIr41lIxAIcVC0I7IYx2IY67AKxVWUJVWUCwCI42IY6xIIjxv20xvEc7 CjxVAFwI0_Jr0_Gr1lIxAIcVCF04k26cxKx2IYs7xG6rW3Jr0E3s1lIxAIcVC2z280aVAF wI0_Jr0_Gr1lIxAIcVC2z280aVCY1x0267AKxVWUJVW8JbIYCTnIWIevJa73UjIFyTuYvj fUOa0PDUUUU X-CM-SenderInfo: x0xfxv5qjk3to6or00hjvr0hdfq/ X-Spam-Status: No, score=-7.2 required=5.0 tests=BAYES_00, KAM_DMARC_STATUS, KAM_SHORT, SPF_HELO_PASS, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Mar 2022 07:18:40 -0000 From: chenglulu Hi, all: This is the v8 version of LoongArch Port. Please review. We know it is stage4, I think it is ok for a new prot. The kernel side upstream waiting for a approval by gcc side, if it is blocked by stage4, a approval for GCC13 will be appreciation. The LoongArch architecture (LoongArch) is an Instruction Set Architecture (ISA) that has a Reduced Instruction Set Computer (RISC) style. The documents are on https://loongson.github.io/LoongArch-Documentation/README-EN.html The ELF ABI Documents are on: https://loongson.github.io/LoongArch-Documentation/LoongArch-ELF-ABI-EN.html The binutils has been merged into trunk: https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=560b3fe208255ae909b4b1c88ba9c28b09043307 Note: We split -mabi= into -mabi=lp64d/f/s, the new options not support by upstream binutils yet, this GCC port requires the following patch applied to binutils to build. https://github.com/loongson/binutils-gdb/commit/aacb0bf860f02aa5a7dcb76dd0e392bf871c7586 (will be submitted to upstream after gcc side comfirmed) We have compiled more than 300 CLFS packages with this compiler. The CLFS are currently used on Cfarm machines gcc400 and gcc401. changelog: v1 -> v2 1. Split patch set. 2. Change some code style. 3. Add -mabi=lp64d/f/s options. 4. Change GLIBC_DYNAMIC_LINKER_LP64 name. v2 -> v3 1. Change some code style. 2. Bug fix. v3 -> v4 1. Change some code style. 2. Bug fix. 3. Delete some builtin macros. v4 -> v5 1. delete wrong insn zero_extendsidi2_internal. 2. Adjust some build options. 3. Change some .c files to .cc. v5 -> v6 1. Fix compilation issues. The generated files *.opt and *.h are generated to $(objdir). v6 -> v7 1. Bug fix. 2. Change some code style. v7 -> v8 1. Add new addressing type ADDRESS_REG_REG support. 2. Modify documentation. 3. Eliminate compile-time warnings. chenglulu (12): LoongArch Port: Regenerate configure LoongArch Port: gcc build LoongArch Port: Regenerate gcc/configure. LoongArch Port: Machine description files. LoongArch Port: Machine description C files and .h files. LoongArch Port: Builtin functions. LoongArch Port: Builtin macros. LoongArch Port: libgcc LoongArch Port: Regenerate libgcc/configure. LoongArch Port: libgomp LoongArch Port: gcc/testsuite LoongArch Port: Add doc. config/picflag.m4 | 3 + configure | 10 +- configure.ac | 10 +- contrib/config-list.mk | 5 +- contrib/gcc_update | 2 + .../config/loongarch/loongarch-common.cc | 73 + gcc/config.gcc | 410 +- gcc/config/host-linux.cc | 2 + gcc/config/loongarch/constraints.md | 204 + gcc/config/loongarch/generic.md | 132 + gcc/config/loongarch/genopts/genstr.sh | 91 + .../loongarch/genopts/loongarch-strings | 58 + gcc/config/loongarch/genopts/loongarch.opt.in | 189 + gcc/config/loongarch/gnu-user.h | 84 + gcc/config/loongarch/la464.md | 132 + gcc/config/loongarch/larchintrin.h | 413 ++ gcc/config/loongarch/linux.h | 50 + gcc/config/loongarch/loongarch-builtins.cc | 511 ++ gcc/config/loongarch/loongarch-c.cc | 109 + gcc/config/loongarch/loongarch-cpu.cc | 206 + gcc/config/loongarch/loongarch-cpu.h | 30 + gcc/config/loongarch/loongarch-def.c | 164 + gcc/config/loongarch/loongarch-def.h | 151 + gcc/config/loongarch/loongarch-driver.cc | 187 + gcc/config/loongarch/loongarch-driver.h | 69 + gcc/config/loongarch/loongarch-ftypes.def | 106 + gcc/config/loongarch/loongarch-modes.def | 29 + gcc/config/loongarch/loongarch-opts.cc | 580 ++ gcc/config/loongarch/loongarch-opts.h | 86 + gcc/config/loongarch/loongarch-protos.h | 240 + gcc/config/loongarch/loongarch-str.h | 57 + gcc/config/loongarch/loongarch-tune.h | 72 + gcc/config/loongarch/loongarch.cc | 6450 +++++++++++++++++ gcc/config/loongarch/loongarch.h | 1273 ++++ gcc/config/loongarch/loongarch.md | 3712 ++++++++++ gcc/config/loongarch/loongarch.opt | 189 + gcc/config/loongarch/predicates.md | 527 ++ gcc/config/loongarch/sync.md | 574 ++ gcc/config/loongarch/t-linux | 53 + gcc/config/loongarch/t-loongarch | 68 + gcc/configure | 66 +- gcc/configure.ac | 33 +- gcc/doc/install.texi | 47 +- gcc/doc/invoke.texi | 202 + gcc/doc/md.texi | 55 + gcc/testsuite/g++.dg/cpp0x/constexpr-rom.C | 2 +- gcc/testsuite/g++.old-deja/g++.abi/ptrmem.C | 2 +- gcc/testsuite/g++.old-deja/g++.pt/ptrmem6.C | 2 +- gcc/testsuite/gcc.dg/20020312-2.c | 2 + gcc/testsuite/gcc.dg/loop-8.c | 2 +- .../torture/stackalign/builtin-apply-2.c | 2 +- gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-3.c | 2 +- .../gcc.target/loongarch/loongarch.exp | 40 + .../gcc.target/loongarch/tst-asm-const.c | 16 + gcc/testsuite/go.test/go-test.exp | 3 + gcc/testsuite/lib/target-supports.exp | 14 + libgcc/config.host | 28 +- libgcc/config/loongarch/crtfastmath.c | 52 + libgcc/config/loongarch/crti.S | 43 + libgcc/config/loongarch/crtn.S | 39 + libgcc/config/loongarch/linux-unwind.h | 80 + libgcc/config/loongarch/sfp-machine.h | 152 + libgcc/config/loongarch/t-crtstuff | 5 + libgcc/config/loongarch/t-loongarch | 7 + libgcc/config/loongarch/t-loongarch64 | 1 + libgcc/config/loongarch/t-softfp-tf | 3 + libgcc/configure | 5 +- libgcc/configure.ac | 2 +- libgomp/configure.tgt | 4 + 69 files changed, 18194 insertions(+), 28 deletions(-) create mode 100644 gcc/common/config/loongarch/loongarch-common.cc create mode 100644 gcc/config/loongarch/constraints.md create mode 100644 gcc/config/loongarch/generic.md create mode 100755 gcc/config/loongarch/genopts/genstr.sh create mode 100644 gcc/config/loongarch/genopts/loongarch-strings create mode 100644 gcc/config/loongarch/genopts/loongarch.opt.in create mode 100644 gcc/config/loongarch/gnu-user.h create mode 100644 gcc/config/loongarch/la464.md create mode 100644 gcc/config/loongarch/larchintrin.h create mode 100644 gcc/config/loongarch/linux.h create mode 100644 gcc/config/loongarch/loongarch-builtins.cc create mode 100644 gcc/config/loongarch/loongarch-c.cc create mode 100644 gcc/config/loongarch/loongarch-cpu.cc create mode 100644 gcc/config/loongarch/loongarch-cpu.h create mode 100644 gcc/config/loongarch/loongarch-def.c create mode 100644 gcc/config/loongarch/loongarch-def.h create mode 100644 gcc/config/loongarch/loongarch-driver.cc create mode 100644 gcc/config/loongarch/loongarch-driver.h create mode 100644 gcc/config/loongarch/loongarch-ftypes.def create mode 100644 gcc/config/loongarch/loongarch-modes.def create mode 100644 gcc/config/loongarch/loongarch-opts.cc create mode 100644 gcc/config/loongarch/loongarch-opts.h create mode 100644 gcc/config/loongarch/loongarch-protos.h create mode 100644 gcc/config/loongarch/loongarch-str.h create mode 100644 gcc/config/loongarch/loongarch-tune.h create mode 100644 gcc/config/loongarch/loongarch.cc create mode 100644 gcc/config/loongarch/loongarch.h create mode 100644 gcc/config/loongarch/loongarch.md create mode 100644 gcc/config/loongarch/loongarch.opt create mode 100644 gcc/config/loongarch/predicates.md create mode 100644 gcc/config/loongarch/sync.md create mode 100644 gcc/config/loongarch/t-linux create mode 100644 gcc/config/loongarch/t-loongarch create mode 100644 gcc/testsuite/gcc.target/loongarch/loongarch.exp create mode 100644 gcc/testsuite/gcc.target/loongarch/tst-asm-const.c create mode 100644 libgcc/config/loongarch/crtfastmath.c create mode 100644 libgcc/config/loongarch/crti.S create mode 100644 libgcc/config/loongarch/crtn.S create mode 100644 libgcc/config/loongarch/linux-unwind.h create mode 100644 libgcc/config/loongarch/sfp-machine.h create mode 100644 libgcc/config/loongarch/t-crtstuff create mode 100644 libgcc/config/loongarch/t-loongarch create mode 100644 libgcc/config/loongarch/t-loongarch64 create mode 100644 libgcc/config/loongarch/t-softfp-tf -- 2.31.1