Increase the number of registers in ARM

Hi,

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:

def qsub_0
def qsub_1

Thanks

Best Regards,
A. Yazdanbakhsh

The code below in lib/Target/ARM/ARMRegisterInfo.td is where you
should look into,

// Integer registers
def R0 : ARMReg< 0, "r0">, DwarfRegNum<[0]>;
def R1 : ARMReg< 1, "r1">, DwarfRegNum<[1]>;
  
  ...

HTH,
chenwj

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.

David

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?

Regards,
chenwj

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[1] 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:
* ARMBaseRegisterInfo::getRegPressureLimit
* ARMBaseRegisterInfo::getRawAllocationOrder
* CalleeSavedRegs
* ARMFrameLowering::emitPrologue

[1] Doubling the Number of Registers on ARM Processors
http://aces.snu.ac.kr/interact-16/papers/interact-16-paper-1.pdf

Thanks Kito. It is very helpful.