https://gcc.gnu.org/g:8332ce8b0b30b03268570e42be65261676836385

commit r17-351-g8332ce8b0b30b03268570e42be65261676836385
Author: Lulu Cheng <[email protected]>
Date:   Tue Apr 14 17:10:45 2026 +0800

    LoongArch: Add rtx_cost support for ORDERED comparison.
    
    In commit 16-8400-g48c2ea1750efe4, VCOND_MASK is inverted
    (if that would be an improvement).  However, since the LoongArch
    backend does not define the rtx_cost for the ORDERED RTX, the
    calculated cost for UNORDERED becomes greater than that of ORDERED.
    This triggers an inversion from UNORDERED to ORDERED, leading to
    test failures in lasx-vcond-2.c and lsx-vcond-2.c.
    
    Since the assembly sequences generated for ORDERED and UNORDERED
    are identical on LoongArch, I have set the rtx_cost for ORDERED
    to match that of UNORDERED.  This ensures consistent cost
    evaluation and allows the related test cases to pass.
    
    gcc/ChangeLog:
    
            * config/loongarch/loongarch.cc (loongarch_rtx_costs): Add
            RTX cost handling for the ORDERED RTX code.

Diff:
---
 gcc/config/loongarch/loongarch.cc | 1 +
 1 file changed, 1 insertion(+)

diff --git a/gcc/config/loongarch/loongarch.cc 
b/gcc/config/loongarch/loongarch.cc
index 4a0a9bafa813..1ecf356ac6cb 100644
--- a/gcc/config/loongarch/loongarch.cc
+++ b/gcc/config/loongarch/loongarch.cc
@@ -4280,6 +4280,7 @@ loongarch_rtx_costs (rtx x, machine_mode mode, int 
outer_code,
     case EQ:
     case NE:
     case UNORDERED:
+    case ORDERED:
     case LTGT:
     case UNGE:
     case UNGT:

Reply via email to