This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

VAX backend status


Over the past several weeks, I've revamped the VAX backend:

- fixed various bugs
- improved 64bit move, add, subtract code.
- added patterns for ffs, bswap16, bswap32, sync_lock_test_and_set, and
sync_lock_release
- modified it to generate PIC code.
- fixed the dwarf2 output so it is readonly in shared libraries.
- moved the constraints from vax.h to constraints.md
- moved predicates to predicates.md
- added several peephole and peephole2 patterns


So the last major change to make the VAX backend completely modern is to
remove the need for "HAVE_cc0".  However, even instructions that modify
the CC don't always changes all the CC bits; some instructions preserve
certain bits.  I'd like to do this but currently it's above my level of
gcc expertise.

Should the above be submitted as one megapatch?  Or as a dozen or two
smaller patches?

And finally a few musings ...

I've noticed a few things in doing the above.  GCC 4.x doesn't seems to
do CSE on addresses.  Because the VAX binutils doesn't support non-local
symbols with a non-zero addend in the GOT, PIC will do a define_expand
so that (const (plus (symbol_ref) (const_int))) will be split into
separate instructions.  However, gcc doesn't seem to be able to take
advantage of that.  For instance, gcc emits:

        movab rpb,%r0
        movab 100(%r0),%r1
        cvtwl (%r1),%r0

but the movab 100(%r0),%r1 is completely unneeded, this should have
been emitted as:

        movab rpb,%r0
        cvtwl 100(%r0),%r0

I could add peepholes to find these and fix them but it would be nice
if the optimizer could do that for me.

Another issue is that gcc has become "stupider" when it comes using
indexed addressing.  For example:

static struct { void (*func)(void *); void *arg; int inuse; } keys[64];

int nextkey;

int
setkey(void (*func)(void *), void *arg)
{
        int i;
        for (i = nextkey; i < 64; i++) {
                if (!keys[i].inuse)
                        goto out;
        }

emits:

        movl nextkey,%r3
        cmpl %r3,$63
        jgtr .L38
        mull3 %r3,$12,%r0
        movab keys+8[%r0],%r0
        tstl (%r0)

The last 3 instructions should have been:

	mull3 %r3,$3,%r0
	tstl keys+8[%r0]



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]