What is the correct way to do the following in Xtensa assembly:
a4 = ( 1 << a5 )
where a4 and a5 are registers and a5 could contain the value 0 to 3 (could be 0 to 7 in the future, but not too worried about that now.)
I'm sure this must be simple but it seems to be quite tricky.
According to the Xtensa ISA you have to load the shift amount into an internal shift amount register (SAR) using the ssl instruction (set shift left amount). Then you have to use the sll (shift logical left) instruction, which takes two registers, the destination register and the register containing the value to be shifted. An equivalent to your expression a4 = ( 1 << a5 )
in assembler is:
movi a4, 1
ssl a5
sll a4, a4