rs6000: Fix ICE on IEEE128 long double without vsx [PR114402]
commitc547e353597ac4e0af09c2faca8c5a16744dcea4
authorKewen Lin <linkw@linux.ibm.com>
Tue, 21 May 2024 02:01:06 +0000 (20 21:01 -0500)
committerKewen Lin <linkw@linux.ibm.com>
Tue, 21 May 2024 02:01:06 +0000 (20 21:01 -0500)
treee853749c30cfc0dce4bf4e05135c0fe78471054e
parentb666d86b41c85a1756bf43951661a03f670a6852
rs6000: Fix ICE on IEEE128 long double without vsx [PR114402]

As PR114402 shows, we supports IEEE128 format long double
even if there is no vsx support, but there is an ICE about
cbranch as the test case shows.  For now, we only supports
compare:CCFP pattern for IEEE128 fp if TARGET_FLOAT128_HW,
so in function rs6000_generate_compare we have a check with
!TARGET_FLOAT128_HW && FLOAT128_VECTOR_P (mode) to make
!TARGET_FLOAT128_HW IEEE128 fp handling go with libcall.
But unfortunately the IEEE128 without vsx support doesn't
meet FLOAT128_VECTOR_P (mode) so it goes further with an
unmatched compare:CCFP pattern which triggers ICE.

So this patch is to make rs6000_generate_compare consider
IEEE128 without vsx as well then it can end up with libcall.

PR target/114402

gcc/ChangeLog:

* config/rs6000/rs6000.cc (rs6000_generate_compare): Make IEEE128
handling without vsx go with libcall.

gcc/testsuite/ChangeLog:

* gcc.target/powerpc/pr114402.c: New test.
gcc/config/rs6000/rs6000.cc
gcc/testsuite/gcc.target/powerpc/pr114402.c [new file with mode: 0644]