From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1256) id 613EE3858C36; Wed, 22 Nov 2023 01:23:50 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 613EE3858C36 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1700616230; bh=0+tlSUI5ukK4QJqJJ8qeXQ1UOgYT68z+7EyZEPQ+wHE=; h=From:To:Subject:Date:From; b=KdbbrcBPbOLMUBD9+OTFKVDh3Y8by6k85iT1S6gkHLZ+UvLhhNoI3oQeIovXD1rTW 0WWGqnyj/F5q2JLeGJDEj9/HCfPNJ02tLN6ulywKUfkS/Pnvfgcs2Du11bbIJmykOd vc9Oi3lABJL/xDYW13b1wDCH9IVwSSKejyid0h6I= MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" From: Maciej W. Rozycki To: gcc-cvs@gcc.gnu.org Subject: [gcc r14-5732] RISC-V: Also allow FP conditions in `riscv_expand_conditional_move' X-Act-Checkin: gcc X-Git-Author: Maciej W. Rozycki X-Git-Refname: refs/heads/master X-Git-Oldrev: 7e126d8d0fbe5677070f02c32a1425849ce36298 X-Git-Newrev: 37ff43c27344784caed28778fb847244a49644bd Message-Id: <20231122012350.613EE3858C36@sourceware.org> Date: Wed, 22 Nov 2023 01:23:50 +0000 (GMT) List-Id: https://gcc.gnu.org/g:37ff43c27344784caed28778fb847244a49644bd commit r14-5732-g37ff43c27344784caed28778fb847244a49644bd Author: Maciej W. Rozycki Date: Wed Nov 22 01:18:29 2023 +0000 RISC-V: Also allow FP conditions in `riscv_expand_conditional_move' In `riscv_expand_conditional_move' we only let integer conditions through at the moment, even though code has already been prepared to handle floating-point conditions as well. Lift this restriction and only bail out if a non-word-mode integer condition has been requested, as we cannot handle this specific case owing to machine instruction set restriction. We already take care of the non-integer, non-floating-point case later on. gcc/ * config/riscv/riscv.cc (riscv_expand_conditional_move): Don't bail out in floating-point conditions. Diff: --- gcc/config/riscv/riscv.cc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/gcc/config/riscv/riscv.cc b/gcc/config/riscv/riscv.cc index 14e54939291..ef6569ed15f 100644 --- a/gcc/config/riscv/riscv.cc +++ b/gcc/config/riscv/riscv.cc @@ -4138,12 +4138,12 @@ riscv_expand_conditional_move (rtx dest, rtx op, rtx cons, rtx alt) machine_mode mode0 = GET_MODE (op0); machine_mode mode1 = GET_MODE (op1); - /* The comparison must be comparing WORD_MODE objects. We must - enforce that so that we don't strip away a sign_extension + /* An integer comparison must be comparing WORD_MODE objects. We + must enforce that so that we don't strip away a sign_extension thinking it is unnecessary. We might consider using riscv_extend_operands if they are not already properly extended. */ - if ((mode0 != word_mode && mode0 != VOIDmode) - || (mode1 != word_mode && mode1 != VOIDmode)) + if ((INTEGRAL_MODE_P (mode0) && mode0 != word_mode) + || (INTEGRAL_MODE_P (mode1) && mode1 != word_mode)) return false; /* In the fallback generic case use MODE rather than WORD_MODE for