From patchwork Wed May 8 05:38:53 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Christoph_M=C3=BCllner?= X-Patchwork-Id: 1932789 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=vrull.eu header.i=@vrull.eu header.a=rsa-sha256 header.s=google header.b=WHgOkoO6; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=server2.sourceware.org; envelope-from=gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=patchwork.ozlabs.org) Received: from server2.sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4VZ3qh4MV1z214K for ; Wed, 8 May 2024 15:39:27 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id B935B3842AC1 for ; Wed, 8 May 2024 05:39:25 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-ej1-x630.google.com (mail-ej1-x630.google.com [IPv6:2a00:1450:4864:20::630]) by sourceware.org (Postfix) with ESMTPS id 4050E3858D20 for ; Wed, 8 May 2024 05:39:01 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 4050E3858D20 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=vrull.eu Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=vrull.eu ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 4050E3858D20 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2a00:1450:4864:20::630 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1715146743; cv=none; b=uJ7u0muSSDTOqFtUHrPFm4JJ/De0kPrvFKx5KHD19Oq7tBN+9y6n87F0rH3Tga5LwtwosOwdBP215ZMv2J6zTQaPtFWpDyOIVo/KHgIZn6XVDTyUmjWdO+HEMJahzNEGiuqf0fpajHEtUhHKjEsW9k8GLqV7Cpry4PGI3Mkj55M= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1715146743; c=relaxed/simple; bh=gaprwQFFpwen0JlKw8eoHyKR8vRmtVVZWLqYa509Ydk=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=hRJmDbOZ3JQuHGkjDPN5oWVK9xQCVidzFwdcJXEix6HgW5dPK13PAPhkSICk3KBj5uzXkepjD7g5ZVlTiHQKxnjhTrCzduAmO+vd151SA8m+UDlZHHjeXL74HMB+WMLskEMZNIzu10T6JJ18p50Ou9T2sVetfgSVQO/kmLJeCSk= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-ej1-x630.google.com with SMTP id a640c23a62f3a-a59c04839caso867612966b.2 for ; Tue, 07 May 2024 22:39:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vrull.eu; s=google; t=1715146739; x=1715751539; darn=gcc.gnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=ykjpT/y4cxbhW3Bf6elanWHPlyR/4JFjhNOd0yN7YFc=; b=WHgOkoO6cse/RRApejYLQXaOp2M2aC9HWW/I9tgNT6ru3Yiuk4yPQOtwKNuk5reKzK m1bg1Pb354/mkbROicus2/CadfuFaW1YasmQzwnTSLgKdavgiugn97CQodez7wC0huYS 0XXRB4aE67o3oRCxoGGX14oRG9tgRSa+4IvuoJY0MNNBD7+tqYnUeibwofu3pDe6pEFc xQrDLjeTsGW4Wqpj0b7+Kl1r3uVkv+ik46GV2lK+TGFtMvCvqV/jM9As9+hrkEQ1vUWn 1mqmK8LyNwVoNiNZBaRu+iUzzwR4KoeqEhG3fWBjaCyTLCHZJxn/BQe9/WufsWWZbFcS s5Eg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715146739; x=1715751539; h=content-transfer-encoding:mime-version: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=ykjpT/y4cxbhW3Bf6elanWHPlyR/4JFjhNOd0yN7YFc=; b=jEFqOzk6dvWPLXblxGvmaNxNCdtQ4pRg5jomOB1T3K/l2I9XMOZCmlwNMfLNkZw8qx yNEFY+bZYKTubL0qUsw8CW/iOYaYHdrVr7qDGNVWCKHQenYSfqikmzIzFcYwfgfIB+/4 IekieapQI2pQejBliYWsOdxvc/3eKxvctdq6+d406Pk3wSRicgmxiuyISvrFSoVLiEEw BxM9+BFTkQiXpKGjLjjZ6ciLnqsMv8ODzhxXpy3uGjt15CGqXwgWKROSqiXoVYON/5EG dyu0Y9moju6Brsq/XOwI5tMEE+oiueVGuohhRe5n3VpywEhnzd0o+x8tS2ecvYHHAguM ZnBw== X-Gm-Message-State: AOJu0YzppthRFS9wvgXgRxtATMXLNXIowNRup8H51v7ZC3f/xPcl1PQQ I0PhWxP/fXKLSoAJwXc7LdiCmbVB8/LMK8F+Upsl4Z+T6sXJbEx+pi1nhTRd1gVRcbBlh5HyLlP pjQM= X-Google-Smtp-Source: AGHT+IGVm7TuAq5wE0URhZf/Gk0d3450CeJ1X6mYKdm7baNYb5y2WMl0TtM3HI0qFq1wWtkoaB3Gug== X-Received: by 2002:a17:906:f6c5:b0:a59:cc74:c28f with SMTP id a640c23a62f3a-a59fb9b88camr87180766b.52.1715146739545; Tue, 07 May 2024 22:38:59 -0700 (PDT) Received: from antares.fritz.box (62-178-148-172.cable.dynamic.surfer.at. [62.178.148.172]) by smtp.gmail.com with ESMTPSA id h12-20020a170906718c00b00a59a6026ee1sm5249930ejk.14.2024.05.07.22.38.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 May 2024 22:38:58 -0700 (PDT) From: =?utf-8?q?Christoph_M=C3=BCllner?= To: gcc-patches@gcc.gnu.org, Kito Cheng , Jim Wilson , Palmer Dabbelt , Andrew Waterman , Philipp Tomsich , Jeff Law , Vineet Gupta Cc: =?utf-8?q?Christoph_M=C3=BCllner?= Subject: [PATCH 1/3] expr: Export clear_by_pieces() Date: Wed, 8 May 2024 07:38:53 +0200 Message-ID: <20240508053855.1244942-2-christoph.muellner@vrull.eu> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240508053855.1244942-1-christoph.muellner@vrull.eu> References: <20240508053855.1244942-1-christoph.muellner@vrull.eu> MIME-Version: 1.0 X-Spam-Status: No, score=-12.7 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_MANYTO, 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.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org Make clear_by_pieces() available to other parts of the compiler, similar to store_by_pieces(). gcc/ChangeLog: * expr.cc (clear_by_pieces): Remove static from clear_by_pieces. * expr.h (clear_by_pieces): Add prototype for clear_by_pieces. Signed-off-by: Christoph Müllner --- gcc/expr.cc | 6 +----- gcc/expr.h | 5 +++++ 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/gcc/expr.cc b/gcc/expr.cc index d4414e242cb..eaf86d3d842 100644 --- a/gcc/expr.cc +++ b/gcc/expr.cc @@ -85,7 +85,6 @@ static void emit_block_move_via_sized_loop (rtx, rtx, rtx, unsigned, unsigned); static void emit_block_move_via_oriented_loop (rtx, rtx, rtx, unsigned, unsigned); static rtx emit_block_cmp_via_loop (rtx, rtx, rtx, tree, rtx, bool, unsigned, unsigned); -static void clear_by_pieces (rtx, unsigned HOST_WIDE_INT, unsigned int); static rtx_insn *compress_float_constant (rtx, rtx); static rtx get_subtarget (rtx); static rtx store_field (rtx, poly_int64, poly_int64, poly_uint64, poly_uint64, @@ -1832,10 +1831,7 @@ store_by_pieces (rtx to, unsigned HOST_WIDE_INT len, return to; } -/* Generate several move instructions to clear LEN bytes of block TO. (A MEM - rtx with BLKmode). ALIGN is maximum alignment we can assume. */ - -static void +void clear_by_pieces (rtx to, unsigned HOST_WIDE_INT len, unsigned int align) { if (len == 0) diff --git a/gcc/expr.h b/gcc/expr.h index 64956f63029..75181584108 100644 --- a/gcc/expr.h +++ b/gcc/expr.h @@ -245,6 +245,11 @@ extern bool can_store_by_pieces (unsigned HOST_WIDE_INT, extern rtx store_by_pieces (rtx, unsigned HOST_WIDE_INT, by_pieces_constfn, void *, unsigned int, bool, memop_ret); +/* Generate several move instructions to clear LEN bytes of block TO. (A MEM + rtx with BLKmode). ALIGN is maximum alignment we can assume. */ + +extern void clear_by_pieces (rtx, unsigned HOST_WIDE_INT, unsigned int); + /* If can_store_by_pieces passes for worst-case values near MAX_LEN, call store_by_pieces within conditionals so as to handle variable LEN efficiently, storing VAL, if non-NULL_RTX, or valc instead. */