Does MIN 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 signed comparison.
MIN uses opcode 0110011 (0x33), funct3 100, funct7 0000101. The rs1 and rs2 fields select the two source registers, and rd selects the destination register.
MIN is a Zbb integer min/max instruction. It compares x[rs1] and x[rs2] as signed 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.
MIN 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 «min x10, x11, x12 ; x10 = signed_min(x11, x12)».
Understand this scenario with real code like «min x10, x11, x12 ; x10 = signed_min(x11, x12)».
No. It returns the original XLEN-bit value selected from rs1 or rs2 by the comparison rule.
Use the non-U form for signed two's-complement ordering; use the U form when data is ordered as unsigned.