On Oct 21, 2010, at 8:15 PM, Ian Lance Taylor wrote: > Frederic Riss <frederic.r...@gmail.com> writes: > >> Is it possible to describe multi-register values in RTL when the >> subparts of the value aren't stored in consecutive registers? For >> example having a DI value constructed from 2 unrelated SI registers >> (without losing the semantic of the original DI value) ? > > Not really. I suppose you could use CONCAT, but you would lose > optimizations. > > I don't know what you are doing but I'll note that the lower-subreg pass > can be used to split a DImode value into 2 SImode values after the fact > that the value is DImode is no longer relevant.
Can "expand" do this? I've wondered about this in the past. It comes up in machines where register pairs are used as a software convention, like MIPS in 32 bit mode. Or on the PDP-11, where a few instructions require odd/even adjacent registers but a lot of wide mode sequences simply require two smaller mode values, that don't even need to be in the same sort of container. To take that example, on the pdp11 an SImode is two HImodes. Could the RTL template in the MD file for, say, addsi3 split that into two or three insns that operate on HImode values and describe the actual instructions? In this case: add high parts, then add low parts and propagate carry into high. Split that way it would seem you would not be constrained to adjacent registers, or for that matter to both being registers at all. paul