[En-Nut-Discussion] network throughput gain (nicrtl output)

Harald Kipp harald.kipp at egnite.de
Sun Nov 30 17:20:15 CET 2003


>
> >    do {
> >        do {
> >            nic_write(NIC_IOPORT, *p++);
> >        } while (il--!=0);
> >    } while (ih--!=0);

Looking to the dev/lanc111.c, you'll notice that I put the DMA loops
in separate routines:

   static void NicWrite(u_char * buf, int len)
   static void NicRead(u_char * buf, int len)

Typically the compiler can optimize small routines much better,
resulting in:

.L94
   ld r24,Z+
   sts -16376,r24
   subi r22,lo8(-(-1))
   sbci r23,hi8(-(-1))
   brne .L94

If I'm not wrong, this is even 1 cycle faster.

Harald




More information about the En-Nut-Discussion mailing list