Message ID | alpine.DEB.2.20.2311171722590.5892@tpp.orcam.me.uk |
---|---|
State | Unresolved |
Headers |
Return-Path: <gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9910:0:b0:403:3b70:6f57 with SMTP id i16csp1505425vqn; Sat, 18 Nov 2023 21:39:08 -0800 (PST) X-Google-Smtp-Source: AGHT+IG4FFkov59FJLEXSWdTuoGffxQOtxDbRzXhFXJIMlVvgmyPjqO8Lq8bVBEw8qP7/NZCPIWc X-Received: by 2002:a05:6214:413:b0:679:d38d:d762 with SMTP id z19-20020a056214041300b00679d38dd762mr1118153qvx.14.1700372348582; Sat, 18 Nov 2023 21:39:08 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1700372348; cv=pass; d=google.com; s=arc-20160816; b=UWpmPHb1ZrVlUFP188/17VUE+Cr86l3PbTJpNBlGFKMf7/QMsRG13JHKEvdan479MV IRQmEBH0IEfJhFY91dIixjme4gsE8zSNB8Eg5QdskNi1lKZX8BFn8OsGkzNm3XhzzLen 1FrX19IQrmLkajKMsDCP8dl9kErlhciTNXeSNLKqMBrtc2pwSGbKKEAoZWEzAScUjkQt MfYoVndwbq7N16Ch9y9U0hdGJPQHK5i0olRTWPAbBHuRjrxM7YoKBe9CFme+jftzNutp uHMz8iMs42SSYeHfnS1wvug+AnE4PjN4GxsSIXuLff4qoATqSZdLhMYhoMqeYjJirdWa QdnQ== 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:mime-version:user-agent :references:message-id:in-reply-to:subject:cc:to:from:date :dkim-signature:arc-filter:dmarc-filter:delivered-to; bh=OjDw29N1YKlZMJdL+NWZL9X57R3rSi4gVEy63bC0+c8=; fh=dp1z4I3tVhinwswv7IAFxpunWK+Ws/fGQfmox9vHv3I=; b=LwAr6rmXrhmNsK1NnLg3zUAVmYiChxFemsCx7SJK3fv2FR1FKUEYxCMDbL8k5jOCRx g/zIJMgx2JjfkKRGSHaTbgWu+zjvc3DpLmoe7PP007UBILKvchqdcMq5E7j0ZFI9Sjv/ Aetp3znp9rM91tgLgW0p9uNBqJeztgQR97jDapijyTKPEXknfbjJVaxkBya1FPsents8 zphdtC/WJvzBT2Of/YerIRBCfwccdiKmGKnkZzU7cRB/utw1h/74mmEqRncvGfZ9m3C7 HKyOycO5TWRi65UAAxJWW8rEgzG9rpMI+p7UQjC75WapHkjEFrUegLFQP6mKEbE/QrY8 fGyQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@embecosm.com header.s=google header.b=ANxgyvas; 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 u2-20020a0ced22000000b00671366dbfc2si4850002qvq.328.2023.11.18.21.39.08 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 18 Nov 2023 21:39:08 -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; dkim=pass header.i=@embecosm.com header.s=google header.b=ANxgyvas; 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 7E7373860C0B for <ouuuleilei@gmail.com>; Sun, 19 Nov 2023 05:39:04 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-ed1-x52c.google.com (mail-ed1-x52c.google.com [IPv6:2a00:1450:4864:20::52c]) by sourceware.org (Postfix) with ESMTPS id A165938582AC for <gcc-patches@gcc.gnu.org>; Sun, 19 Nov 2023 05:38:07 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org A165938582AC Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=embecosm.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=embecosm.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org A165938582AC Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2a00:1450:4864:20::52c ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1700372289; cv=none; b=xdF3wPkPG8KSaz2HNTJBAqg3ox4MTh6EwdQinyb1zuK62ThL4SQAb0Qiuh/NCyOsz/09l6jcPDkK7uU4saPdgjLMUfcixpHjCZitu9nMUMUQ+dopSI4Z1ZO9/ASOjJqjRz9KCXZ/B8+muaY1wUjo7e0I1HPZCGOkeFzP0+D+MPQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1700372289; c=relaxed/simple; bh=pap/JLlPdF61gIyjxpSjU8My27R0lHVfrFOfYEdHskU=; h=DKIM-Signature:Date:From:To:Subject:Message-ID:MIME-Version; b=HR+6L/ECk9sLCkdlsTK01wLFUBcsuOD6gvxfNLInEchyniNZ+yL+uucwUyemV0GS02hI5d/uQ1o5c0RZbeUWK70CcVuBLN9N8BTsCJF+83sKbbbmYn27L7oFBFiJI33wTT9ep/Afyfq+eqbupE6VEB6yjKRcKbwOuI7J5W/DyWA= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-ed1-x52c.google.com with SMTP id 4fb4d7f45d1cf-53e04b17132so4709446a12.0 for <gcc-patches@gcc.gnu.org>; Sat, 18 Nov 2023 21:38:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=embecosm.com; s=google; t=1700372286; x=1700977086; darn=gcc.gnu.org; h=mime-version:user-agent:references:message-id:in-reply-to:subject :cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=OjDw29N1YKlZMJdL+NWZL9X57R3rSi4gVEy63bC0+c8=; b=ANxgyvaswjn7WqCKJDGLXhb5Zz9YgqEc+PgZ8cXH+Vq5Z3gtJf0vgp0vPnfjlWQAQd G3O9VKWEm+o014VmMWccaypVpWlrPFTuimvXjx4iSIqTl7HKi9C3F/Y5fZcqs7IBH761 qp6dHNmMGDamzlX8TXBAvxy6i1csYMHq08HzL4ZvcpX11NpEh+S4DHgT1aqh8Z5e0Du6 muktym4i8OjrZwcyW/X3XUG8bRZzNx8llchj4aahrVplPALSBGO7cGfAWYoUXBYV/FpG 9S3SWkStN5aRG2DXt6VIvwi7zRFZn2Q0SdjH6umxkNU2aeeXk1UrkJ07IOiXttmEPQzN tSAQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700372286; x=1700977086; h=mime-version:user-agent:references:message-id:in-reply-to:subject :cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=OjDw29N1YKlZMJdL+NWZL9X57R3rSi4gVEy63bC0+c8=; b=ItV1F+ar80Y/tTkotBxBmpTcOFgr0yKx3GBnglfA0Wei6BCrDt3YIT+sZiJonbaOgk yaMkH6+a7TxCn7bfIjy1siMzl3iCBkx0Aj2MLATTNezcfUDUyzF8xRdfGn4qlWeg4Vvh ths/bkasIMGaW+zYuA5ROhqZT/Ptv3kHXSM/s9ncVSM7PQyQti4DaItV4kgqtlccbi/T S67DVutu4jzsbb6RBGm2f+6pGmlvAdxqg47J4g98/HZNN81m69WY44rTBhtp+GeHEJ1M /S6FUA+hFD32f6C5BHfEpDwB+PSNb2NU06X6FeQsXdnTTkvA2GSVYxaoiKlJWfPw5qw7 e9Gw== X-Gm-Message-State: AOJu0Ywmpwt7MchRLXNkpp9k7Cs/b7YBjHXs9mw7DOsZwlaGH0VayzlL e1ere9UDn3B7+xl2EcTORoZISzngOvm1Zr59PuoGvg== X-Received: by 2002:a17:907:1c23:b0:9e5:2b1f:13f4 with SMTP id nc35-20020a1709071c2300b009e52b1f13f4mr3585777ejc.42.1700372286359; Sat, 18 Nov 2023 21:38:06 -0800 (PST) Received: from [192.168.219.3] ([78.8.192.131]) by smtp.gmail.com with ESMTPSA id l21-20020a1709061c5500b009fda665860csm49874ejg.22.2023.11.18.21.38.05 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sat, 18 Nov 2023 21:38:06 -0800 (PST) Date: Sun, 19 Nov 2023 05:38:04 +0000 (GMT) From: "Maciej W. Rozycki" <macro@embecosm.com> To: gcc-patches@gcc.gnu.org cc: Andrew Waterman <andrew@sifive.com>, Jim Wilson <jim.wilson.gcc@gmail.com>, Kito Cheng <kito.cheng@gmail.com>, Palmer Dabbelt <palmer@dabbelt.com> Subject: [PATCH 14/44] RISC-V: Also invert the cond-move condition for GEU and LEU In-Reply-To: <alpine.DEB.2.20.2311171315580.5892@tpp.orcam.me.uk> Message-ID: <alpine.DEB.2.20.2311171722590.5892@tpp.orcam.me.uk> References: <alpine.DEB.2.20.2311171315580.5892@tpp.orcam.me.uk> User-Agent: Alpine 2.20 (DEB 67 2015-01-07) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-Spam-Status: No, score=-1.7 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE, URIBL_BLACK 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 <gcc-patches.gcc.gnu.org> List-Unsubscribe: <https://gcc.gnu.org/mailman/options/gcc-patches>, <mailto:gcc-patches-request@gcc.gnu.org?subject=unsubscribe> List-Archive: <https://gcc.gnu.org/pipermail/gcc-patches/> List-Post: <mailto:gcc-patches@gcc.gnu.org> List-Help: <mailto:gcc-patches-request@gcc.gnu.org?subject=help> List-Subscribe: <https://gcc.gnu.org/mailman/listinfo/gcc-patches>, <mailto:gcc-patches-request@gcc.gnu.org?subject=subscribe> Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1782969635787963402 X-GMAIL-MSGID: 1782969635787963402 |
Series |
RISC-V: Various if-conversion fixes and improvements
|
|
Checks
Context | Check | Description |
---|---|---|
snail/gcc-patch-check | warning | Git am fail log |
Commit Message
Maciej W. Rozycki
Nov. 19, 2023, 5:38 a.m. UTC
Update `riscv_expand_conditional_move' and handle the missing GEU and LEU operators there, avoiding an extraneous conditional set operation, such as with this output: sgtu a0,a0,a1 seqz a1,a0 czero.eqz a3,a3,a1 czero.nez a1,a2,a1 or a0,a1,a3 produced when optimizing for Zicond targets from: int movsigtu (int w, int x, int y, int z) { return w > x ? y : z; } These operators can be inverted producing optimal code such as this: sgtu a1,a0,a1 czero.nez a3,a3,a1 czero.eqz a1,a2,a1 or a0,a1,a3 which this change causes to happen. gcc/ * config/riscv/riscv.cc (riscv_expand_conditional_move): Also invert the condition for GEU and LEU. --- gcc/config/riscv/riscv.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) gcc-riscv-expand-conditional-move-geu-leu.diff
Index: gcc/gcc/config/riscv/riscv.cc =================================================================== --- gcc.orig/gcc/config/riscv/riscv.cc +++ gcc/gcc/config/riscv/riscv.cc @@ -4142,7 +4142,7 @@ riscv_expand_conditional_move (rtx dest, /* If riscv_expand_int_scc inverts the condition, then it will flip the value of INVERT. We need to know where so that we can adjust it for our needs. */ - if (code == LE || code == GE) + if (code == LE || code == LEU || code == GE || code == GEU) invert_ptr = &invert; /* Emit an scc like instruction into a temporary