diff --git a/llvm/lib/Target/RISCV/RISCVInstrInfoB.td b/llvm/lib/Target/RISCV/RISCVInstrInfoB.td --- a/llvm/lib/Target/RISCV/RISCVInstrInfoB.td +++ b/llvm/lib/Target/RISCV/RISCVInstrInfoB.td @@ -338,8 +338,8 @@ let Predicates = [HasStdExtZbb] in { def MIN : ALU_rr<0b0000101, 0b100, "min">, Sched<[]>; -def MAX : ALU_rr<0b0000101, 0b101, "max">, Sched<[]>; -def MINU : ALU_rr<0b0000101, 0b110, "minu">, Sched<[]>; +def MINU : ALU_rr<0b0000101, 0b101, "minu">, Sched<[]>; +def MAX : ALU_rr<0b0000101, 0b110, "max">, Sched<[]>; def MAXU : ALU_rr<0b0000101, 0b111, "maxu">, Sched<[]>; } // Predicates = [HasStdExtZbb] diff --git a/llvm/test/MC/RISCV/rv32zbb-valid.s b/llvm/test/MC/RISCV/rv32zbb-valid.s --- a/llvm/test/MC/RISCV/rv32zbb-valid.s +++ b/llvm/test/MC/RISCV/rv32zbb-valid.s @@ -42,12 +42,12 @@ # CHECK-ASM-AND-OBJ: min t0, t1, t2 # CHECK-ASM: encoding: [0xb3,0x42,0x73,0x0a] min t0, t1, t2 -# CHECK-ASM-AND-OBJ: max t0, t1, t2 -# CHECK-ASM: encoding: [0xb3,0x52,0x73,0x0a] -max t0, t1, t2 # CHECK-ASM-AND-OBJ: minu t0, t1, t2 -# CHECK-ASM: encoding: [0xb3,0x62,0x73,0x0a] +# CHECK-ASM: encoding: [0xb3,0x52,0x73,0x0a] minu t0, t1, t2 +# CHECK-ASM-AND-OBJ: max t0, t1, t2 +# CHECK-ASM: encoding: [0xb3,0x62,0x73,0x0a] +max t0, t1, t2 # CHECK-ASM-AND-OBJ: maxu t0, t1, t2 # CHECK-ASM: encoding: [0xb3,0x72,0x73,0x0a] maxu t0, t1, t2