From mboxrd@z Thu Jan 1 00:00:00 1970 From: Joern Rennecke To: Jan Hubicka Cc: Joern Rennecke , gcc@gcc.gnu.org Subject: Re: SUBREGs and modes Date: Wed, 02 Aug 2000 09:13:00 -0000 Message-id: <200008021613.RAA25138@phal.cygnus.co.uk> References: <20000802174932.A20604@atrey.karlin.mff.cuni.cz> X-SW-Source: 2000-08/msg00029.html > > > weird usage of SUBREGs. According to my uderstanding the docs, when > > > WORDNUM is nonzero, the innermode must be greater than word and > > > the outer mode must be word. > > > > Where does it say that the outer mode must be word? > The other use of @code{subreg} is to extract the individual registers of > a multi-register value. Machine modes such as @code{DImode} and > @code{TImode} can indicate values longer than a word, values which > usually require two or more consecutive registers. To access one of the > registers, use a @code{subreg} with mode @code{SImode} and a > @var{wordnum} that says which register. > > Actually speaks about SImode, but is interpreted in the code as > word. Well, this is not a definition, but (a part of) an enumeration of uses. A subreg can fulfill both uses at a time. Actually, the very next paragraph hints at that: Storing in a non-paradoxical @code{subreg} has undefined results for bits belonging to the same word as the @code{subreg}. This laxity makes it easier to generate efficient code for such instructions. To represent an instruction that preserves all the bits outside of those in This implies that there are cases where you have a subreg of a reg with multiple words, where not all bits of a word are stored to. Note that nested subregs are not allowed, so we really *have* to express the access of a single smaller-than-word part of a multi word register with a single SUBREG. Do you have a suggestion how to make the documentation more clear on that count?