S/390: memset: Avoid overlapping MVC operands between iterations.
A memset with a value != 0 is currently implemented using the mvc
instruction propagating the first byte through 256 byte blocks. While
for the first mvc the byte is written with a separate instruction
subsequent MVCs used the last byte of the previous 256 byte block.
Starting with z13 this causes a major performance degradation. With
this patch we always set the first byte with an mvi or stc in order to
avoid the overlapping of the MVC operands between loop iterations.
On older machines this basically makes no measurable difference so the
patch enables the new behavior for all machine levels in order to make
sure that code built for older machine levels runs well when moved to
a z13.
Bootstrapped and regression tested on s390 and s390x using z900 and z13
as default -march level. No regressions.
gcc/ChangeLog:
2017-01-05 Andreas Krebbel <krebbel@linux.vnet.ibm.com>
* config/s390/s390.c (s390_expand_setmem): Avoid overlapping bytes
between loop iterations.
From-SVN: r244096