Subject: Possible bug in arm32 strongarm optimisations.
To: None <port-arm32@netbsd.org, tech-toolchain@netbsd.org>
From: Chris Gilbert <chris@buzzbee.freeserve.co.uk>
List: port-arm32
Date: 10/25/2000 00:23:34
Hi,

I've been trying to build an arm32 kernel with the -mcpu=strongarm 
-mtune=strongarm.

The problem I've had is that the podulebus doesn't get devices attaching 
properly. Anyway, after doing some rummaging around in the .s files from a 
kernel with and without the above options it seems that it's doing the 
following optimsation:
turning:
ldr r3, [r5, #6]
mov r0, r3, lsr #16
into
ldrh r0, [r5, #4]

This occurs at about line 289/290 of sys/arch/arm32/podulebus/podulebus.c
I believe it should actually produce:
ldrh r0, [r5, #8]

(note it's late and I'm tired so I may well be wrong)

If someone else could confirm this, I'll raise a PR tommorrow (unless someone 
else wants to).  My concern is that cats and shark kernels default to using 
the above options which might be wrong, should this option be removed from 
1.5 kernels?

(nice to actually be able to look at asm and actually understand it easily 
once more, been far too long since I last saw ARM asm :)

Cheers,
Chris