[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Which port for armv4l?



On Wed, 17 Aug 2016, Tixy wrote:

> > What about other (conditional) branch exchange instructions (BXCC, BXNE 
> > etc.)?
> 
> That's a BX instruction with condition checks, I was treating that as
> the same instruction (all older ARM instructions supported conditional
> execution, it's the top 4 bits of the instruction encoding).

So first 4 bits are examined before actual decoding of the instruction and 
if the condition is not met, then the instruction is ignored and no 
exception is raised? Smart...

I see that the patch catches instructions with all conditions and all 
registers (x1 2F FF 1x)... now it makes sense.

> Correct. I run armel on ARMv5 devices that doesn't have Thumb (Marvel
> Kirkwood SoCs) though it does have support for BX (which was added to
> ARMv5 as a mandatory instruction even if Thumb is not supported).

I see...

> Yes, and when the exception returns, the register values will be
> restored from that 'regs' structure. This will use an LDM (load
> multiple) instruction and the fact that PC has bit zero set or not won't
> matter on ARM4 devices (even ARM4T devices). And anyway, if the binary
> is compiled for ARM code not Thumb it won't be calling BX to load a
> value with bit 0 set anyway, because on ARM4T CPUs that would switch to
> Thumb mode and things would go horribly wrong if the binaries in the
> system were build for ARM not Thumb.

So the only difference preventing armel from running on StrongARM (without 
the kernel patch) is the lack of BX instruction? What is the gain of losing 
this backward compatibility?

You wrote that:

> I believe so. If my memory serves me "BX reg" was recommended over "MOV
> PC,reg" so binaries built for ARM4T would likely use it even when they
> are built for ARM code rather than Thumb. (It makes sense as it means
> that code can be interwork happily with binaries built using Thumb
> instructions)

I don't see why using MOV PC,reg would prevent interworking with binaries 
built using Thumb, as this code executes in ARM state anyway... it could 
use BX only to switch to Thumb (and when it doesn't use Thumb at all, it 
would never use it)...

Anyway, now I have some more problems with the machine (I wanted to try 
the new kernel, but after driving to work today with Jornada in my 
backpack it suddenly stopped booting even WinCE - it booted yesterday 
evening), so I'll have to try to fix that first...

Thank you!

-- 
Adam Wysocki
http://www.chmurka.net/


Reply to: