public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc(refs/vendors/riscv/heads/gcc-13-with-riscv-opts)] RISC-V: Also allow FP conditions in `riscv_expand_conditional_move'
@ 2023-11-22  5:11 Jeff Law
  0 siblings, 0 replies; only message in thread
From: Jeff Law @ 2023-11-22  5:11 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:056096987325f08eca0b79d015a82534d8b763e2

commit 056096987325f08eca0b79d015a82534d8b763e2
Author: Maciej W. Rozycki <macro@embecosm.com>
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.
    
    (cherry picked from commit 37ff43c27344784caed28778fb847244a49644bd)

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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2023-11-22  5:11 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-11-22  5:11 [gcc(refs/vendors/riscv/heads/gcc-13-with-riscv-opts)] RISC-V: Also allow FP conditions in `riscv_expand_conditional_move' Jeff Law

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).