This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: WORD_REGISTER_OPERATIONS/LOAD_EXTEND_OP
- To: <Richard dot Earnshaw at arm dot com>
- Subject: Re: WORD_REGISTER_OPERATIONS/LOAD_EXTEND_OP
- From: Bernd Schmidt <bernds at redhat dot com>
- Date: Wed, 11 Apr 2001 14:25:55 +0100 (BST)
- Cc: <gcc at gcc dot gnu dot org>
On Sat, 7 Apr 2001, Richard Earnshaw wrote:
> > Can someone tell me what assumptions are made by this piece of code in
> > combine.c (nonzero_bits):
>
> IIRC they are:
>
> (REG:mode1 x) has just been loaded from memory.
>
> mode1 < word size (mode2)
>
> loads of size mode1 zero- or sign-extend automatically to mode2. That is,
> in effect
>
> (set (reg:mode1 x) (mem:mode1 ...))
>
> is equivalent to
>
> (set (reg:mode1 x) (subreg:mode1 (..._extend:mode2 (mem:mode1 ...)) 0))
>
> for this machine.
That's essentially what LOAD_EXTEND_OP means. The question is, what exactly
does WORD_REGISTER_OPERATIONS mean? Apparently, the code assumes that a
(subreg:mode2 (reg:mode1)) always has the upper half properly extended.
That's not the case, however: consider left shifts and (unsigned) additions
and subtractions. To me it seems like the entire concept behind
WORD_REGISTER_OPERATIONS is flawed.
If no one objects, I will rip out this macro some time next week.
Bernd