I want to increase the number of integer registers in the ARM machine.
I don’t have any idea how/where I can start. Can anybody help me?
By the way, what are the following line in the ARMRegisterInfo.td specify:
The code below in lib/Target/ARM/ARMRegisterInfo.td is where you
should look into,
// Integer registers
def R0 : ARMReg< 0, "r0">, DwarfRegNum<>;
def R1 : ARMReg< 1, "r1">, DwarfRegNum<>;
That's the easy part. ARM (AArch32) has 16 registers because register operands are stored in a 4-bit bitfield in the instructions. If you want to add more registers, then you will also need to modify the instruction encoding of every instruction, or place them in a separate namespace (as with the NEON / VFP registers) and add instructions for explicitly modifying them.
Oh, I miss that part. So since the ARM only save 4 bits for register
operand, I don't see there is a easy way to do what you said. Sounds
like a huge work?
I almost change all the instruction formats. It was a huge work. I am going to compile and run it now.
I almost change all the instruction formats. It was a huge work. I am going
to compile and run it now.
We have done the similar work on this topic by gcc and we have
start migrate our platform to LLVM.
In my experience, you need to take care the follow part:
 Doubling the Number of Registers on ARM Processors
Thanks Kito. It is very helpful.