From patchwork Tue Feb 21 12:01:48 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arthur Cohen X-Patchwork-Id: 1745567 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=8.43.85.97; helo=sourceware.org; envelope-from=gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=embecosm.com header.i=@embecosm.com header.a=rsa-sha256 header.s=google header.b=D3GHJglk; dkim-atps=neutral Received: from sourceware.org (ip-8-43-85-97.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4PLdW41rzxz240n for ; Tue, 21 Feb 2023 23:14:06 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 375A939ADD03 for ; Tue, 21 Feb 2023 12:12:39 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-wr1-x42a.google.com (mail-wr1-x42a.google.com [IPv6:2a00:1450:4864:20::42a]) by sourceware.org (Postfix) with ESMTPS id 1683638493E8 for ; Tue, 21 Feb 2023 12:04:10 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 1683638493E8 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=embecosm.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=embecosm.com Received: by mail-wr1-x42a.google.com with SMTP id t15so4268473wrz.7 for ; Tue, 21 Feb 2023 04:04:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=embecosm.com; s=google; h=content-transfer-encoding:mime-version:reply-to:references :in-reply-to:message-id:date:subject:cc:to:from:from:to:cc:subject :date:message-id:reply-to; bh=cS4jfXy0zd9Z4iDHTUS/X0Jl6KbAr7Z+iQWYT2shEVc=; b=D3GHJglkZt4pN+lNvQgmKAzjnmyISuOyvQwdvNgeaBbj7f1QWwsgnNGzyfBVLhrfWl ydoj02vn19T5N7RgG1Ed1Ch3cLWe3mI0Y33ITO9v5u9WxQm0w15Ll7FYr3+MS26NZ3e1 3gO/tNVcsGCLbHiqCo4EQAUSzRnNeY/Ts5erS4J+oBUBC8xgS228kJ4k0xnuHmXI3FkY J3KRLFEA8wzK31mhSCwmpeomHm4479qkBn17ST1e+/0iy34AK68cCeSkyXj7g+pJntXq PbpACiMmFU3MyhGMgQ5svumljQiw4O+4VBfRWMXlDio4n1CuP59D4DP2NwFktY8b9EI4 qvAQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:reply-to:references :in-reply-to:message-id:date:subject:cc:to:from:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=cS4jfXy0zd9Z4iDHTUS/X0Jl6KbAr7Z+iQWYT2shEVc=; b=FFcD/HbjOlJS5wPDnpKwLRWPIILt69vw9ODy22Ea6nurk5sCZsoTn0NtJey1z+sABp tJJEQqPJF4MvIXQf8lUYaJcTc7AdFIk/qUY9fPGEmNw4k2RBbqZhW/JwTBUAcxhyhQIu T1I5UAlK1/egPTy0m2ZnIUajVXdxiQO0VStfUOx3WVc7M3Goug5h1efrqnr1wJdb5d/Y MgSa3EJWsxqQj6XsBjdzT5DU+ZQhbyoNgkP6mC0xsLt895qHOnFlvit62JUTa32i4D21 AwCcT6RczfOit0sn9mwWA1hIThyOp+NYYoqKumAIovnXMEcmry9HlgFwApw9LEzXilOz usFA== X-Gm-Message-State: AO0yUKV8PbId2Cxd1NIVxJbW58BMnVwlU7Rgi5guYDTpq82nal5zlKtd zJoW0Fd/2yvKKAH/kOJZGwAIj3vJ7S7dbi8PSA== X-Google-Smtp-Source: AK7set/rTlG+gT6e1TDryyxSaHTa4WXGMr9b/DxpU4223sP60jCDgw5/9KxhDQOnnN2BvK2wNsuCrQ== X-Received: by 2002:a5d:62c7:0:b0:2c5:55cf:b1ab with SMTP id o7-20020a5d62c7000000b002c555cfb1abmr2463146wrv.48.1676981049324; Tue, 21 Feb 2023 04:04:09 -0800 (PST) Received: from platypus.localdomain ([62.23.166.218]) by smtp.gmail.com with ESMTPSA id c15-20020adffb4f000000b002c55b0e6ef1sm5013811wrs.4.2023.02.21.04.04.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Feb 2023 04:04:09 -0800 (PST) From: arthur.cohen@embecosm.com To: gcc-patches@gcc.gnu.org Cc: gcc-rust@gcc.gnu.org, Arthur Cohen Subject: [committed 058/103] gccrs: intrinsics: Add `sorry_handler` intrinsic handler Date: Tue, 21 Feb 2023 13:01:48 +0100 Message-Id: <20230221120230.596966-59-arthur.cohen@embecosm.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230221120230.596966-1-arthur.cohen@embecosm.com> References: <20230221120230.596966-1-arthur.cohen@embecosm.com> MIME-Version: 1.0 X-Spam-Status: No, score=-14.8 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham 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.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: arthur.cohen@embecosm.com Errors-To: gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org Sender: "Gcc-patches" From: Arthur Cohen gcc/rust/ChangeLog: * backend/rust-compile-intrinsic.cc (sorry_handler): New intrinsic handler. gcc/testsuite/ChangeLog: * rust/compile/torture/intrinsics-3.rs: New test. --- gcc/rust/backend/rust-compile-intrinsic.cc | 10 ++++++++++ gcc/testsuite/rust/compile/torture/intrinsics-3.rs | 9 +++++++++ 2 files changed, 19 insertions(+) create mode 100644 gcc/testsuite/rust/compile/torture/intrinsics-3.rs diff --git a/gcc/rust/backend/rust-compile-intrinsic.cc b/gcc/rust/backend/rust-compile-intrinsic.cc index a418b863210..2a2091ccc25 100644 --- a/gcc/rust/backend/rust-compile-intrinsic.cc +++ b/gcc/rust/backend/rust-compile-intrinsic.cc @@ -93,6 +93,15 @@ prefetch_write_data (Context *ctx, TyTy::FnType *fntype) return prefetch_data_handler (ctx, fntype, Prefetch::Write); } +static inline tree +sorry_handler (Context *ctx, TyTy::FnType *fntype) +{ + rust_sorry_at (fntype->get_locus (), "intrinsic %qs is not yet implemented", + fntype->get_identifier ().c_str ()); + + return error_mark_node; +} + static const std::map> generic_intrinsics = { @@ -107,6 +116,7 @@ static const std::map