[PATCH v1 1/1] arm: avoid unmatched insn in movhfcc [PR118460]

Richard Earnshaw via Sourceware Forge forge-bot@forge-test.rdfm.org
Tue Oct 14 12:53:05 GMT 2025


From: Richard Earnshaw <rearnsha@arm.com>

When compiling for m-profile with the floating-point extension we have
a vsel instruction that takes a limited set of comparisons.  In most
cases we can use this with careful selection of the operand order, but
we need to expand things in the right way.  This patch is in two parts:

1) We validate that the expansion will produce correct RTL;
2) We canonicalize the comparison to increase the chances that the
above check will pass.

gcc:

	PR target/118460
	* config/arm/arm.cc (arm_canonicalize_comparison): For floating-
	point comparisons, swap the operand order if that will be more
	likely to produce a comparison that can be used with VSEL.
	(arm_validize_comparison): Make sure that HFmode comparisons
	are compatible with VSEL.

gcc/testsuite:

	PR target/118460
	* gcc.target/arm/armv8_2-fp16-move-1.c: Adjust expected output.
	* gcc.target/arm/armv8_2-fp16-move-2.c: Likewise.
---
 gcc/config/arm/arm.cc                         | 19 +++++++++++++++++++
 .../gcc.target/arm/armv8_2-fp16-move-1.c      |  4 ++--
 .../gcc.target/arm/armv8_2-fp16-move-2.c      |  2 +-
 3 files changed, 22 insertions(+), 3 deletions(-)

-------------- next part --------------
A non-text attachment was scrubbed...
Name: v1-0001-arm-avoid-unmatched-insn-in-movhfcc-PR118460.patch
Type: text/x-patch
Size: 2693 bytes
Desc: not available
URL: <https://sourceware.org/pipermail/test-list/attachments/20251014/d7389e6c/attachment.bin>


More information about the Test-list mailing list