From patchwork Fri Dec 1 10:08:24 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yang Yujie X-Patchwork-Id: 17396 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:bcd1:0:b0:403:3b70:6f57 with SMTP id r17csp1010145vqy; Fri, 1 Dec 2023 02:09:19 -0800 (PST) X-Google-Smtp-Source: AGHT+IHPRGDiO+yVHN0MvrqOizVNJOnBGrWXoQYzds3A9N00EgOgZbN5Ce4AJPllVWiG0gtIceOY X-Received: by 2002:a05:6808:2022:b0:3b8:3398:bae1 with SMTP id q34-20020a056808202200b003b83398bae1mr2800780oiw.9.1701425358941; Fri, 01 Dec 2023 02:09:18 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1701425358; cv=pass; d=google.com; s=arc-20160816; b=SqRcNahoU+4f4vVm2H1aJA1TotmbSLLIKimBMZxh14sarNLfBb8OuS3u42k16OTxGk Oa+hnN3gZLBqfAd/ViXlDVYMUn+51ccVkjwoSCwOZ4W0vg+wv1U9WKAsH0pxzk4EHH2u ThpkloapnikXUzR4SQ+7oP+lTN9OW6SbYZO2fxVg4P2kV9qSQwXvSVgsCj+bH9epBH0o jtiAshGsNGoxNxzOm+PjCuB1h4zYxKtsKgEkxCgym3FzNi0HCPJOPD43ch+LIJfUuRVy kKs4YvmY9HTEMc2jOVs8/KIHe/WUX7rRxohoO5X8UAEsC8VM/cgXlU+9RmoCukh9r93R vv8A== 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=9rMyVutDO5pQ6lSDya+SQuZraw8KvKoD/F6Y5OGxw7U=; fh=VFD5eYl510E0D7tfYWonjUWoUtzpkuPIJoNSX660rc0=; b=JfU9pgR0rupxG0xWwxkakHp3VEHmxjp/Syuy090gER8vYA1KC6Xb1HvYWYDfTMCtZt EWwVynRYcSQcY845TsOMcVYGBjakoph8ogqVwyqnVK5rIoTv/o+CXOmNgDJK1OQlXbd/ Yh8zq0yqrcqbKQUQRGQa1BymuOeep3rRIywJr/npOGThqpt70nwyshFw1e3kxHWBUbkT rvoPgR3sjvYw8n8jcESLi9th1sGpvkHheamv9vi6FZxpP/6rhmj0w8pf9vR+df+sNYYm nSq4zcxLNL5tKxLeei/RE2oKK9A4k1z07jyOydSEW3FVRGeyPoieD6KxpgJICNa0gGNM pXcw== 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 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 jr16-20020a05622a801000b00423cd1ec88bsi2676489qtb.563.2023.12.01.02.09.18 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Dec 2023 02:09:18 -0800 (PST) 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; arc=pass (i=1); 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 826F93860745 for ; Fri, 1 Dec 2023 10:09:15 +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 98292385C8B0 for ; Fri, 1 Dec 2023 10:08:43 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 98292385C8B0 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 98292385C8B0 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=1701425327; cv=none; b=kc02J3U/Xi6yeTgX45IfbBXvy+lhRgAcXQ9aQnidfiazeHLv1tEgFZzhnwxuy/iSfettZINLh09pOOi++daj+hLXyJ2I40d5QKOnZ+ujn9+TqPxE74xaaOjpLZ/k+sJcy4QyhdRmsfVF0/XAdideqGfcU/ZvWvMyiYlHSCLQ1To= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1701425327; c=relaxed/simple; bh=5SuA5uKsuqRcxR01PRtmNhQrCgi9H8vQbZ5cm1K0EWE=; h=From:To:Subject:Date:Message-ID:MIME-Version; b=PMkvWz+pNwnxVL6P2RdLO9+6UPg/tvE8FbAJIrqlrqnfNhfTQrUX9YbR75p6ujs9I3g+Dm3fcMrYq6Z+cPLWSmX7EylYyDbeu1nJSL4H0Qr1CRxC3PkbHk+gy1Tptj72SazHHEYZIKC+RNusgKkj1BtK3NGAWIx1f0/l6oR4qMA= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from loongson.cn (unknown [114.243.104.185]) by gateway (Coremail) with SMTP id _____8AxlPCosGllhys+AA--.58340S3; Fri, 01 Dec 2023 18:08:41 +0800 (CST) Received: from localhost.localdomain (unknown [114.243.104.185]) by localhost.localdomain (Coremail) with SMTP id AQAAf8CxLC+lsGllaYRRAA--.8937S2; Fri, 01 Dec 2023 18:08:37 +0800 (CST) From: Yang Yujie To: gcc-patches@gcc.gnu.org Cc: ibuclaw@gdcproject.org, chenglulu@loongson.cn, xuchenghua@loongson.cn, Yang Yujie Subject: [PATCH v3 0/3] LoongArch D support Date: Fri, 1 Dec 2023 18:08:24 +0800 Message-ID: <20231201100827.227376-1-yangyujie@loongson.cn> X-Mailer: git-send-email 2.43.0 MIME-Version: 1.0 X-CM-TRANSID: AQAAf8CxLC+lsGllaYRRAA--.8937S2 X-CM-SenderInfo: 51dqw5pxmlvqxorr0wxvrqhubq/1tbiAQAMAGVpQqsHIgAXsa X-Coremail-Antispam: 1Uk129KBj93XoW7trWUWFyruw1DWF1fZFykCrX_yoW8Cry7pr ZrZF1ftrWYyFWxJws3J3srXa15AFZ3Ww1UXFy7tw1jyryrur4UKwn3KrWF9F17G34YqFyj vryxuws8Ga4qv3cCm3ZEXasCq-sJn29KB7ZKAUJUUUU8529EdanIXcx71UUUUU7KY7ZEXa sCq-sGcSsGvfJ3Ic02F40EFcxC0VAKzVAqx4xG6I80ebIjqfuFe4nvWSU5nxnvy29KBjDU 0xBIdaVrnRJUUUk2b4IE77IF4wAFF20E14v26r1j6r4UM7CY07I20VC2zVCF04k26cxKx2 IYs7xG6rWj6s0DM7CIcVAFz4kK6r1j6r18M28lY4IEw2IIxxk0rwA2F7IY1VAKz4vEj48v e4kI8wA2z4x0Y4vE2Ix0cI8IcVAFwI0_Gr0_Xr1l84ACjcxK6xIIjxv20xvEc7CjxVAFwI 0_Gr0_Cr1l84ACjcxK6I8E87Iv67AKxVW8Jr0_Cr1UM28EF7xvwVC2z280aVCY1x0267AK xVW8Jr0_Cr1UM2AIxVAIcxkEcVAq07x20xvEncxIr21l57IF6xkI12xvs2x26I8E6xACxx 1l5I8CrVACY4xI64kE6c02F40Ex7xfMcIj6xIIjxv20xvE14v26r1Y6r17McIj6I8E87Iv 67AKxVW8JVWxJwAm72CE4IkC6x0Yz7v_Jr0_Gr1lF7xvr2IYc2Ij64vIr41l42xK82IYc2 Ij64vIr41l4I8I3I0E4IkC6x0Yz7v_Jr0_Gr1lx2IqxVAqx4xG67AKxVWUJVWUGwC20s02 6x8GjcxK67AKxVWUGVWUWwC2zVAF1VAY17CE14v26r126r1DMIIYrxkI7VAKI48JMIIF0x vE2Ix0cI8IcVAFwI0_Jr0_JF4lIxAIcVC0I7IYx2IY6xkF7I0E14v26r1j6r4UMIIF0xvE 42xK8VAvwI8IcIk0rVWUJVWUCwCI42IY6I8E87Iv67AKxVW8JVWxJwCI42IY6I8E87Iv6x kF7I0E14v26r4j6r4UJbIYCTnIWIevJa73UjIFyTuYvjxU7pnQUUUUU X-Spam-Status: No, score=-4.6 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: 1784064883076889601 X-GMAIL-MSGID: 1784073797404519867 This patchset is based on Zixing Liu's initial support patch: https://gcc.gnu.org/pipermail/gcc-patches/2023-September/631260.html Update v1 -> v3: Rebased onto the dmd/druntime upstream state. 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 (3): LoongArch: Adjust D version strings. libphobos: Update build scripts for LoongArch64. libruntime: Add fiber context switch code for LoongArch. gcc/config/loongarch/loongarch-d.cc | 27 ++-- gcc/d/dmd/cond.d | 6 +- gcc/d/implement-d.texi | 6 + libphobos/configure | 21 ++- libphobos/libdruntime/Makefile.am | 3 + libphobos/libdruntime/Makefile.in | 98 ++++++++----- .../config/loongarch/switchcontext.S | 133 ++++++++++++++++++ libphobos/m4/druntime/cpu.m4 | 5 + 8 files changed, 243 insertions(+), 56 deletions(-) create mode 100644 libphobos/libdruntime/config/loongarch/switchcontext.S