On Tue, 2023-12-12 at 19:08 +0800, Jiahao Xu wrote: > This test also needs to add the compilation option -ffast-math. I missed > it. Thanks for the reminder.
In r14-15 we removed LOGICAL_OP_NON_SHORT_CIRCUIT definition because the default value (1 for all current LoongArch CPUs with branch_cost = 6) may reduce the number of conditional branch instructions. I guess here the problem is floating-point compare instruction is much more costly than other instructions but the fact is not correctly modeled yet. Could you try https://gcc.gnu.org/pipermail/gcc-patches/2023-December/640012.html where I've raised fp_add cost (which is used for estimating floating- point compare cost) to 5 instructions and see if it solves your problem without LOGICAL_OP_NON_SHORT_CIRCUIT? -- Xi Ruoyao <xry...@xry111.site> School of Aerospace Science and Technology, Xidian University