SHIFT_COUNT_TRUNCATED
Jan Hubicka
hubicka@atrey.karlin.mff.cuni.cz
Thu Oct 1 16:51:00 GMT 1998
Hi
I was fiddling a bit with instruction patterns for removing unnecesary
and at a<<(b&31) constructions at i386. Implementing this in machine
description (as suggested in info file) should require quite a lot
patterns (I have them all in md file). problem is that other common
case like a<<(32-b) should be simplified to a<<(-b), wich should not
be IMO handled nicely by md files and so on.
So I've been looking a bit at SHIFT_COUNT_TRUNCATED feature and I think
it should be extended to make macro that has two parameters (code and mode)
code should be ASHIFT etc amd mode shoud be DImode and so on.
It should return mask, that target use to truncate (since i386.md actually
truncates all modes by &31). It should be more generic and should match
more architectures. Also should add a way to describe, that DIshifts at
intel are masked by 31, not 63, so they needs to be expanded into shift/test/
shift_32 seqence, if some other architectures have similar weirdness.
There don't seems to be much use for SHIFT_COUNT_TRUNCATED in gcc, so it should
not be much work and I should do that, if it is good thing to do.
BTW whats are the limitation of combiner. Will pattern like:
(set reg0
(ior (ashift reg1 reg2)
(lshiftrt reg3 (neg reg2))))
ever match? (there is limitation to three instruction or so, if I remember
correctly)
It should be correct pattern for i386 shld instruction (64 bit shift trought two
operands, but store actually just first part).
If I extend it to match_operator for ior/plus and exchange lshiftrt/ashift,
it should match all natural cases to write such shift...
I will probably make this pattern in order to split DI mode shift pattern,
so why not to make it matching something :). I've actually made constant
parameter version of it and it seems to match about four times in gcc and kernel.
Is that worthwhile? :))
Honza
--
OK. Lets make a signature file.
+-------------------------------------------------------------------------+
| Jan Hubicka (Jan Hubi\v{c}ka in TeX) hubicka@freesoft.cz |
| Czech free software foundation: http://www.freesoft.cz |
|AA project - the new way for computer graphics - http://www.ta.jcu.cz/aa |
| homepage: http://www.paru.cas.cz/~hubicka/ , games koules, Xonix, fast |
| fractal zoomer XaoS, index of Czech GNU/Linux/UN*X documentation etc. |
+-------------------------------------------------------------------------+
More information about the Gcc
mailing list