Does MINU return 0 or 1?
No. It returns the original XLEN-bit value selected from rs1 or rs2 by the comparison rule.
Return the minimum of rs1 and rs2 using unsigned comparison.
MINU uses opcode 0110011 (0x33), funct3 101, funct7 0000101. The rs1 and rs2 fields select the two source registers, and rd selects the destination register.
MINU is a Zbb integer min/max instruction. It compares x[rs1] and x[rs2] as unsigned values and writes the original XLEN-bit value that is smaller under that ordering to rd. It does not set condition codes and does not branch.
MINU is useful for branchless clamp, min/max selection, and cases where the original value must be preserved after comparison. It returns the selected rs1 or rs2 bit pattern, not a comparison bit.
Understand this scenario with real code like «minu x10, x11, x12 ; x10 = unsigned_min(x11, x12)».
Understand this scenario with real code like «minu x10, x11, x12 ; x10 = unsigned_min(x11, x12)».
No. It returns the original XLEN-bit value selected from rs1 or rs2 by the comparison rule.
Use the U form when data is ordered as unsigned; use the non-U form for signed two's-complement ordering.