When the shift count is a register
Up to now every shift moved by a constant, which is exactly why MWCC could fold the count into an rlwinm (slwi/srwi) or an srawi. A runtime amount leaves nothing to fold. PowerPC keeps separate register-shift opcodes for that case, each one reading its count out of a second register. Here's a logical right shift by a variable amount:
srw r3,r3,r4
blr
These three track the constant forms by sign. slw shifts left, srw shifts right logically for unsigned values, and sraw shifts right algebraically for signed ones. The signed-versus-unsigned rule hasn't changed at all; the one new wrinkle is that the count rides in a register rather than inside the instruction.
Spot any of slw/srw/sraw with no trailing i and you know the shift distance came from a variable in the source. Take the direction and sign straight from the mnemonic, and let the second argument carry the count.
Your task
Write shl_var to match the target.