diff options
author | Roger Sayle <roger@nextmovesoftware.com> | 2024-06-20 16:30:15 +0100 |
---|---|---|
committer | Roger Sayle <roger@nextmovesoftware.com> | 2024-06-20 16:30:15 +0100 |
commit | 9a76db24e044c8058497051a652cca4228cbc8e9 (patch) | |
tree | f202e216b630d1506389e4bf59309f9b4961d724 /gcc/rtl-tests.cc | |
parent | f739ad5e35b0a60dec65bb12f8d07aadd0c98196 (diff) | |
download | gcc-9a76db24e044c8058497051a652cca4228cbc8e9.zip gcc-9a76db24e044c8058497051a652cca4228cbc8e9.tar.gz gcc-9a76db24e044c8058497051a652cca4228cbc8e9.tar.bz2 |
i386: Allow all register_operand SUBREGs in x86_ternlog_idx.
This patch tweaks ix86_ternlog_idx to allow any SUBREG that matches
the register_operand predicate, and is split out as an independent
piece of a patch that I have to clean-up redundant ternlog patterns
in sse.md. It turns out that some of these patterns aren't (yet)
sufficiently redundant to be obsolete. The problem is that the
"new" ternlog pattern has the restriction that it allows SUBREGs,
but only those where the inner and outer modes are the same size,
where regular patterns use "register_operand" which allows arbitrary
including paradoxical SUBREGs.
A motivating example is f2 in gcc.target/i386/avx512dq-abs-copysign-1.c
void f2 (float x, float y)
{
register float a __asm ("xmm16"), b __asm ("xmm17");
a = x;
b = y;
asm volatile ("" : "+v" (a), "+v" (b));
a = __builtin_copysignf (a, b);
asm volatile ("" : "+v" (a));
}
for which combine tries:
(set (subreg:V4SF (reg:SF 100 [ _3 ]) 0)
(ior:V4SF (and:V4SF (not:V4SF (reg:V4SF 104))
(subreg:V4SF (reg:SF 110) 0))
(reg:V4SF 106)))
where the SUBREG is paradoxical, with inner mode SF and outer mode V4SF.
This patch allows the recently added ternlog_operand to accept this case.
2024-06-20 Roger Sayle <roger@nextmovesoftware.com>
gcc/ChangeLog
* config/i386/i386-expand.cc (ix86_ternlog_idx): Allow any SUBREG
that matches register_operand. Use rtx_equal_p to compare REG
or SUBREG "leaf" operands.
Diffstat (limited to 'gcc/rtl-tests.cc')
0 files changed, 0 insertions, 0 deletions