Is it available on RV32?
No. SRLIW, SRLW, and SUBW are RV64I word-operation forms.
Shift 32-bit value in rs1 right logically by immediate, sign-extend 32-bit result to 64 bits
SRLIW uses opcode 0011011 (0x1b), funct3 101, funct7 0000000. The rs1 field selects the source register, the 12-bit immediate provides the second operand, and rd selects the destination.
SRLIW (I-type, opcode=0011011, funct3=101, funct7=0000000) performs a logical right shift on the lower 32 bits of rs1 (zeros are shifted into the upper bits) by the shift amount in imm[4:0]. The 32-bit result is sign-extended to 64 bits. imm[5] must be 0, otherwise the encoding is reserved.
SRLIW is an RV64I W-suffix integer instruction: it uses the low 32 bits of its inputs, produces a 32-bit result, then sign-extends bit 31 to 64 bits.
Understand this scenario with real code like «srliw x10, x11, 4 # x10 = sign-extend((x11[31:0] >> 4)[31:0])».
Understand this scenario with real code like «srliw x10, x11, 4 # x10 = sign-extend((x11[31:0] >> 4)[31:0])».
No. SRLIW, SRLW, and SUBW are RV64I word-operation forms.
The logical shift forms a 32-bit result first; the W-instruction rule then sign-extends bit 31 to 64 bits.