Anton Korobeynikov <anton at korobeynikov.info> writes:>> It doesn't look like TableGen supports Constraints beyond EARLY_CLOBBER >> and TIED_TO. We would need to add a constraint such as "$dst != $src1, >> $dst != $mask, $src1 != $mask" to the current patterns to enforce the >> rules.> You can emulate such constraints via early clobbing. Just mark dst as > early clobbing.Actually, I've always wondered what early clobbering is. Can you explain it? I don't think that it will work for the src1 != mask constraint, though, right?>> Is there another mechanism to suport a constraint like this or is >> hacking TableGen the best way to do it? If the latter, does anyone have >> a sense of how difficult this would be to implement?> It's not a tablegen problem, the regalloc part is the hardest.Sure, but we'll want to express the constraint in TableGen, I think. Any hints on a direction for regalloc? How are such constraints modeled in the current iteration of the register allocator? Thanks! -David
On Jan 23, 2013, at 2:38 PM, dag at cray.com wrote:> Anton Korobeynikov <anton at korobeynikov.info> writes: > >>> It doesn't look like TableGen supports Constraints beyond EARLY_CLOBBER >>> and TIED_TO. We would need to add a constraint such as "$dst != $src1, >>> $dst != $mask, $src1 != $mask" to the current patterns to enforce the >>> rules. > >> You can emulate such constraints via early clobbing. Just mark dst as >> early clobbing. > > Actually, I've always wondered what early clobbering is. Can you > explain it?It's an output operand that is written before all the input operands are read. The register allocator makes sure that early clobber outputs are never allocated the same register as any input operands. /jakob
Jakob Stoklund Olesen <stoklund at 2pi.dk> writes:>> Actually, I've always wondered what early clobbering is. Can you >> explain it? > > It's an output operand that is written before all the input operands > are read. > > The register allocator makes sure that early clobber outputs are never > allocated the same register as any input operands.Aha! Thanks very much for that explanation Jakob! -David