On 4/22/23 10:38, Roger Sayle wrote:

This patch provides an improved rtx_costs target hook on xstormy16.
The current implementation has the unfortunate property that it claims
that zero_extendhisi2 is very cheap, even though the machine description
doesn't provide that instruction/pattern.  Doh!  Rewriting the
xstormy16_rtx_costs function has additional benefits, including
making more use of the (short) "mul" instruction when optimizing
for size with -Os.

This patch has been tested by building a cross-compiler to xstormy-elf
on x86_64-pc-linux-gnu, and confirming that the new test case passes
with "make -k check-gcc".  Many thanks to Jeff Law for additional
testing.  Ok for mainline?


2023-04-22  Roger Sayle  <ro...@nextmovesoftware.com>

gcc/ChangeLog
         * config/stormy16/stormy16.cc (xstormy16_rtx_costs): Rewrite to
         provide reasonable values for common arithmetic operations and
         immediate operands (in several machine modes).

gcc/testsuite/ChangeLog
         * gcc.target/xstormy16/mulhi.c: New test case.
GIven this only affects costing and we don't have a lot of activity/use of the xstormy16 port, no objections go ahead and commit. If there is fallout from the 3 patches we'll see it ~24hrs after you commit the changes.

Thanks,
jeff

Reply via email to