From patchwork Fri Dec 8 10:09:40 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yang Yujie X-Patchwork-Id: 17747 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:bcd1:0:b0:403:3b70:6f57 with SMTP id r17csp5356315vqy; Fri, 8 Dec 2023 02:10:24 -0800 (PST) X-Google-Smtp-Source: AGHT+IENFEAV1lb2qanuqcV6jvsgIQK51yGIWHr6L3EwPYCmqFB0JuTOmUxN3Eb47xQ3hkMVr0bE X-Received: by 2002:a05:622a:14cf:b0:425:4043:8d5f with SMTP id u15-20020a05622a14cf00b0042540438d5fmr4595586qtx.122.1702030223947; Fri, 08 Dec 2023 02:10:23 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1702030223; cv=pass; d=google.com; s=arc-20160816; b=kdVG3kJA6SROjPwatjX54bAYo34XnIIDVdwo3S1OREMer4ZUW5LmtAH5Isn+Tb7Knh ZA8sw3JRzQ5nC7yWU8tqd00b4Ag7300U8ESkC4/UTXb2CcPXjx1Qv8E8qxm78cTF8QrN POl9k+wYgJ3HmWzxxiriPSn4Ibm+Lhe9OBjuLLu7bmpZhCI5wP/Gy7CMkebywg/dEimT pI1zCtfwNBNUuiq+SyQr97php027CHjfpF0YznXykKMtJaHkqTfu4RjTb35boJCvyFLb X6v3Jz5ywcoFcm3R45i+UMOH6nMK0s7Z/y0PvMchRAmDejAVQ9lmEL+I1xLZOiSfZytN IJxQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:message-id:date:subject:cc:to:from:arc-filter :dmarc-filter:delivered-to; bh=BYfHtxNws5ipBCm7H/F4W3r29jma/U5AhWJrbuJ18+E=; fh=cJiQWbguc2oGprXvpNjf3gh0rPKu8mxTX6cRlpztnI0=; b=J1XYtb05/Fh5CotaulTqZ2jeB043Dc28fkanGsQPkYqTX1skVMcVYlCjOQD/W1ia2t HZdMQHWnnC3n6SO73kV7ep224EX/j6H4WLj1ihSpdt/GTSdaB8nqWYRAQbz2KTpYOxQe FKUGHEus0fqyRQRFQmNJTKIrsiauwVEGDbuQoRDPEGmn/c7PyTV7hvIuEQGEsq6svaS5 DgunV9PFwGqZywACSRY6ib3pdYjp4t0xwiWyv0Xzj+dcyeIvtXMkxcmUN+xYREmzchE1 ZmRnRbwL1CTNx1DCCjTQ53Bw7KnxZ3g5z5t4rUXqVagAh1RvX1cWwGmlQkf77x9X1NWV ylsg== ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1); spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org" Received: from server2.sourceware.org (server2.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id cn11-20020a05622a248b00b004254015c5d2si1939549qtb.519.2023.12.08.02.10.23 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 08 Dec 2023 02:10:23 -0800 (PST) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) client-ip=8.43.85.97; Authentication-Results: mx.google.com; arc=pass (i=1); spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 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 0C25E3858C2D for ; Fri, 8 Dec 2023 10:10:21 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail.loongson.cn (mail.loongson.cn [114.242.206.163]) by sourceware.org (Postfix) with ESMTP id 3209E3858CD1 for ; Fri, 8 Dec 2023 10:09:52 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 3209E3858CD1 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=loongson.cn Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=loongson.cn ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 3209E3858CD1 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=114.242.206.163 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1702030195; cv=none; b=VPKmRRT9m3c9IupUowr09f+Ibe6qufi9NuxyL1kKmwg73lOpI9uCkG2C5wmW/KD78l3W1J0hY4NqsJ91lRMRGQ8u3kcUTHOe71ubjKBJYmek4IsqudSeBTiflFfgjMVfRNTwUoVqiF3k2oR42y1QnwpUvIzKz1Isn9t1HCyI5Wk= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1702030195; c=relaxed/simple; bh=/LGz+lWpqB2kYwi5Mq4oQ/1iy31wnc1mJFhGQXGbPtg=; h=From:To:Subject:Date:Message-ID:MIME-Version; b=A0Qv3ZdQ4Q69s/LydsNHFFyZgS0NkrQZ5g9e/IvQOrlevp/t6zxqo6vU8lhG6T/na5ZHNCBUL0MmOFkWATT1TOURnUDd6DWnLCvFY0VTuRP9gGeVIUnSrsaSSpHctZrnc/5sBWBzeDeePqrbcfEPfNQqjW69n6pz+FPDNPap/FY= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from loongson.cn (unknown [114.243.111.185]) by gateway (Coremail) with SMTP id _____8Dx_+ts63Jlx_A_AA--.61122S3; Fri, 08 Dec 2023 18:09:49 +0800 (CST) Received: from localhost.localdomain (unknown [114.243.111.185]) by localhost.localdomain (Coremail) with SMTP id AQAAf8AxDC9r63JlH19YAA--.9614S2; Fri, 08 Dec 2023 18:09:47 +0800 (CST) From: Yang Yujie To: gcc-patches@gcc.gnu.org Cc: ibuclaw@gdcproject.org, xry111@xry111.site, chenglulu@loongson.cn, xuchenghua@loongson.cn, Yang Yujie Subject: [PATCH v3 0/2] LoongArch D support Date: Fri, 8 Dec 2023 18:09:40 +0800 Message-ID: <20231208100942.344748-1-yangyujie@loongson.cn> X-Mailer: git-send-email 2.43.0 MIME-Version: 1.0 X-CM-TRANSID: AQAAf8AxDC9r63JlH19YAA--.9614S2 X-CM-SenderInfo: 51dqw5pxmlvqxorr0wxvrqhubq/1tbiAQATAGVyfSwImwAAsH X-Coremail-Antispam: 1Uk129KBj93XoW7trW5ZF4UKr18Ww4rKr1UCFX_yoW8ArWkpr ZrZF4ftrWYyFWfJws3J3srXa15AFZ3Ww1UXF17t3Wjyr95ur4UKwn3KFWFkFy7G34YqFyj v34xurs8G34qv3cCm3ZEXasCq-sJn29KB7ZKAUJUUUU8529EdanIXcx71UUUUU7KY7ZEXa sCq-sGcSsGvfJ3Ic02F40EFcxC0VAKzVAqx4xG6I80ebIjqfuFe4nvWSU5nxnvy29KBjDU 0xBIdaVrnRJUUUk2b4IE77IF4wAFF20E14v26r1j6r4UM7CY07I20VC2zVCF04k26cxKx2 IYs7xG6rWj6s0DM7CIcVAFz4kK6r126r13M28lY4IEw2IIxxk0rwA2F7IY1VAKz4vEj48v e4kI8wA2z4x0Y4vE2Ix0cI8IcVAFwI0_Gr0_Xr1l84ACjcxK6xIIjxv20xvEc7CjxVAFwI 0_Gr0_Cr1l84ACjcxK6I8E87Iv67AKxVW8Jr0_Cr1UM28EF7xvwVC2z280aVCY1x0267AK xVW8Jr0_Cr1UM2AIxVAIcxkEcVAq07x20xvEncxIr21l57IF6xkI12xvs2x26I8E6xACxx 1l5I8CrVACY4xI64kE6c02F40Ex7xfMcIj6xIIjxv20xvE14v26r1q6rW5McIj6I8E87Iv 67AKxVW8JVWxJwAm72CE4IkC6x0Yz7v_Jr0_Gr1lF7xvr2IYc2Ij64vIr41l42xK82IYc2 Ij64vIr41l4I8I3I0E4IkC6x0Yz7v_Jr0_Gr1lx2IqxVAqx4xG67AKxVWUJVWUGwC20s02 6x8GjcxK67AKxVWUGVWUWwC2zVAF1VAY17CE14v26r126r1DMIIYrxkI7VAKI48JMIIF0x vE2Ix0cI8IcVAFwI0_JFI_Gr1lIxAIcVC0I7IYx2IY6xkF7I0E14v26r1j6r4UMIIF0xvE 42xK8VAvwI8IcIk0rVWUJVWUCwCI42IY6I8E87Iv67AKxVW8JVWxJwCI42IY6I8E87Iv6x kF7I0E14v26r4j6r4UJbIYCTnIWIevJa73UjIFyTuYvjxUco7KUUUUU X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00, KAM_DMARC_STATUS, KAM_SHORT, RCVD_IN_BARRACUDACENTRAL, SPF_HELO_NONE, SPF_PASS, 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 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: , Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1784708044160031811 X-GMAIL-MSGID: 1784708044160031811 This patchset is based on Zixing Liu's initial support patch: https://gcc.gnu.org/pipermail/gcc-patches/2023-September/631260.html Updates v1 -> v2: Rebased onto the dmd/druntime upstream state. v2 -> v3: Dropped unnecessary changes. Regtested on loongarch64-linux-gnu with the following result: === libphobos Summary === FAIL: libphobos.config/test22523.d -- --DRT-testmode=run-main execution test FAIL: libphobos.gc/precisegc.d execution test FAIL: libphobos.phobos/std/datetime/systime.d (test for excess errors) UNRESOLVED: libphobos.phobos/std/datetime/systime.d compilation failed to produce executable UNSUPPORTED: libphobos.phobos/std/net/curl.d: skipped test UNSUPPORTED: libphobos.phobos_shared/std/net/curl.d: skipped test FAIL: libphobos.shared/loadDR.c -ldl -pthread -g execution test (out-of-tree testing) # of expected passes 1024 # of unexpected failures 4 # of unresolved testcases 1 # of unsupported tests 2 === gdc Summary === FAIL: gdc.test/runnable/testaa.d execution test FAIL: gdc.test/runnable/testaa.d -fPIC execution test # of expected passes 10353 # of unexpected failures 2 # of unsupported tests 631 Yang Yujie (2): libruntime: Add fiber context switch code for LoongArch. libphobos: Update build scripts for LoongArch64. libphobos/configure | 21 ++- libphobos/libdruntime/Makefile.am | 3 + libphobos/libdruntime/Makefile.in | 98 ++++++++----- .../config/loongarch/switchcontext.S | 133 ++++++++++++++++++ libphobos/m4/druntime/cpu.m4 | 5 + 5 files changed, 220 insertions(+), 40 deletions(-) create mode 100644 libphobos/libdruntime/config/loongarch/switchcontext.S