Re:Intel Licenses ARM Technology to Boost Foundry Business
by oshepherd on Tuesday August 16, 2016 @10:08PM
(#12302038)
Thumb-2 (about 13 years old at this point) extended Thumb to cover the entirety of instruction set. That is, every* ARM instruction has a corresponding Thumb instruction (The converse is not quite the case)
There is very little reason to use ARM code in ARMv7 and up.
Incidentally, ARMv8's 64-bit mode (AArch64) adds a whole new instruction set, called A64. It's fixed width 32-bit per instruction, and the only option for 64-bit code.
* Excluding some really obscure, mostly long deprecated ones
Re:Intel Licenses ARM Technology to Boost Foundry Business
by oshepherd on Tuesday August 16, 2016 @10:23PM
(#12302100)
I noticed that I missed out mentioning that, yes, Thumb-2 made Thumb variable length (it already sorta-was, branches were always kinda 32-bit)
Any halfword where bit[15:13]=='111' && bit[12:11]!='00' is the leading half of a 32-bit Thumb instruction
Re:Intel Licenses ARM Technology to Boost Foundry Business
by baobrien on Tuesday August 16, 2016 @09:42PM
(#12301946)
That's why I'm a fan of the RISC-V compressed ISA extension. Compressed instructions are 16 bits long and a subset of the 32 bit instructions, but can be mixed freely with 32 bit. The extension also relaxes the alignment requirements, so that 32 bit instructions can be aligned to 16 bit boundaries.
The 16 bit instructions map 1:1 to the 32 bit instructions, so decoding is unchanged, The difference is a pre-decoding transmogrificaiton stage where some of the resulting fields in the transmogrified 32 bit instruction are fixed (e.g. 0) and some are filled in from the original 16 bit instruction fields.
Switching between 32 bit and "thumb" is fairly painless but the instructions cannot be intermingled. When you do a call, you have the opportunity to switch 32/thumb. When you return, the processor switches back as appropriate.
The resulting thumb code is more compact than full 32 bit instructions, but it isn't 2x more compact because you still need some 32 bit instructions (subroutines) and the 16 bit instructions are not as powerful as the full 32 bit instructions.