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

Re: discussion reset! thumb2/thumbee code as on armv7-a

> Lets take a step back on the naming.
> Let's say for example that we decide to use the fact that ThumbEE is a
> required component on the ARMv7-A profile.
> My qualm with Thumb code on ARM is that it requires all libraries and
> executables to be compiled with a compatible ABI in the first place.

Huh? That's the whole point of the EABI. One of the core requirements is that 
code be interwoking safe, i.e. you can mix ARM and Thumb code freely.

> This means that everything gets prepended with the thumb interworking
> which is maybe a register move and an extra branch, or a different
> kind of branch (bx instead of bl?), and some weird little trampolines
> in places to make sure one ISA can call the other.

That's only really true on armv4t.  Armv5 introduced a couple of changes that 
mean interworking is for most practical purposes free.
> What I understand with Thumb on the ARMv7-A is that this whole
> interworking thing is made redundant as the new Thumb instruction set
> includes 32-bit instructions to take care of the "missing" ARM ISA not
> available in the original Thumb instruction set, and they're encoded
> identically. Mixing Thumb2 and ARM ISAs is therefore transparent as
> long as the chip is running on the assumption that it's decoding
> "Thumb" code.

Thumb-1 was a new CPU mode that uses 16-bit instruction words. As such it only 
encodes a subset of the functionality available in ARM mode. This subset is 
for the most part fully functional, but tends to give smaller, slower code.

Thumb-2 is an extension of Thumb-1 that adds a bunch of new instructions 
(mostly using 32-bit encodings).  On older cores these encodings were 
undefined.  The new encodings implement functionality that is mostly 
equivalent to that in ARM mode.  ARM and Thumb-2 encodings are not the same.

Thumb-2EE is an additional new CPU mode. It implements a variant of Thumb-2 
tailored towards dynamically compiled code (e.g. JVM JITs). It replaces some 
instructions (mostly the privileged ones), and modifies the semantics of 

> Let's say we said, the new port will be based on the Thumb ISA as in
> the ARMv7-A and depdenent on that profile, could we call it "thumb" or
> "thumbee" or so and remove the differentiation on arm and armel by the
> fact that it's built for this new improved instruction set with
> greater code density?

Choice of ISA is independent of the ABI. Generally speaking ARM code is still 
faster.  This is another instance of where you want multiple builds of the 
same package within the same port, so users can choose between
speed (-marm -O2) and size (-mthumb -Os) optimized builds.


Reply to: