This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: S/390: Fix string-opt-17.c testsuite failure
- From: "Ulrich Weigand" <Ulrich dot Weigand at de dot ibm dot com>
- To: Roger Sayle <roger at eyesopen dot com>
- Cc: <gcc-patches at gcc dot gnu dot org>
- Date: Wed, 11 Sep 2002 15:07:33 +0200
- Subject: Re: S/390: Fix string-opt-17.c testsuite failure
- Sensitivity:
Hi Roger,
>Its strange that the s390 backend would want to call __multi3.
>The multiplication is by a simple integer constant, and on most
>targets this should be turned into a sequence of shifts and adds.
>So GCC should generate a sequence of eight shift and add instructions
>to build the value to write in a TI mode register, and then a single
>store of that TI register to memory (which should be faster than 16
>consecutive bytes stores).
The problem here is that while we have TImode 'registers'
(actually pairs of DImode real registers), we do not support
any of the usual arithmetic operations on those. E.g. there
is no add, shift, or ior on TImode registers, so that sequence
could not be generated either.
We need TImode only in a few places for some special instructions
that operate on DImode register pairs (which we implement via a
TImode 'register').
>GCC only considers the TImode operations as the backend claims to
>support TImode reads and writes to and from memory. Most architectures
>allow at most SImode sequences, performing memset 4 bytes at a time.
Because we do make use of TImode sometimes, we need to have a
movti insn or else things will break occasionally. The movti
insn is reasonably efficient (reg->mem / mem->reg implemented
via load/store multiple instruction, mem->mem is implemented
by the same memory copy instruction as movstr). But this does
not mean we have efficient means to implement other operations
on TImode.
Mit freundlichen Gruessen / Best Regards
Ulrich Weigand
--
Dr. Ulrich Weigand
Linux for S/390 Design & Development
IBM Deutschland Entwicklung GmbH, Schoenaicher Str. 220, 71032 Boeblingen
Phone: +49-7031/16-3727 --- Email: Ulrich.Weigand@de.ibm.com