Does SM3P0 use floating-point or vector registers?
No. These scalar crypto extension instructions use integer X registers.
SM3 hash P0 permutation: P0(x) = x ^ ROTL(x,9) ^ ROTL(x,17)
Syntax is sm3p0 rd, rs1; operands select integer x0–x31 or ABI names, with no assembly immediate.
32-bit OP-IMM: bits31..20=000100001000, funct3=001, opcode=0010011; the selector is a fixed encoding field.
RV32/RV64 Zksh (also in Zks); XOR the low 32 source bits with their left rotations by 9 and 17, then sign-extend the result to XLEN.
An x0 source is zero and writes to x0 are discarded; overlap reads values before writeback and equal sources share one value. Execution latency must be data-independent.
sm3p0 implements SM3 P0 on RV32/RV64: take r1=X(rs1)[31:0], compute r1 ^ ROL32(r1,9) ^ ROL32(r1,17), and sign-extend the result to XLEN in rd.
Bounded teaching inputs execute the official SM3 fixed-width bit operations; this does not model a complete algorithm or microarchitecture.
Initially rd shares the source value when rd=rs1; otherwise the demo starts rd at 0. An rs1=x0 source always reads 0. SM3P0 is defined in RV32/RV64; RV64 uses X(rs1)[31:0] and sign-extends the 32-bit result to XLEN.
This animation shows only official ISA fields and architectural state; it does not model a complete hash algorithm, pipeline, cache, or timing implementation.
sm3p0 computes the 32-bit SM3 P0 transform, sign-extending the result on RV64.
RV32/RV64 Zksh, a1=1: the page's formula gives a0=0x00020201.
RV32/RV64 Zksh, a1=1: the page's formula gives a0=0x00020201.
No. These scalar crypto extension instructions use integer X registers.
No. It implements one SM3 P0 transform defined by the manual.