566c566
< for type in ('uint8_t', 'uint16_t', 'uint32_t'):
---
> for typeSize in (8, 16, 32):
568c568
< for dRegs in range(sRegs, 5):
---
> for dRegs in range(sRegs, min(sRegs * 64 / typeSize + 1, 5)):
574c574,575
< substDict = { "class_name" : Name, "targs" : type }
---
> substDict = { "class_name" : Name,
> "targs" : "uint%d_t" % typeSize }