@gloriouscow Similar-in-spirit trick for Sentinel's microcode: https://codeberg.org/cr1901/sentinel/src/branch/main/src/sentinel_cpu/microcode.asm#L311-L314
I have the current shifted value at the output of the ALU and a shift count at the input of the ALU. I send the shift value to the ALU input as the decremented shift count reaches the ALU output. I repeat this in a loop until the shift count goes to zero. That way, I'm shifting and counting the number of shifts in lockstep using a single ALU resource :D.