Message ID | alpine.DEB.2.20.2311182127160.5892@tpp.orcam.me.uk |
---|---|
State | New |
Headers | show
Return-Path: <gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org> 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=embecosm.com header.i=@embecosm.com header.a=rsa-sha256 header.s=google header.b=cI15e8ow; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=8.43.85.97; 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 [8.43.85.97]) (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 4SY01300Lyz1yRg for <incoming@patchwork.ozlabs.org>; Sun, 19 Nov 2023 16:43:18 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 845403858009 for <incoming@patchwork.ozlabs.org>; Sun, 19 Nov 2023 05:43:14 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-ed1-x533.google.com (mail-ed1-x533.google.com [IPv6:2a00:1450:4864:20::533]) by sourceware.org (Postfix) with ESMTPS id 0298F3858D37 for <gcc-patches@gcc.gnu.org>; Sun, 19 Nov 2023 05:42:05 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 0298F3858D37 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 0298F3858D37 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2a00:1450:4864:20::533 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1700372527; cv=none; b=DogebzXnXS3b/CzbVBkzfRa6RDp67djeYZIffNW4kmq1QSjGG8amQWZIE5AE3oy/fNGEeomSpMM18D64y+n+GbGOYykGC2Vv3Ms3B35eRkv7faoqVjAMks27uq/RSTmr277T3LJwSYNt5uPsaHG+YPnNn3JSG7scg/vgzY+L1AM= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1700372527; c=relaxed/simple; bh=TVcG3RrVfixIqzsRW/TQoCyzXOC4oT5U7gRnW4leEZo=; h=DKIM-Signature:Date:From:To:Subject:Message-ID:MIME-Version; b=Qhiz8rOa+mBmGvBqzOZJLOeb6jJ926EDKTu7AiyGiwCsJu1VGnfwb7TQE1/iPX0GVW19H0Tkmys4pgoKAy/FSeMIHd8XnwYY1GRPmCxYYhxBsJeHMc/R9IZozmUFdkeqpjpuCN8sriHvNrplMoQHS36UuP3U4OR3ewcHM8ffwfY= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-ed1-x533.google.com with SMTP id 4fb4d7f45d1cf-5437d60fb7aso4828351a12.3 for <gcc-patches@gcc.gnu.org>; Sat, 18 Nov 2023 21:42:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=embecosm.com; s=google; t=1700372524; x=1700977324; 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=IHiDSe6k13+UCxLMdZ2AUiFd5tNFwlo8zmS6YX7mjFg=; b=cI15e8owzuXPsq0c9pddEGe0+vKqkz8MTi+UECJZBqMYG2FuTgNifMDSX63/uDaNii BCGzzmfKYZMtI1J2e17b3jBanL0mgdxGLNsxo6jTtmXueaGyv8JP46ntXWKievT5FddC sAjVs1FUXhc+x9EdeDu/1HlJul0kJscyYn0FomtQ5TgGQJXV16V8CjgzUOiinYtnO8UA QJx6Mvx0B2v3XA3xOC00+03amoCHjPAxsEoEYbhO71NXcYQntL851COVaQG1dnM+C5wt XGczsaEFgJ3rhiCylbhHlVOFN58L/nuEY2k5GQVwSMvUxwxCdktgW4mbD78r8/yMtd1K iCnw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700372524; x=1700977324; 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=IHiDSe6k13+UCxLMdZ2AUiFd5tNFwlo8zmS6YX7mjFg=; b=Cx33Z98XB9SOsOaM2g49uFouXTeN48Tigtyw6GUJ9pT3EwvfCp5UObGOy64OFWsen+ 3yiQ3xAAlPc/B/S2WzwUPHKP28iXiePXqW8wvv+uSZ+2q8fkXw2FnHEvYki4IeL/PC5v w5wsP9g7twr97SnsbKLgn6ZB+T6PH3kbO20vCcQEs1OFlyN5gOf46Uxyih2cPJsjvNXr McMHJNkPS5nppt8xanADcrHjZ9dyB9/UrF+hXTr5AA8CB4urzaZV7U99oj8UCREBUtHL 1tYjAfaLJa2pZ/IPRWIBtjPlYVrFO6bL6jGdfuilDKBUrzpVuZhLHDhCM4KQRNgjQ1/o ANrQ== X-Gm-Message-State: AOJu0YxyC5sssAwiKlmP/cPmy3fFM9CwlscDlTfXZf8jh55XunEh7rKG 05A0zFxTSszzHsz4guHGLhnBX7xnAhpoYaPZ5EAFhQ== X-Google-Smtp-Source: AGHT+IHTgfGlCR8MFk60cRq2R2HJGF3PTNlZHZecwypDFHxbRA7CtOQOiqs7XdCj28JkHp5HlNqCYw== X-Received: by 2002:a17:906:738d:b0:9c7:5186:de1a with SMTP id f13-20020a170906738d00b009c75186de1amr3163869ejl.8.1700372523871; Sat, 18 Nov 2023 21:42:03 -0800 (PST) Received: from [192.168.219.3] ([78.8.192.131]) by smtp.gmail.com with ESMTPSA id c5-20020a170906694500b009e6624afecbsm2545629ejs.63.2023.11.18.21.42.02 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sat, 18 Nov 2023 21:42:03 -0800 (PST) Date: Sun, 19 Nov 2023 05:42:01 +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 32/44] RISC-V: Only use SUBREG if applicable in `riscv_expand_float_scc' In-Reply-To: <alpine.DEB.2.20.2311171315580.5892@tpp.orcam.me.uk> Message-ID: <alpine.DEB.2.20.2311182127160.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+incoming=patchwork.ozlabs.org@gcc.gnu.org |
Series |
RISC-V: Various if-conversion fixes and improvements
|
expand
|
On 11/18/23 22:42, Maciej W. Rozycki wrote: > A subsequent change to enable the processing of conditional moves on a > floating-point condition by `riscv_expand_conditional_move' will cause > `riscv_expand_float_scc' to be called for word-mode target RTX with RV64 > targets. In that case an invalid insn such as: > > (insn 25 24 0 (set (reg:DI 141) > (subreg:SI (reg:DI 143) 0)) -1 > (nil)) > > would be produced, which would crash the compiler later on. Since the > output operand of the SET operation to be produced already has the same > mode as the input operand does, just omit the use of SUBREG and assign > directly. > > gcc/ > * config/riscv/riscv.cc (riscv_expand_float_scc): Suppress the > use of SUBREG if the conditional-set target is word-mode. OK jeff
Index: gcc/gcc/config/riscv/riscv.cc =================================================================== --- gcc.orig/gcc/config/riscv/riscv.cc +++ gcc/gcc/config/riscv/riscv.cc @@ -4071,7 +4071,9 @@ riscv_expand_float_scc (rtx target, enum riscv_emit_float_compare (&code, &op0, &op1); rtx cmp = riscv_force_binary (word_mode, code, op0, op1); - riscv_emit_set (target, lowpart_subreg (SImode, cmp, word_mode)); + if (GET_MODE (target) != word_mode) + cmp = lowpart_subreg (GET_MODE (target), cmp, word_mode); + riscv_emit_set (target, cmp); } /* Jump to LABEL if (CODE OP0 OP1) holds. */