News for hackers. Stuff that matters.
Re:Intel Licenses ARM Technology to Boost Foundry Business by erichocean on Tuesday August 16, 2016 @08:00PM (#12301572)
> Does CISC have any technical merit at all?

Object code, in some cases, can be smaller. That's why modern RISC ISAs like RISC-V include a "compressed" instruction set option, to combat the object code size disparity with CISC ISAs.

Re:Intel Licenses ARM Technology to Boost Foundry Business by Unklejoe on Tuesday August 16, 2016 @08:08PM (#12301611)
I've heard of that. I believe it's used on some automotive computers (Bosch GS19 transmission controller comes to mind, which I think uses the Freescale MPC500).

I wonder how it works. If the opcodes can all be compressed, why not just make them smaller to begin with? I guess I always thought of opcodes as being enumerations of "commands".

Re:Intel Licenses ARM Technology to Boost Foundry Business by baobrien on Tuesday August 16, 2016 @09:33PM (#12301916)
In the case of RISC-V, the compressed extension only covers a subset of the full length instructions, but can be freely intermixed with them. It turns out that RV64GC (risc-v 64 bit with compressed instructions) usually beats x86_64 in dynamic instruction bytes.

See slide 31: https://riscv.org/wp-content/uploads/2016/07/Tue1130celio-fu...

Re:Intel Licenses ARM Technology to Boost Foundry Business by wolf550e on Tuesday August 16, 2016 @08:25PM (#12301670)
RISC instructions are all the same size in bits to achieve fast decode speeds. Thus you must choose between 32bit instructions or 16bit instructions. ARM supports both, including function calls from one to the other.
Re:Intel Licenses ARM Technology to Boost Foundry Business by plasticchris on Tuesday August 16, 2016 @08:43PM (#12301725)
This must have been solved, thumb 2 (https://en.wikipedia.org/wiki/ARM_architecture#Thumb-2) mixes 16 and 32 bit instructions.
Re:Intel Licenses ARM Technology to Boost Foundry Business by gvb on Tuesday August 16, 2016 @09:03PM (#12301806)
The 16 bit "thumb" instructions are still all fixed size - 16 bits. They do this by limiting the available options in the instructions. For instance, the register selection field will be 3 bits so only 8 registers can be directly accessed by the thumb instructions. They also drop some instructions IIRC.

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.

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.