Martin Storsjö martin@martin.st writes:
The uxtb instruction requires ARMv6, while an ARM10 is ARMv5, afaik.
I see.
So the functions using uxtb should only be enabled if the target is >= ARMv6, not arm in general. (The check can probably be done by testing to assemble such instructions, just as the check for neon does.)
So the aes functions could be moved to an arm/v6 subdirectory (the uxtb occurs in aes.m4, included in the aes-*.asm).
What alternative are there to uxtb? The easiest alternative is to have a series of rotates and ands.
But if we sacrifice a register to hold the byte mask 0xff, uxtb can be replaced by an and with rotate.
This even has the advantage that we can offset the rotate by two bits, and avoid shifting the index when it is used for the table lookup.
So instead of, e.g,
uxtb T0, X, ror #8 ldr [TABLE, T0, lsl #2]
put the value 0x3fc in MASK, and do
and T0, MASK, X, ror#6 ldr [TABLE, T0]
Eliminating a shift/rotate operation might even make the code faster.
Regards, /Niels