aboutsummaryrefslogtreecommitdiff
path: root/llvm/test/CodeGen/RISCV
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/test/CodeGen/RISCV')
-rw-r--r--llvm/test/CodeGen/RISCV/and-negpow2-cmp.ll4
-rw-r--r--llvm/test/CodeGen/RISCV/i64-icmp.ll6
-rw-r--r--llvm/test/CodeGen/RISCV/min-max.ll634
-rw-r--r--llvm/test/CodeGen/RISCV/rvv/sifive-O0-ATM-ATK.ll18
-rw-r--r--llvm/test/CodeGen/RISCV/rvv/sifive_sf_mm_e4m3_e4m3.ll20
-rw-r--r--llvm/test/CodeGen/RISCV/rvv/sifive_sf_mm_e4m3_e5m2.ll20
-rw-r--r--llvm/test/CodeGen/RISCV/rvv/sifive_sf_mm_e5m2_e4m3.ll20
-rw-r--r--llvm/test/CodeGen/RISCV/rvv/sifive_sf_mm_e5m2_e5m2.ll20
-rw-r--r--llvm/test/CodeGen/RISCV/rvv/sifive_sf_mm_f_f.ll52
-rw-r--r--llvm/test/CodeGen/RISCV/rvv/sifive_sf_mm_s_s.ll20
-rw-r--r--llvm/test/CodeGen/RISCV/rvv/sifive_sf_mm_s_u.ll20
-rw-r--r--llvm/test/CodeGen/RISCV/rvv/sifive_sf_mm_u_s.ll20
-rw-r--r--llvm/test/CodeGen/RISCV/rvv/sifive_sf_mm_u_u.ll20
-rw-r--r--llvm/test/CodeGen/RISCV/rvv/sifive_sf_vlte16.ll23
-rw-r--r--llvm/test/CodeGen/RISCV/rvv/sifive_sf_vlte32.ll23
-rw-r--r--llvm/test/CodeGen/RISCV/rvv/sifive_sf_vlte64.ll23
-rw-r--r--llvm/test/CodeGen/RISCV/rvv/sifive_sf_vlte8.ll23
-rw-r--r--llvm/test/CodeGen/RISCV/rvv/sifive_sf_vsettk.ll23
-rw-r--r--llvm/test/CodeGen/RISCV/rvv/sifive_sf_vsettm.ll23
-rw-r--r--llvm/test/CodeGen/RISCV/rvv/sifive_sf_vsettnt.ll72
-rw-r--r--llvm/test/CodeGen/RISCV/rvv/sifive_sf_vste16.ll23
-rw-r--r--llvm/test/CodeGen/RISCV/rvv/sifive_sf_vste32.ll23
-rw-r--r--llvm/test/CodeGen/RISCV/rvv/sifive_sf_vste64.ll23
-rw-r--r--llvm/test/CodeGen/RISCV/rvv/sifive_sf_vste8.ll23
-rw-r--r--llvm/test/CodeGen/RISCV/rvv/sifive_sf_vtdiscard.ll22
-rw-r--r--llvm/test/CodeGen/RISCV/rvv/sifive_sf_vtmv_t_v.ll114
-rw-r--r--llvm/test/CodeGen/RISCV/rvv/sifive_sf_vtmv_v_t.ll114
-rw-r--r--llvm/test/CodeGen/RISCV/rvv/sifive_sf_vtzero_t.ll24
-rw-r--r--llvm/test/CodeGen/RISCV/select-to-and-zext.ll6
-rw-r--r--llvm/test/CodeGen/RISCV/setcc-logic.ll5
-rw-r--r--llvm/test/CodeGen/RISCV/sext-zext-trunc.ll6
-rw-r--r--llvm/test/CodeGen/RISCV/xaluo.ll12
32 files changed, 1456 insertions, 23 deletions
diff --git a/llvm/test/CodeGen/RISCV/and-negpow2-cmp.ll b/llvm/test/CodeGen/RISCV/and-negpow2-cmp.ll
index 2a46a59..4f036d3 100644
--- a/llvm/test/CodeGen/RISCV/and-negpow2-cmp.ll
+++ b/llvm/test/CodeGen/RISCV/and-negpow2-cmp.ll
@@ -221,8 +221,8 @@ define i64 @test12(i64 %0) #0 {
;
; RV64-LABEL: test12:
; RV64: # %bb.0: # %entry
-; RV64-NEXT: addiw a0, a0, -16
-; RV64-NEXT: addi a0, a0, 13
+; RV64-NEXT: addi a0, a0, -16
+; RV64-NEXT: addiw a0, a0, 13
; RV64-NEXT: seqz a0, a0
; RV64-NEXT: ret
entry:
diff --git a/llvm/test/CodeGen/RISCV/i64-icmp.ll b/llvm/test/CodeGen/RISCV/i64-icmp.ll
index 88d989d..2742b9a 100644
--- a/llvm/test/CodeGen/RISCV/i64-icmp.ll
+++ b/llvm/test/CodeGen/RISCV/i64-icmp.ll
@@ -708,8 +708,7 @@ define i64 @icmp_sle_constant_neg_2050(i64 %a) nounwind {
define i64 @icmp_eq_zext_inreg_small_constant(i64 %a) nounwind {
; RV64I-LABEL: icmp_eq_zext_inreg_small_constant:
; RV64I: # %bb.0:
-; RV64I-NEXT: sext.w a0, a0
-; RV64I-NEXT: addi a0, a0, -123
+; RV64I-NEXT: addiw a0, a0, -123
; RV64I-NEXT: seqz a0, a0
; RV64I-NEXT: ret
%1 = and i64 %a, 4294967295
@@ -748,8 +747,7 @@ define i64 @icmp_ne_zext_inreg_small_constant(i64 %a) nounwind {
define i64 @icmp_ne_zext_inreg_large_constant(i64 %a) nounwind {
; RV64I-LABEL: icmp_ne_zext_inreg_large_constant:
; RV64I: # %bb.0:
-; RV64I-NEXT: sext.w a0, a0
-; RV64I-NEXT: addi a0, a0, 2
+; RV64I-NEXT: addiw a0, a0, 2
; RV64I-NEXT: snez a0, a0
; RV64I-NEXT: ret
%1 = and i64 %a, 4294967295
diff --git a/llvm/test/CodeGen/RISCV/min-max.ll b/llvm/test/CodeGen/RISCV/min-max.ll
index acde8ad..e7f6899 100644
--- a/llvm/test/CodeGen/RISCV/min-max.ll
+++ b/llvm/test/CodeGen/RISCV/min-max.ll
@@ -5,6 +5,12 @@
; RUN: FileCheck %s --check-prefixes=ZBB,RV32ZBB
; RUN: llc < %s -mtriple=riscv64 -mattr=+zbb | \
; RUN: FileCheck %s --check-prefixes=ZBB,RV64ZBB
+; RUN: llc -mtriple=riscv32 -mattr=+experimental-xqcicm,+experimental-xqcics,+experimental-xqcicli,+zca,+short-forward-branch-opt,+conditional-cmv-fusion -verify-machineinstrs < %s | \
+; RUN: FileCheck %s --check-prefixes=XQCI
+; RUN: llc < %s -mtriple=riscv32 -mattr=+short-forward-branch-opt | \
+; RUN: FileCheck %s --check-prefixes=RV32I-SFB
+; RUN: llc < %s -mtriple=riscv64 -mattr=+short-forward-branch-opt | \
+; RUN: FileCheck %s --check-prefixes=RV64I-SFB
; Basic tests.
@@ -23,6 +29,27 @@ define signext i8 @smax_i8(i8 signext %a, i8 signext %b) {
; ZBB: # %bb.0:
; ZBB-NEXT: max a0, a0, a1
; ZBB-NEXT: ret
+;
+; XQCI-LABEL: smax_i8:
+; XQCI: # %bb.0:
+; XQCI-NEXT: qc.mvge a0, a1, a0, a1
+; XQCI-NEXT: ret
+;
+; RV32I-SFB-LABEL: smax_i8:
+; RV32I-SFB: # %bb.0:
+; RV32I-SFB-NEXT: blt a1, a0, .LBB0_2
+; RV32I-SFB-NEXT: # %bb.1:
+; RV32I-SFB-NEXT: mv a0, a1
+; RV32I-SFB-NEXT: .LBB0_2:
+; RV32I-SFB-NEXT: ret
+;
+; RV64I-SFB-LABEL: smax_i8:
+; RV64I-SFB: # %bb.0:
+; RV64I-SFB-NEXT: blt a1, a0, .LBB0_2
+; RV64I-SFB-NEXT: # %bb.1:
+; RV64I-SFB-NEXT: mv a0, a1
+; RV64I-SFB-NEXT: .LBB0_2:
+; RV64I-SFB-NEXT: ret
%c = call i8 @llvm.smax.i8(i8 %a, i8 %b)
ret i8 %c
}
@@ -42,6 +69,27 @@ define signext i16 @smax_i16(i16 signext %a, i16 signext %b) {
; ZBB: # %bb.0:
; ZBB-NEXT: max a0, a0, a1
; ZBB-NEXT: ret
+;
+; XQCI-LABEL: smax_i16:
+; XQCI: # %bb.0:
+; XQCI-NEXT: qc.mvge a0, a1, a0, a1
+; XQCI-NEXT: ret
+;
+; RV32I-SFB-LABEL: smax_i16:
+; RV32I-SFB: # %bb.0:
+; RV32I-SFB-NEXT: blt a1, a0, .LBB1_2
+; RV32I-SFB-NEXT: # %bb.1:
+; RV32I-SFB-NEXT: mv a0, a1
+; RV32I-SFB-NEXT: .LBB1_2:
+; RV32I-SFB-NEXT: ret
+;
+; RV64I-SFB-LABEL: smax_i16:
+; RV64I-SFB: # %bb.0:
+; RV64I-SFB-NEXT: blt a1, a0, .LBB1_2
+; RV64I-SFB-NEXT: # %bb.1:
+; RV64I-SFB-NEXT: mv a0, a1
+; RV64I-SFB-NEXT: .LBB1_2:
+; RV64I-SFB-NEXT: ret
%c = call i16 @llvm.smax.i16(i16 %a, i16 %b)
ret i16 %c
}
@@ -61,6 +109,27 @@ define signext i32 @smax_i32(i32 signext %a, i32 signext %b) {
; ZBB: # %bb.0:
; ZBB-NEXT: max a0, a0, a1
; ZBB-NEXT: ret
+;
+; XQCI-LABEL: smax_i32:
+; XQCI: # %bb.0:
+; XQCI-NEXT: qc.mvge a0, a1, a0, a1
+; XQCI-NEXT: ret
+;
+; RV32I-SFB-LABEL: smax_i32:
+; RV32I-SFB: # %bb.0:
+; RV32I-SFB-NEXT: blt a1, a0, .LBB2_2
+; RV32I-SFB-NEXT: # %bb.1:
+; RV32I-SFB-NEXT: mv a0, a1
+; RV32I-SFB-NEXT: .LBB2_2:
+; RV32I-SFB-NEXT: ret
+;
+; RV64I-SFB-LABEL: smax_i32:
+; RV64I-SFB: # %bb.0:
+; RV64I-SFB-NEXT: blt a1, a0, .LBB2_2
+; RV64I-SFB-NEXT: # %bb.1:
+; RV64I-SFB-NEXT: mv a0, a1
+; RV64I-SFB-NEXT: .LBB2_2:
+; RV64I-SFB-NEXT: ret
%c = call i32 @llvm.smax.i32(i32 %a, i32 %b)
ret i32 %c
}
@@ -112,6 +181,41 @@ define i64 @smax_i64(i64 %a, i64 %b) {
; RV64ZBB: # %bb.0:
; RV64ZBB-NEXT: max a0, a0, a1
; RV64ZBB-NEXT: ret
+;
+; XQCI-LABEL: smax_i64:
+; XQCI: # %bb.0:
+; XQCI-NEXT: sltu a4, a2, a0
+; XQCI-NEXT: slt a5, a3, a1
+; XQCI-NEXT: qc.mveq a5, a1, a3, a4
+; XQCI-NEXT: qc.mveqi a0, a5, 0, a2
+; XQCI-NEXT: qc.mveqi a1, a5, 0, a3
+; XQCI-NEXT: ret
+;
+; RV32I-SFB-LABEL: smax_i64:
+; RV32I-SFB: # %bb.0:
+; RV32I-SFB-NEXT: sltu a4, a2, a0
+; RV32I-SFB-NEXT: slt a5, a3, a1
+; RV32I-SFB-NEXT: bne a1, a3, .LBB3_2
+; RV32I-SFB-NEXT: # %bb.1:
+; RV32I-SFB-NEXT: mv a5, a4
+; RV32I-SFB-NEXT: .LBB3_2:
+; RV32I-SFB-NEXT: bnez a5, .LBB3_4
+; RV32I-SFB-NEXT: # %bb.3:
+; RV32I-SFB-NEXT: mv a0, a2
+; RV32I-SFB-NEXT: .LBB3_4:
+; RV32I-SFB-NEXT: bnez a5, .LBB3_6
+; RV32I-SFB-NEXT: # %bb.5:
+; RV32I-SFB-NEXT: mv a1, a3
+; RV32I-SFB-NEXT: .LBB3_6:
+; RV32I-SFB-NEXT: ret
+;
+; RV64I-SFB-LABEL: smax_i64:
+; RV64I-SFB: # %bb.0:
+; RV64I-SFB-NEXT: blt a1, a0, .LBB3_2
+; RV64I-SFB-NEXT: # %bb.1:
+; RV64I-SFB-NEXT: mv a0, a1
+; RV64I-SFB-NEXT: .LBB3_2:
+; RV64I-SFB-NEXT: ret
%c = call i64 @llvm.smax.i64(i64 %a, i64 %b)
ret i64 %c
}
@@ -131,6 +235,27 @@ define signext i8 @smin_i8(i8 signext %a, i8 signext %b) {
; ZBB: # %bb.0:
; ZBB-NEXT: min a0, a0, a1
; ZBB-NEXT: ret
+;
+; XQCI-LABEL: smin_i8:
+; XQCI: # %bb.0:
+; XQCI-NEXT: qc.mvge a0, a0, a1, a1
+; XQCI-NEXT: ret
+;
+; RV32I-SFB-LABEL: smin_i8:
+; RV32I-SFB: # %bb.0:
+; RV32I-SFB-NEXT: blt a0, a1, .LBB4_2
+; RV32I-SFB-NEXT: # %bb.1:
+; RV32I-SFB-NEXT: mv a0, a1
+; RV32I-SFB-NEXT: .LBB4_2:
+; RV32I-SFB-NEXT: ret
+;
+; RV64I-SFB-LABEL: smin_i8:
+; RV64I-SFB: # %bb.0:
+; RV64I-SFB-NEXT: blt a0, a1, .LBB4_2
+; RV64I-SFB-NEXT: # %bb.1:
+; RV64I-SFB-NEXT: mv a0, a1
+; RV64I-SFB-NEXT: .LBB4_2:
+; RV64I-SFB-NEXT: ret
%c = call i8 @llvm.smin.i8(i8 %a, i8 %b)
ret i8 %c
}
@@ -150,6 +275,27 @@ define signext i16 @smin_i16(i16 signext %a, i16 signext %b) {
; ZBB: # %bb.0:
; ZBB-NEXT: min a0, a0, a1
; ZBB-NEXT: ret
+;
+; XQCI-LABEL: smin_i16:
+; XQCI: # %bb.0:
+; XQCI-NEXT: qc.mvge a0, a0, a1, a1
+; XQCI-NEXT: ret
+;
+; RV32I-SFB-LABEL: smin_i16:
+; RV32I-SFB: # %bb.0:
+; RV32I-SFB-NEXT: blt a0, a1, .LBB5_2
+; RV32I-SFB-NEXT: # %bb.1:
+; RV32I-SFB-NEXT: mv a0, a1
+; RV32I-SFB-NEXT: .LBB5_2:
+; RV32I-SFB-NEXT: ret
+;
+; RV64I-SFB-LABEL: smin_i16:
+; RV64I-SFB: # %bb.0:
+; RV64I-SFB-NEXT: blt a0, a1, .LBB5_2
+; RV64I-SFB-NEXT: # %bb.1:
+; RV64I-SFB-NEXT: mv a0, a1
+; RV64I-SFB-NEXT: .LBB5_2:
+; RV64I-SFB-NEXT: ret
%c = call i16 @llvm.smin.i16(i16 %a, i16 %b)
ret i16 %c
}
@@ -169,6 +315,27 @@ define signext i32 @smin_i32(i32 signext %a, i32 signext %b) {
; ZBB: # %bb.0:
; ZBB-NEXT: min a0, a0, a1
; ZBB-NEXT: ret
+;
+; XQCI-LABEL: smin_i32:
+; XQCI: # %bb.0:
+; XQCI-NEXT: qc.mvge a0, a0, a1, a1
+; XQCI-NEXT: ret
+;
+; RV32I-SFB-LABEL: smin_i32:
+; RV32I-SFB: # %bb.0:
+; RV32I-SFB-NEXT: blt a0, a1, .LBB6_2
+; RV32I-SFB-NEXT: # %bb.1:
+; RV32I-SFB-NEXT: mv a0, a1
+; RV32I-SFB-NEXT: .LBB6_2:
+; RV32I-SFB-NEXT: ret
+;
+; RV64I-SFB-LABEL: smin_i32:
+; RV64I-SFB: # %bb.0:
+; RV64I-SFB-NEXT: blt a0, a1, .LBB6_2
+; RV64I-SFB-NEXT: # %bb.1:
+; RV64I-SFB-NEXT: mv a0, a1
+; RV64I-SFB-NEXT: .LBB6_2:
+; RV64I-SFB-NEXT: ret
%c = call i32 @llvm.smin.i32(i32 %a, i32 %b)
ret i32 %c
}
@@ -220,6 +387,41 @@ define i64 @smin_i64(i64 %a, i64 %b) {
; RV64ZBB: # %bb.0:
; RV64ZBB-NEXT: min a0, a0, a1
; RV64ZBB-NEXT: ret
+;
+; XQCI-LABEL: smin_i64:
+; XQCI: # %bb.0:
+; XQCI-NEXT: sltu a4, a0, a2
+; XQCI-NEXT: slt a5, a1, a3
+; XQCI-NEXT: qc.mveq a5, a1, a3, a4
+; XQCI-NEXT: qc.mveqi a0, a5, 0, a2
+; XQCI-NEXT: qc.mveqi a1, a5, 0, a3
+; XQCI-NEXT: ret
+;
+; RV32I-SFB-LABEL: smin_i64:
+; RV32I-SFB: # %bb.0:
+; RV32I-SFB-NEXT: sltu a4, a0, a2
+; RV32I-SFB-NEXT: slt a5, a1, a3
+; RV32I-SFB-NEXT: bne a1, a3, .LBB7_2
+; RV32I-SFB-NEXT: # %bb.1:
+; RV32I-SFB-NEXT: mv a5, a4
+; RV32I-SFB-NEXT: .LBB7_2:
+; RV32I-SFB-NEXT: bnez a5, .LBB7_4
+; RV32I-SFB-NEXT: # %bb.3:
+; RV32I-SFB-NEXT: mv a0, a2
+; RV32I-SFB-NEXT: .LBB7_4:
+; RV32I-SFB-NEXT: bnez a5, .LBB7_6
+; RV32I-SFB-NEXT: # %bb.5:
+; RV32I-SFB-NEXT: mv a1, a3
+; RV32I-SFB-NEXT: .LBB7_6:
+; RV32I-SFB-NEXT: ret
+;
+; RV64I-SFB-LABEL: smin_i64:
+; RV64I-SFB: # %bb.0:
+; RV64I-SFB-NEXT: blt a0, a1, .LBB7_2
+; RV64I-SFB-NEXT: # %bb.1:
+; RV64I-SFB-NEXT: mv a0, a1
+; RV64I-SFB-NEXT: .LBB7_2:
+; RV64I-SFB-NEXT: ret
%c = call i64 @llvm.smin.i64(i64 %a, i64 %b)
ret i64 %c
}
@@ -239,6 +441,27 @@ define i8 @umax_i8(i8 zeroext %a, i8 zeroext %b) {
; ZBB: # %bb.0:
; ZBB-NEXT: maxu a0, a0, a1
; ZBB-NEXT: ret
+;
+; XQCI-LABEL: umax_i8:
+; XQCI: # %bb.0:
+; XQCI-NEXT: qc.mvgeu a0, a1, a0, a1
+; XQCI-NEXT: ret
+;
+; RV32I-SFB-LABEL: umax_i8:
+; RV32I-SFB: # %bb.0:
+; RV32I-SFB-NEXT: bltu a1, a0, .LBB8_2
+; RV32I-SFB-NEXT: # %bb.1:
+; RV32I-SFB-NEXT: mv a0, a1
+; RV32I-SFB-NEXT: .LBB8_2:
+; RV32I-SFB-NEXT: ret
+;
+; RV64I-SFB-LABEL: umax_i8:
+; RV64I-SFB: # %bb.0:
+; RV64I-SFB-NEXT: bltu a1, a0, .LBB8_2
+; RV64I-SFB-NEXT: # %bb.1:
+; RV64I-SFB-NEXT: mv a0, a1
+; RV64I-SFB-NEXT: .LBB8_2:
+; RV64I-SFB-NEXT: ret
%c = call i8 @llvm.umax.i8(i8 %a, i8 %b)
ret i8 %c
}
@@ -258,6 +481,27 @@ define i16 @umax_i16(i16 zeroext %a, i16 zeroext %b) {
; ZBB: # %bb.0:
; ZBB-NEXT: maxu a0, a0, a1
; ZBB-NEXT: ret
+;
+; XQCI-LABEL: umax_i16:
+; XQCI: # %bb.0:
+; XQCI-NEXT: qc.mvgeu a0, a1, a0, a1
+; XQCI-NEXT: ret
+;
+; RV32I-SFB-LABEL: umax_i16:
+; RV32I-SFB: # %bb.0:
+; RV32I-SFB-NEXT: bltu a1, a0, .LBB9_2
+; RV32I-SFB-NEXT: # %bb.1:
+; RV32I-SFB-NEXT: mv a0, a1
+; RV32I-SFB-NEXT: .LBB9_2:
+; RV32I-SFB-NEXT: ret
+;
+; RV64I-SFB-LABEL: umax_i16:
+; RV64I-SFB: # %bb.0:
+; RV64I-SFB-NEXT: bltu a1, a0, .LBB9_2
+; RV64I-SFB-NEXT: # %bb.1:
+; RV64I-SFB-NEXT: mv a0, a1
+; RV64I-SFB-NEXT: .LBB9_2:
+; RV64I-SFB-NEXT: ret
%c = call i16 @llvm.umax.i16(i16 %a, i16 %b)
ret i16 %c
}
@@ -277,6 +521,27 @@ define signext i32 @umax_i32(i32 signext %a, i32 signext %b) {
; ZBB: # %bb.0:
; ZBB-NEXT: maxu a0, a0, a1
; ZBB-NEXT: ret
+;
+; XQCI-LABEL: umax_i32:
+; XQCI: # %bb.0:
+; XQCI-NEXT: qc.mvgeu a0, a1, a0, a1
+; XQCI-NEXT: ret
+;
+; RV32I-SFB-LABEL: umax_i32:
+; RV32I-SFB: # %bb.0:
+; RV32I-SFB-NEXT: bltu a1, a0, .LBB10_2
+; RV32I-SFB-NEXT: # %bb.1:
+; RV32I-SFB-NEXT: mv a0, a1
+; RV32I-SFB-NEXT: .LBB10_2:
+; RV32I-SFB-NEXT: ret
+;
+; RV64I-SFB-LABEL: umax_i32:
+; RV64I-SFB: # %bb.0:
+; RV64I-SFB-NEXT: bltu a1, a0, .LBB10_2
+; RV64I-SFB-NEXT: # %bb.1:
+; RV64I-SFB-NEXT: mv a0, a1
+; RV64I-SFB-NEXT: .LBB10_2:
+; RV64I-SFB-NEXT: ret
%c = call i32 @llvm.umax.i32(i32 %a, i32 %b)
ret i32 %c
}
@@ -328,6 +593,41 @@ define i64 @umax_i64(i64 %a, i64 %b) {
; RV64ZBB: # %bb.0:
; RV64ZBB-NEXT: maxu a0, a0, a1
; RV64ZBB-NEXT: ret
+;
+; XQCI-LABEL: umax_i64:
+; XQCI: # %bb.0:
+; XQCI-NEXT: sltu a4, a2, a0
+; XQCI-NEXT: sltu a5, a3, a1
+; XQCI-NEXT: qc.mveq a5, a1, a3, a4
+; XQCI-NEXT: qc.mveqi a0, a5, 0, a2
+; XQCI-NEXT: qc.mveqi a1, a5, 0, a3
+; XQCI-NEXT: ret
+;
+; RV32I-SFB-LABEL: umax_i64:
+; RV32I-SFB: # %bb.0:
+; RV32I-SFB-NEXT: sltu a4, a2, a0
+; RV32I-SFB-NEXT: sltu a5, a3, a1
+; RV32I-SFB-NEXT: bne a1, a3, .LBB11_2
+; RV32I-SFB-NEXT: # %bb.1:
+; RV32I-SFB-NEXT: mv a5, a4
+; RV32I-SFB-NEXT: .LBB11_2:
+; RV32I-SFB-NEXT: bnez a5, .LBB11_4
+; RV32I-SFB-NEXT: # %bb.3:
+; RV32I-SFB-NEXT: mv a0, a2
+; RV32I-SFB-NEXT: .LBB11_4:
+; RV32I-SFB-NEXT: bnez a5, .LBB11_6
+; RV32I-SFB-NEXT: # %bb.5:
+; RV32I-SFB-NEXT: mv a1, a3
+; RV32I-SFB-NEXT: .LBB11_6:
+; RV32I-SFB-NEXT: ret
+;
+; RV64I-SFB-LABEL: umax_i64:
+; RV64I-SFB: # %bb.0:
+; RV64I-SFB-NEXT: bltu a1, a0, .LBB11_2
+; RV64I-SFB-NEXT: # %bb.1:
+; RV64I-SFB-NEXT: mv a0, a1
+; RV64I-SFB-NEXT: .LBB11_2:
+; RV64I-SFB-NEXT: ret
%c = call i64 @llvm.umax.i64(i64 %a, i64 %b)
ret i64 %c
}
@@ -347,6 +647,27 @@ define zeroext i8 @umin_i8(i8 zeroext %a, i8 zeroext %b) {
; ZBB: # %bb.0:
; ZBB-NEXT: minu a0, a0, a1
; ZBB-NEXT: ret
+;
+; XQCI-LABEL: umin_i8:
+; XQCI: # %bb.0:
+; XQCI-NEXT: qc.mvgeu a0, a0, a1, a1
+; XQCI-NEXT: ret
+;
+; RV32I-SFB-LABEL: umin_i8:
+; RV32I-SFB: # %bb.0:
+; RV32I-SFB-NEXT: bltu a0, a1, .LBB12_2
+; RV32I-SFB-NEXT: # %bb.1:
+; RV32I-SFB-NEXT: mv a0, a1
+; RV32I-SFB-NEXT: .LBB12_2:
+; RV32I-SFB-NEXT: ret
+;
+; RV64I-SFB-LABEL: umin_i8:
+; RV64I-SFB: # %bb.0:
+; RV64I-SFB-NEXT: bltu a0, a1, .LBB12_2
+; RV64I-SFB-NEXT: # %bb.1:
+; RV64I-SFB-NEXT: mv a0, a1
+; RV64I-SFB-NEXT: .LBB12_2:
+; RV64I-SFB-NEXT: ret
%c = call i8 @llvm.umin.i8(i8 %a, i8 %b)
ret i8 %c
}
@@ -366,6 +687,27 @@ define zeroext i16 @umin_i16(i16 zeroext %a, i16 zeroext %b) {
; ZBB: # %bb.0:
; ZBB-NEXT: minu a0, a0, a1
; ZBB-NEXT: ret
+;
+; XQCI-LABEL: umin_i16:
+; XQCI: # %bb.0:
+; XQCI-NEXT: qc.mvgeu a0, a0, a1, a1
+; XQCI-NEXT: ret
+;
+; RV32I-SFB-LABEL: umin_i16:
+; RV32I-SFB: # %bb.0:
+; RV32I-SFB-NEXT: bltu a0, a1, .LBB13_2
+; RV32I-SFB-NEXT: # %bb.1:
+; RV32I-SFB-NEXT: mv a0, a1
+; RV32I-SFB-NEXT: .LBB13_2:
+; RV32I-SFB-NEXT: ret
+;
+; RV64I-SFB-LABEL: umin_i16:
+; RV64I-SFB: # %bb.0:
+; RV64I-SFB-NEXT: bltu a0, a1, .LBB13_2
+; RV64I-SFB-NEXT: # %bb.1:
+; RV64I-SFB-NEXT: mv a0, a1
+; RV64I-SFB-NEXT: .LBB13_2:
+; RV64I-SFB-NEXT: ret
%c = call i16 @llvm.umin.i16(i16 %a, i16 %b)
ret i16 %c
}
@@ -385,6 +727,27 @@ define signext i32 @umin_i32(i32 signext %a, i32 signext %b) {
; ZBB: # %bb.0:
; ZBB-NEXT: minu a0, a0, a1
; ZBB-NEXT: ret
+;
+; XQCI-LABEL: umin_i32:
+; XQCI: # %bb.0:
+; XQCI-NEXT: qc.mvgeu a0, a0, a1, a1
+; XQCI-NEXT: ret
+;
+; RV32I-SFB-LABEL: umin_i32:
+; RV32I-SFB: # %bb.0:
+; RV32I-SFB-NEXT: bltu a0, a1, .LBB14_2
+; RV32I-SFB-NEXT: # %bb.1:
+; RV32I-SFB-NEXT: mv a0, a1
+; RV32I-SFB-NEXT: .LBB14_2:
+; RV32I-SFB-NEXT: ret
+;
+; RV64I-SFB-LABEL: umin_i32:
+; RV64I-SFB: # %bb.0:
+; RV64I-SFB-NEXT: bltu a0, a1, .LBB14_2
+; RV64I-SFB-NEXT: # %bb.1:
+; RV64I-SFB-NEXT: mv a0, a1
+; RV64I-SFB-NEXT: .LBB14_2:
+; RV64I-SFB-NEXT: ret
%c = call i32 @llvm.umin.i32(i32 %a, i32 %b)
ret i32 %c
}
@@ -436,6 +799,41 @@ define i64 @umin_i64(i64 %a, i64 %b) {
; RV64ZBB: # %bb.0:
; RV64ZBB-NEXT: minu a0, a0, a1
; RV64ZBB-NEXT: ret
+;
+; XQCI-LABEL: umin_i64:
+; XQCI: # %bb.0:
+; XQCI-NEXT: sltu a4, a0, a2
+; XQCI-NEXT: sltu a5, a1, a3
+; XQCI-NEXT: qc.mveq a5, a1, a3, a4
+; XQCI-NEXT: qc.mveqi a0, a5, 0, a2
+; XQCI-NEXT: qc.mveqi a1, a5, 0, a3
+; XQCI-NEXT: ret
+;
+; RV32I-SFB-LABEL: umin_i64:
+; RV32I-SFB: # %bb.0:
+; RV32I-SFB-NEXT: sltu a4, a0, a2
+; RV32I-SFB-NEXT: sltu a5, a1, a3
+; RV32I-SFB-NEXT: bne a1, a3, .LBB15_2
+; RV32I-SFB-NEXT: # %bb.1:
+; RV32I-SFB-NEXT: mv a5, a4
+; RV32I-SFB-NEXT: .LBB15_2:
+; RV32I-SFB-NEXT: bnez a5, .LBB15_4
+; RV32I-SFB-NEXT: # %bb.3:
+; RV32I-SFB-NEXT: mv a0, a2
+; RV32I-SFB-NEXT: .LBB15_4:
+; RV32I-SFB-NEXT: bnez a5, .LBB15_6
+; RV32I-SFB-NEXT: # %bb.5:
+; RV32I-SFB-NEXT: mv a1, a3
+; RV32I-SFB-NEXT: .LBB15_6:
+; RV32I-SFB-NEXT: ret
+;
+; RV64I-SFB-LABEL: umin_i64:
+; RV64I-SFB: # %bb.0:
+; RV64I-SFB-NEXT: bltu a0, a1, .LBB15_2
+; RV64I-SFB-NEXT: # %bb.1:
+; RV64I-SFB-NEXT: mv a0, a1
+; RV64I-SFB-NEXT: .LBB15_2:
+; RV64I-SFB-NEXT: ret
%c = call i64 @llvm.umin.i64(i64 %a, i64 %b)
ret i64 %c
}
@@ -450,6 +848,18 @@ define signext i32 @smin_same_op_i32(i32 signext %a) {
; ZBB-LABEL: smin_same_op_i32:
; ZBB: # %bb.0:
; ZBB-NEXT: ret
+;
+; XQCI-LABEL: smin_same_op_i32:
+; XQCI: # %bb.0:
+; XQCI-NEXT: ret
+;
+; RV32I-SFB-LABEL: smin_same_op_i32:
+; RV32I-SFB: # %bb.0:
+; RV32I-SFB-NEXT: ret
+;
+; RV64I-SFB-LABEL: smin_same_op_i32:
+; RV64I-SFB: # %bb.0:
+; RV64I-SFB-NEXT: ret
%c = call i32 @llvm.smin.i32(i32 %a, i32 %a)
ret i32 %c
}
@@ -462,6 +872,18 @@ define signext i32 @smax_same_op_i32(i32 signext %a) {
; ZBB-LABEL: smax_same_op_i32:
; ZBB: # %bb.0:
; ZBB-NEXT: ret
+;
+; XQCI-LABEL: smax_same_op_i32:
+; XQCI: # %bb.0:
+; XQCI-NEXT: ret
+;
+; RV32I-SFB-LABEL: smax_same_op_i32:
+; RV32I-SFB: # %bb.0:
+; RV32I-SFB-NEXT: ret
+;
+; RV64I-SFB-LABEL: smax_same_op_i32:
+; RV64I-SFB: # %bb.0:
+; RV64I-SFB-NEXT: ret
%c = call i32 @llvm.smax.i32(i32 %a, i32 %a)
ret i32 %c
}
@@ -474,6 +896,18 @@ define signext i32 @umin_same_op_i32(i32 signext %a) {
; ZBB-LABEL: umin_same_op_i32:
; ZBB: # %bb.0:
; ZBB-NEXT: ret
+;
+; XQCI-LABEL: umin_same_op_i32:
+; XQCI: # %bb.0:
+; XQCI-NEXT: ret
+;
+; RV32I-SFB-LABEL: umin_same_op_i32:
+; RV32I-SFB: # %bb.0:
+; RV32I-SFB-NEXT: ret
+;
+; RV64I-SFB-LABEL: umin_same_op_i32:
+; RV64I-SFB: # %bb.0:
+; RV64I-SFB-NEXT: ret
%c = call i32 @llvm.umin.i32(i32 %a, i32 %a)
ret i32 %c
}
@@ -486,6 +920,18 @@ define signext i32 @umax_same_op_i32(i32 signext %a) {
; ZBB-LABEL: umax_same_op_i32:
; ZBB: # %bb.0:
; ZBB-NEXT: ret
+;
+; XQCI-LABEL: umax_same_op_i32:
+; XQCI: # %bb.0:
+; XQCI-NEXT: ret
+;
+; RV32I-SFB-LABEL: umax_same_op_i32:
+; RV32I-SFB: # %bb.0:
+; RV32I-SFB-NEXT: ret
+;
+; RV64I-SFB-LABEL: umax_same_op_i32:
+; RV64I-SFB: # %bb.0:
+; RV64I-SFB-NEXT: ret
%c = call i32 @llvm.umax.i32(i32 %a, i32 %a)
ret i32 %c
}
@@ -510,6 +956,19 @@ define signext i32 @smin_undef_i32() {
; RV64ZBB: # %bb.0:
; RV64ZBB-NEXT: li a0, 0
; RV64ZBB-NEXT: ret
+;
+; XQCI-LABEL: smin_undef_i32:
+; XQCI: # %bb.0:
+; XQCI-NEXT: ret
+;
+; RV32I-SFB-LABEL: smin_undef_i32:
+; RV32I-SFB: # %bb.0:
+; RV32I-SFB-NEXT: ret
+;
+; RV64I-SFB-LABEL: smin_undef_i32:
+; RV64I-SFB: # %bb.0:
+; RV64I-SFB-NEXT: li a0, 0
+; RV64I-SFB-NEXT: ret
%c = call i32 @llvm.smin.i32(i32 undef, i32 undef)
ret i32 %c
}
@@ -532,6 +991,19 @@ define signext i32 @smax_undef_i32() {
; RV64ZBB: # %bb.0:
; RV64ZBB-NEXT: li a0, 0
; RV64ZBB-NEXT: ret
+;
+; XQCI-LABEL: smax_undef_i32:
+; XQCI: # %bb.0:
+; XQCI-NEXT: ret
+;
+; RV32I-SFB-LABEL: smax_undef_i32:
+; RV32I-SFB: # %bb.0:
+; RV32I-SFB-NEXT: ret
+;
+; RV64I-SFB-LABEL: smax_undef_i32:
+; RV64I-SFB: # %bb.0:
+; RV64I-SFB-NEXT: li a0, 0
+; RV64I-SFB-NEXT: ret
%c = call i32 @llvm.smax.i32(i32 undef, i32 undef)
ret i32 %c
}
@@ -554,6 +1026,19 @@ define signext i32 @umin_undef_i32() {
; RV64ZBB: # %bb.0:
; RV64ZBB-NEXT: li a0, 0
; RV64ZBB-NEXT: ret
+;
+; XQCI-LABEL: umin_undef_i32:
+; XQCI: # %bb.0:
+; XQCI-NEXT: ret
+;
+; RV32I-SFB-LABEL: umin_undef_i32:
+; RV32I-SFB: # %bb.0:
+; RV32I-SFB-NEXT: ret
+;
+; RV64I-SFB-LABEL: umin_undef_i32:
+; RV64I-SFB: # %bb.0:
+; RV64I-SFB-NEXT: li a0, 0
+; RV64I-SFB-NEXT: ret
%c = call i32 @llvm.umin.i32(i32 undef, i32 undef)
ret i32 %c
}
@@ -576,6 +1061,19 @@ define signext i32 @umax_undef_i32() {
; RV64ZBB: # %bb.0:
; RV64ZBB-NEXT: li a0, 0
; RV64ZBB-NEXT: ret
+;
+; XQCI-LABEL: umax_undef_i32:
+; XQCI: # %bb.0:
+; XQCI-NEXT: ret
+;
+; RV32I-SFB-LABEL: umax_undef_i32:
+; RV32I-SFB: # %bb.0:
+; RV32I-SFB-NEXT: ret
+;
+; RV64I-SFB-LABEL: umax_undef_i32:
+; RV64I-SFB: # %bb.0:
+; RV64I-SFB-NEXT: li a0, 0
+; RV64I-SFB-NEXT: ret
%c = call i32 @llvm.umax.i32(i32 undef, i32 undef)
ret i32 %c
}
@@ -595,6 +1093,29 @@ define signext i32 @smax_i32_pos_constant(i32 signext %a) {
; ZBB-NEXT: li a1, 10
; ZBB-NEXT: max a0, a0, a1
; ZBB-NEXT: ret
+;
+; XQCI-LABEL: smax_i32_pos_constant:
+; XQCI: # %bb.0:
+; XQCI-NEXT: qc.lilti a0, a0, 11, 10
+; XQCI-NEXT: ret
+;
+; RV32I-SFB-LABEL: smax_i32_pos_constant:
+; RV32I-SFB: # %bb.0:
+; RV32I-SFB-NEXT: li a1, 10
+; RV32I-SFB-NEXT: blt a1, a0, .LBB24_2
+; RV32I-SFB-NEXT: # %bb.1:
+; RV32I-SFB-NEXT: mv a0, a1
+; RV32I-SFB-NEXT: .LBB24_2:
+; RV32I-SFB-NEXT: ret
+;
+; RV64I-SFB-LABEL: smax_i32_pos_constant:
+; RV64I-SFB: # %bb.0:
+; RV64I-SFB-NEXT: li a1, 10
+; RV64I-SFB-NEXT: blt a1, a0, .LBB24_2
+; RV64I-SFB-NEXT: # %bb.1:
+; RV64I-SFB-NEXT: mv a0, a1
+; RV64I-SFB-NEXT: .LBB24_2:
+; RV64I-SFB-NEXT: ret
%c = call i32 @llvm.smax.i32(i32 %a, i32 10)
ret i32 %c
}
@@ -616,6 +1137,33 @@ define signext i32 @smax_i32_pos_constant_trailing_zeros(i32 signext %a) {
; ZBB-NEXT: li a1, 16
; ZBB-NEXT: max a0, a0, a1
; ZBB-NEXT: ret
+;
+; XQCI-LABEL: smax_i32_pos_constant_trailing_zeros:
+; XQCI: # %bb.0:
+; XQCI-NEXT: andi a1, a0, -8
+; XQCI-NEXT: li a0, 16
+; XQCI-NEXT: qc.mvlt a0, a0, a1, a1
+; XQCI-NEXT: ret
+;
+; RV32I-SFB-LABEL: smax_i32_pos_constant_trailing_zeros:
+; RV32I-SFB: # %bb.0:
+; RV32I-SFB-NEXT: andi a1, a0, -8
+; RV32I-SFB-NEXT: li a0, 16
+; RV32I-SFB-NEXT: bge a0, a1, .LBB25_2
+; RV32I-SFB-NEXT: # %bb.1:
+; RV32I-SFB-NEXT: mv a0, a1
+; RV32I-SFB-NEXT: .LBB25_2:
+; RV32I-SFB-NEXT: ret
+;
+; RV64I-SFB-LABEL: smax_i32_pos_constant_trailing_zeros:
+; RV64I-SFB: # %bb.0:
+; RV64I-SFB-NEXT: andi a1, a0, -8
+; RV64I-SFB-NEXT: li a0, 16
+; RV64I-SFB-NEXT: bge a0, a1, .LBB25_2
+; RV64I-SFB-NEXT: # %bb.1:
+; RV64I-SFB-NEXT: mv a0, a1
+; RV64I-SFB-NEXT: .LBB25_2:
+; RV64I-SFB-NEXT: ret
%b = and i32 %a, -8
%c = call i32 @llvm.smax.i32(i32 %b, i32 16)
%d = and i32 %c, -4
@@ -635,6 +1183,29 @@ define signext i32 @smin_i32_negone(i32 signext %a) {
; ZBB-NEXT: li a1, -1
; ZBB-NEXT: min a0, a0, a1
; ZBB-NEXT: ret
+;
+; XQCI-LABEL: smin_i32_negone:
+; XQCI: # %bb.0:
+; XQCI-NEXT: qc.ligei a0, a0, 0, -1
+; XQCI-NEXT: ret
+;
+; RV32I-SFB-LABEL: smin_i32_negone:
+; RV32I-SFB: # %bb.0:
+; RV32I-SFB-NEXT: li a1, -1
+; RV32I-SFB-NEXT: bltz a0, .LBB26_2
+; RV32I-SFB-NEXT: # %bb.1:
+; RV32I-SFB-NEXT: mv a0, a1
+; RV32I-SFB-NEXT: .LBB26_2:
+; RV32I-SFB-NEXT: ret
+;
+; RV64I-SFB-LABEL: smin_i32_negone:
+; RV64I-SFB: # %bb.0:
+; RV64I-SFB-NEXT: li a1, -1
+; RV64I-SFB-NEXT: bltz a0, .LBB26_2
+; RV64I-SFB-NEXT: # %bb.1:
+; RV64I-SFB-NEXT: mv a0, a1
+; RV64I-SFB-NEXT: .LBB26_2:
+; RV64I-SFB-NEXT: ret
%c = call i32 @llvm.smin.i32(i32 %a, i32 -1)
ret i32 %c
}
@@ -672,6 +1243,34 @@ define i64 @smin_i64_negone(i64 %a) {
; RV64ZBB-NEXT: li a1, -1
; RV64ZBB-NEXT: min a0, a0, a1
; RV64ZBB-NEXT: ret
+;
+; XQCI-LABEL: smin_i64_negone:
+; XQCI: # %bb.0:
+; XQCI-NEXT: qc.ligei a0, a1, 0, -1
+; XQCI-NEXT: qc.ligei a1, a1, 0, -1
+; XQCI-NEXT: ret
+;
+; RV32I-SFB-LABEL: smin_i64_negone:
+; RV32I-SFB: # %bb.0:
+; RV32I-SFB-NEXT: li a2, -1
+; RV32I-SFB-NEXT: bltz a1, .LBB27_2
+; RV32I-SFB-NEXT: # %bb.1:
+; RV32I-SFB-NEXT: mv a0, a2
+; RV32I-SFB-NEXT: .LBB27_2:
+; RV32I-SFB-NEXT: bltz a1, .LBB27_4
+; RV32I-SFB-NEXT: # %bb.3:
+; RV32I-SFB-NEXT: mv a1, a2
+; RV32I-SFB-NEXT: .LBB27_4:
+; RV32I-SFB-NEXT: ret
+;
+; RV64I-SFB-LABEL: smin_i64_negone:
+; RV64I-SFB: # %bb.0:
+; RV64I-SFB-NEXT: li a1, -1
+; RV64I-SFB-NEXT: bltz a0, .LBB27_2
+; RV64I-SFB-NEXT: # %bb.1:
+; RV64I-SFB-NEXT: mv a0, a1
+; RV64I-SFB-NEXT: .LBB27_2:
+; RV64I-SFB-NEXT: ret
%c = call i64 @llvm.smin.i64(i64 %a, i64 -1)
ret i64 %c
}
@@ -720,6 +1319,41 @@ define i64 @umax_i64_one(i64 %a, i64 %b) {
; RV64ZBB-NEXT: li a1, 1
; RV64ZBB-NEXT: maxu a0, a0, a1
; RV64ZBB-NEXT: ret
+;
+; XQCI-LABEL: umax_i64_one:
+; XQCI: # %bb.0:
+; XQCI-NEXT: mv a2, a1
+; XQCI-NEXT: qc.selectinei a2, 0, a0, 1
+; XQCI-NEXT: qc.liltui a0, a0, 2, 1
+; XQCI-NEXT: qc.mvnei a0, a1, 0, a2
+; XQCI-NEXT: ret
+;
+; RV32I-SFB-LABEL: umax_i64_one:
+; RV32I-SFB: # %bb.0:
+; RV32I-SFB-NEXT: li a2, 1
+; RV32I-SFB-NEXT: li a3, 1
+; RV32I-SFB-NEXT: beqz a1, .LBB28_2
+; RV32I-SFB-NEXT: # %bb.1:
+; RV32I-SFB-NEXT: mv a3, a0
+; RV32I-SFB-NEXT: .LBB28_2:
+; RV32I-SFB-NEXT: bnez a0, .LBB28_4
+; RV32I-SFB-NEXT: # %bb.3:
+; RV32I-SFB-NEXT: mv a0, a2
+; RV32I-SFB-NEXT: .LBB28_4:
+; RV32I-SFB-NEXT: beqz a1, .LBB28_6
+; RV32I-SFB-NEXT: # %bb.5:
+; RV32I-SFB-NEXT: mv a0, a3
+; RV32I-SFB-NEXT: .LBB28_6:
+; RV32I-SFB-NEXT: ret
+;
+; RV64I-SFB-LABEL: umax_i64_one:
+; RV64I-SFB: # %bb.0:
+; RV64I-SFB-NEXT: li a1, 1
+; RV64I-SFB-NEXT: bnez a0, .LBB28_2
+; RV64I-SFB-NEXT: # %bb.1:
+; RV64I-SFB-NEXT: mv a0, a1
+; RV64I-SFB-NEXT: .LBB28_2:
+; RV64I-SFB-NEXT: ret
%c = call i64 @llvm.umax.i64(i64 %a, i64 1)
ret i64 %c
}
diff --git a/llvm/test/CodeGen/RISCV/rvv/sifive-O0-ATM-ATK.ll b/llvm/test/CodeGen/RISCV/rvv/sifive-O0-ATM-ATK.ll
new file mode 100644
index 0000000..d9a49a1
--- /dev/null
+++ b/llvm/test/CodeGen/RISCV/rvv/sifive-O0-ATM-ATK.ll
@@ -0,0 +1,18 @@
+; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
+; RUN: llc -mtriple=riscv64 -mattr=+v -O0 -verify-machineinstrs < %s | FileCheck %s --check-prefixes=CHECK-RV64
+
+define void @matmul() {
+; CHECK-RV64-LABEL: matmul:
+; CHECK-RV64: # %bb.0: # %entry
+; CHECK-RV64-NEXT: li a0, 0
+; CHECK-RV64-NEXT: vsetvli zero, a0, 512
+; CHECK-RV64-NEXT: sf.vsettm zero, a0
+; CHECK-RV64-NEXT: sf.vtzero.t mt0
+; CHECK-RV64-NEXT: ret
+entry:
+ call void @llvm.riscv.sf.vtzero.t.i64(i64 0, i64 0, i64 0, i64 3, i64 1)
+ ret void
+}
+
+; Function Attrs: nocallback nofree nosync nounwind willreturn
+declare void @llvm.riscv.sf.vtzero.t.i64(i64 immarg, i64, i64, i64 immarg, i64 immarg) #0
diff --git a/llvm/test/CodeGen/RISCV/rvv/sifive_sf_mm_e4m3_e4m3.ll b/llvm/test/CodeGen/RISCV/rvv/sifive_sf_mm_e4m3_e4m3.ll
new file mode 100644
index 0000000..9b9a849
--- /dev/null
+++ b/llvm/test/CodeGen/RISCV/rvv/sifive_sf_mm_e4m3_e4m3.ll
@@ -0,0 +1,20 @@
+; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
+; RUN: sed 's/iXLen/i32/g' %s | llc -mtriple=riscv32 -mattr=+xsfmm32a8f \
+; RUN: -verify-machineinstrs | FileCheck %s --check-prefixes=CHECK
+; RUN: sed 's/iXLen/i64/g' %s | llc -mtriple=riscv64 -mattr=+xsfmm32a8f \
+; RUN: -verify-machineinstrs | FileCheck %s --check-prefixes=CHECK
+
+declare void @llvm.riscv.sf.mm.e4m3.e4m3.iXLen.nxv64i8(iXLen, <vscale x 64 x i8>, <vscale x 64 x i8>, iXLen, iXLen, iXLen, iXLen)
+
+define void @test_sf_mm_e4m3_e4m3_w4_u8m8_u8m8(iXLen %mtd, <vscale x 64 x i8> %v1, <vscale x 64 x i8> %v2, iXLen %tm, iXLen %tn, iXLen %tk) {
+; CHECK-LABEL: test_sf_mm_e4m3_e4m3_w4_u8m8_u8m8:
+; CHECK: # %bb.0: # %entry
+; CHECK-NEXT: sf.vsettnt zero, a2, e8, w4
+; CHECK-NEXT: sf.vsettm zero, a1
+; CHECK-NEXT: sf.vsettk zero, a3
+; CHECK-NEXT: sf.mm.e4m3.e4m3 mt0, v8, v16
+; CHECK-NEXT: ret
+ entry:
+ call void @llvm.riscv.sf.mm.e4m3.e4m3.iXLen.nxv64i8(iXLen 0, <vscale x 64 x i8> %v1, <vscale x 64 x i8> %v2, iXLen %tm, iXLen %tn, iXLen %tk, iXLen 4)
+ ret void
+}
diff --git a/llvm/test/CodeGen/RISCV/rvv/sifive_sf_mm_e4m3_e5m2.ll b/llvm/test/CodeGen/RISCV/rvv/sifive_sf_mm_e4m3_e5m2.ll
new file mode 100644
index 0000000..b63974f
--- /dev/null
+++ b/llvm/test/CodeGen/RISCV/rvv/sifive_sf_mm_e4m3_e5m2.ll
@@ -0,0 +1,20 @@
+; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
+; RUN: sed 's/iXLen/i32/g' %s | llc -mtriple=riscv32 -mattr=+xsfmm32a8f \
+; RUN: -verify-machineinstrs | FileCheck %s --check-prefixes=CHECK
+; RUN: sed 's/iXLen/i64/g' %s | llc -mtriple=riscv64 -mattr=+xsfmm32a8f \
+; RUN: -verify-machineinstrs | FileCheck %s --check-prefixes=CHECK
+
+declare void @llvm.riscv.sf.mm.e4m3.e5m2.iXLen.nxv64i8(iXLen, <vscale x 64 x i8>, <vscale x 64 x i8>, iXLen, iXLen, iXLen, iXLen)
+
+define void @test_sf_mm_e4m3_e5m2_w4_u8m8_u8m8(iXLen %mtd, <vscale x 64 x i8> %v1, <vscale x 64 x i8> %v2, iXLen %tm, iXLen %tn, iXLen %tk) {
+; CHECK-LABEL: test_sf_mm_e4m3_e5m2_w4_u8m8_u8m8:
+; CHECK: # %bb.0: # %entry
+; CHECK-NEXT: sf.vsettnt zero, a2, e8, w4
+; CHECK-NEXT: sf.vsettm zero, a1
+; CHECK-NEXT: sf.vsettk zero, a3
+; CHECK-NEXT: sf.mm.e4m3.e5m2 mt0, v8, v16
+; CHECK-NEXT: ret
+ entry:
+ call void @llvm.riscv.sf.mm.e4m3.e5m2.iXLen.nxv64i8(iXLen 0, <vscale x 64 x i8> %v1, <vscale x 64 x i8> %v2, iXLen %tm, iXLen %tn, iXLen %tk, iXLen 4)
+ ret void
+}
diff --git a/llvm/test/CodeGen/RISCV/rvv/sifive_sf_mm_e5m2_e4m3.ll b/llvm/test/CodeGen/RISCV/rvv/sifive_sf_mm_e5m2_e4m3.ll
new file mode 100644
index 0000000..62d629b1
--- /dev/null
+++ b/llvm/test/CodeGen/RISCV/rvv/sifive_sf_mm_e5m2_e4m3.ll
@@ -0,0 +1,20 @@
+; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
+; RUN: sed 's/iXLen/i32/g' %s | llc -mtriple=riscv32 -mattr=+xsfmm32a8f \
+; RUN: -verify-machineinstrs | FileCheck %s --check-prefixes=CHECK
+; RUN: sed 's/iXLen/i64/g' %s | llc -mtriple=riscv64 -mattr=+xsfmm32a8f \
+; RUN: -verify-machineinstrs | FileCheck %s --check-prefixes=CHECK
+
+declare void @llvm.riscv.sf.mm.e5m2.e4m3.iXLen.nxv64i8(iXLen, <vscale x 64 x i8>, <vscale x 64 x i8>, iXLen, iXLen, iXLen, iXLen)
+
+define void @test_sf_mm_e5m2_e5m2_w4_u8m8_u8m8(iXLen %mtd, <vscale x 64 x i8> %v1, <vscale x 64 x i8> %v2, iXLen %tm, iXLen %tn, iXLen %tk) {
+; CHECK-LABEL: test_sf_mm_e5m2_e5m2_w4_u8m8_u8m8:
+; CHECK: # %bb.0: # %entry
+; CHECK-NEXT: sf.vsettnt zero, a2, e8, w4
+; CHECK-NEXT: sf.vsettm zero, a1
+; CHECK-NEXT: sf.vsettk zero, a3
+; CHECK-NEXT: sf.mm.e5m2.e4m3 mt0, v8, v16
+; CHECK-NEXT: ret
+ entry:
+ call void @llvm.riscv.sf.mm.e5m2.e4m3.iXLen.nxv64i8(iXLen 0, <vscale x 64 x i8> %v1, <vscale x 64 x i8> %v2, iXLen %tm, iXLen %tn, iXLen %tk, iXLen 4)
+ ret void
+}
diff --git a/llvm/test/CodeGen/RISCV/rvv/sifive_sf_mm_e5m2_e5m2.ll b/llvm/test/CodeGen/RISCV/rvv/sifive_sf_mm_e5m2_e5m2.ll
new file mode 100644
index 0000000..7a90c97
--- /dev/null
+++ b/llvm/test/CodeGen/RISCV/rvv/sifive_sf_mm_e5m2_e5m2.ll
@@ -0,0 +1,20 @@
+; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
+; RUN: sed 's/iXLen/i32/g' %s | llc -mtriple=riscv32 -mattr=+xsfmm32a8f \
+; RUN: -verify-machineinstrs | FileCheck %s --check-prefixes=CHECK
+; RUN: sed 's/iXLen/i64/g' %s | llc -mtriple=riscv64 -mattr=+xsfmm32a8f \
+; RUN: -verify-machineinstrs | FileCheck %s --check-prefixes=CHECK
+
+declare void @llvm.riscv.sf.mm.e5m2.e5m2.iXLen.nxv64i8(iXLen, <vscale x 64 x i8>, <vscale x 64 x i8>, iXLen, iXLen, iXLen, iXLen)
+
+define void @test_sf_mm_e4m3_e5m2_w4_u8m8_u8m8(iXLen %mtd, <vscale x 64 x i8> %v1, <vscale x 64 x i8> %v2, iXLen %tm, iXLen %tn, iXLen %tk) {
+; CHECK-LABEL: test_sf_mm_e4m3_e5m2_w4_u8m8_u8m8:
+; CHECK: # %bb.0: # %entry
+; CHECK-NEXT: sf.vsettnt zero, a2, e8, w4
+; CHECK-NEXT: sf.vsettm zero, a1
+; CHECK-NEXT: sf.vsettk zero, a3
+; CHECK-NEXT: sf.mm.e5m2.e5m2 mt0, v8, v16
+; CHECK-NEXT: ret
+ entry:
+ call void @llvm.riscv.sf.mm.e5m2.e5m2.iXLen.nxv64i8(iXLen 0, <vscale x 64 x i8> %v1, <vscale x 64 x i8> %v2, iXLen %tm, iXLen %tn, iXLen %tk, iXLen 4)
+ ret void
+}
diff --git a/llvm/test/CodeGen/RISCV/rvv/sifive_sf_mm_f_f.ll b/llvm/test/CodeGen/RISCV/rvv/sifive_sf_mm_f_f.ll
new file mode 100644
index 0000000..29451c6
--- /dev/null
+++ b/llvm/test/CodeGen/RISCV/rvv/sifive_sf_mm_f_f.ll
@@ -0,0 +1,52 @@
+; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
+; RUN: sed 's/iXLen/i32/g' %s | llc -mtriple=riscv32 -mattr=+v \
+; RUN: -mattr=+zvfh -mattr=+xsfmm32a32f -mattr=+xsfmm64a64f \
+; RUN: -verify-machineinstrs | FileCheck %s --check-prefixes=CHECK
+; RUN: sed 's/iXLen/i64/g' %s | llc -mtriple=riscv64 -mattr=+v \
+; RUN: -mattr=+zvfh -mattr=+xsfmm32a32f -mattr=+xsfmm64a64f \
+; RUN: -verify-machineinstrs | FileCheck %s --check-prefixes=CHECK
+
+declare void @llvm.riscv.sf.mm.f.f.iXLen.nxv32f16(iXLen, <vscale x 32 x half>, <vscale x 32 x half>, iXLen, iXLen, iXLen, iXLen)
+
+define void @test_sf_mm_f_f_w2_f16m8(iXLen %mtd, <vscale x 32 x half> %v1, <vscale x 32 x half> %v2, iXLen %tm, iXLen %tn, iXLen %tk) {
+; CHECK-LABEL: test_sf_mm_f_f_w2_f16m8:
+; CHECK: # %bb.0: # %entry
+; CHECK-NEXT: sf.vsettnt zero, a2, e16, w2
+; CHECK-NEXT: sf.vsettm zero, a1
+; CHECK-NEXT: sf.vsettk zero, a3
+; CHECK-NEXT: sf.mm.f.f mt0, v8, v16
+; CHECK-NEXT: ret
+ entry:
+ call void @llvm.riscv.sf.mm.f.f.iXLen.nxv32f16(iXLen 0, <vscale x 32 x half> %v1, <vscale x 32 x half> %v2, iXLen %tm, iXLen %tn, iXLen %tk, iXLen 2)
+ ret void
+}
+
+declare void @llvm.riscv.sf.mm.f.f.iXLen.nxv16f32(iXLen, <vscale x 16 x float>, <vscale x 16 x float>, iXLen, iXLen, iXLen, iXLen)
+
+define void @test_sf_mm_f_f_w1_f32m8(iXLen %mtd, <vscale x 16 x float> %v1, <vscale x 16 x float> %v2, iXLen %tm, iXLen %tn, iXLen %tk) {
+; CHECK-LABEL: test_sf_mm_f_f_w1_f32m8:
+; CHECK: # %bb.0: # %entry
+; CHECK-NEXT: sf.vsettnt zero, a2, e32, w1
+; CHECK-NEXT: sf.vsettm zero, a1
+; CHECK-NEXT: sf.vsettk zero, a3
+; CHECK-NEXT: sf.mm.f.f mt0, v8, v16
+; CHECK-NEXT: ret
+ entry:
+ call void @llvm.riscv.sf.mm.f.f.iXLen.nxv16f32(iXLen 0, <vscale x 16 x float> %v1, <vscale x 16 x float> %v2, iXLen %tm, iXLen %tn, iXLen %tk, iXLen 1)
+ ret void
+}
+
+declare void @llvm.riscv.sf.mm.f.f.iXLen.nxv8f64(iXLen, <vscale x 8 x double>, <vscale x 8 x double>, iXLen, iXLen, iXLen, iXLen)
+
+define void @test_sf_mm_f_f_w1_f64m8(iXLen %mtd, <vscale x 8 x double> %v1, <vscale x 8 x double> %v2, iXLen %tm, iXLen %tn, iXLen %tk) {
+; CHECK-LABEL: test_sf_mm_f_f_w1_f64m8:
+; CHECK: # %bb.0: # %entry
+; CHECK-NEXT: sf.vsettnt zero, a2, e64, w1
+; CHECK-NEXT: sf.vsettm zero, a1
+; CHECK-NEXT: sf.vsettk zero, a3
+; CHECK-NEXT: sf.mm.f.f mt0, v8, v16
+; CHECK-NEXT: ret
+ entry:
+ call void @llvm.riscv.sf.mm.f.f.iXLen.nxv8f64(iXLen 0, <vscale x 8 x double> %v1, <vscale x 8 x double> %v2, iXLen %tm, iXLen %tn, iXLen %tk, iXLen 1)
+ ret void
+}
diff --git a/llvm/test/CodeGen/RISCV/rvv/sifive_sf_mm_s_s.ll b/llvm/test/CodeGen/RISCV/rvv/sifive_sf_mm_s_s.ll
new file mode 100644
index 0000000..6a4b29f
--- /dev/null
+++ b/llvm/test/CodeGen/RISCV/rvv/sifive_sf_mm_s_s.ll
@@ -0,0 +1,20 @@
+; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 4
+; RUN: sed 's/iXLen/i32/g' %s | llc -mtriple=riscv32 -mattr=+xsfmm32a8i \
+; RUN: -verify-machineinstrs | FileCheck %s --check-prefixes=CHECK
+; RUN: sed 's/iXLen/i64/g' %s | llc -mtriple=riscv64 -mattr=+xsfmm32a8i \
+; RUN: -verify-machineinstrs | FileCheck %s --check-prefixes=CHECK
+
+declare void @llvm.riscv.sf.mm.s.s.iXLen.nxv64i8.nxv64i8(iXLen, <vscale x 64 x i8>, <vscale x 64 x i8>, iXLen, iXLen, iXLen, iXLen)
+
+define void @test_sf_mm_s_s_w4_i8m8_i8m8(iXLen %mtd, <vscale x 64 x i8> %v1, <vscale x 64 x i8> %v2, iXLen %tm, iXLen %tn, iXLen %tk) {
+; CHECK-LABEL: test_sf_mm_s_s_w4_i8m8_i8m8:
+; CHECK: # %bb.0: # %entry
+; CHECK-NEXT: sf.vsettnt zero, a2, e8, w4
+; CHECK-NEXT: sf.vsettm zero, a1
+; CHECK-NEXT: sf.vsettk zero, a3
+; CHECK-NEXT: sf.mm.s.s mt0, v8, v16
+; CHECK-NEXT: ret
+ entry:
+ call void @llvm.riscv.sf.mm.s.s.iXLen.nxv64i8.nxv64i8(iXLen 0, <vscale x 64 x i8> %v1, <vscale x 64 x i8> %v2, iXLen %tm, iXLen %tn, iXLen %tk, iXLen 4)
+ ret void
+}
diff --git a/llvm/test/CodeGen/RISCV/rvv/sifive_sf_mm_s_u.ll b/llvm/test/CodeGen/RISCV/rvv/sifive_sf_mm_s_u.ll
new file mode 100644
index 0000000..79239b0
--- /dev/null
+++ b/llvm/test/CodeGen/RISCV/rvv/sifive_sf_mm_s_u.ll
@@ -0,0 +1,20 @@
+; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 4
+; RUN: sed 's/iXLen/i32/g' %s | llc -mtriple=riscv32 -mattr=+xsfmm32a8i \
+; RUN: -verify-machineinstrs | FileCheck %s --check-prefixes=CHECK
+; RUN: sed 's/iXLen/i64/g' %s | llc -mtriple=riscv64 -mattr=+xsfmm32a8i \
+; RUN: -verify-machineinstrs | FileCheck %s --check-prefixes=CHECK
+
+declare void @llvm.riscv.sf.mm.s.u.iXLen.nxv64i8.nxv64i8(iXLen, <vscale x 64 x i8>, <vscale x 64 x i8>, iXLen, iXLen, iXLen, iXLen)
+
+define void @test_sf_mm_s_u_w4_i8m8_i8m8(iXLen %mtd, <vscale x 64 x i8> %v1, <vscale x 64 x i8> %v2, iXLen %tm, iXLen %tn, iXLen %tk) {
+; CHECK-LABEL: test_sf_mm_s_u_w4_i8m8_i8m8:
+; CHECK: # %bb.0: # %entry
+; CHECK-NEXT: sf.vsettnt zero, a2, e8, w4
+; CHECK-NEXT: sf.vsettm zero, a1
+; CHECK-NEXT: sf.vsettk zero, a3
+; CHECK-NEXT: sf.mm.s.u mt0, v8, v16
+; CHECK-NEXT: ret
+ entry:
+ call void @llvm.riscv.sf.mm.s.u.iXLen.nxv64i8.nxv64i8(iXLen 0, <vscale x 64 x i8> %v1, <vscale x 64 x i8> %v2, iXLen %tm, iXLen %tn, iXLen %tk, iXLen 4)
+ ret void
+}
diff --git a/llvm/test/CodeGen/RISCV/rvv/sifive_sf_mm_u_s.ll b/llvm/test/CodeGen/RISCV/rvv/sifive_sf_mm_u_s.ll
new file mode 100644
index 0000000..b0d039b
--- /dev/null
+++ b/llvm/test/CodeGen/RISCV/rvv/sifive_sf_mm_u_s.ll
@@ -0,0 +1,20 @@
+; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 4
+; RUN: sed 's/iXLen/i32/g' %s | llc -mtriple=riscv32 -mattr=+xsfmm32a8i \
+; RUN: -verify-machineinstrs | FileCheck %s --check-prefixes=CHECK
+; RUN: sed 's/iXLen/i64/g' %s | llc -mtriple=riscv64 -mattr=+xsfmm32a8i \
+; RUN: -verify-machineinstrs | FileCheck %s --check-prefixes=CHECK
+
+declare void @llvm.riscv.sf.mm.u.s.iXLen.nxv64i8.nxv64i8(iXLen, <vscale x 64 x i8>, <vscale x 64 x i8>, iXLen, iXLen, iXLen, iXLen)
+
+define void @test_sf_mm_u_s_w4_i8m8_i8m8(iXLen %mtd, <vscale x 64 x i8> %v1, <vscale x 64 x i8> %v2, iXLen %tm, iXLen %tn, iXLen %tk) {
+; CHECK-LABEL: test_sf_mm_u_s_w4_i8m8_i8m8:
+; CHECK: # %bb.0: # %entry
+; CHECK-NEXT: sf.vsettnt zero, a2, e8, w4
+; CHECK-NEXT: sf.vsettm zero, a1
+; CHECK-NEXT: sf.vsettk zero, a3
+; CHECK-NEXT: sf.mm.u.s mt0, v8, v16
+; CHECK-NEXT: ret
+ entry:
+ call void @llvm.riscv.sf.mm.u.s.iXLen.nxv64i8.nxv64i8(iXLen 0, <vscale x 64 x i8> %v1, <vscale x 64 x i8> %v2, iXLen %tm, iXLen %tn, iXLen %tk, iXLen 4)
+ ret void
+}
diff --git a/llvm/test/CodeGen/RISCV/rvv/sifive_sf_mm_u_u.ll b/llvm/test/CodeGen/RISCV/rvv/sifive_sf_mm_u_u.ll
new file mode 100644
index 0000000..913c277
--- /dev/null
+++ b/llvm/test/CodeGen/RISCV/rvv/sifive_sf_mm_u_u.ll
@@ -0,0 +1,20 @@
+; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 4
+; RUN: sed 's/iXLen/i32/g' %s | llc -mtriple=riscv32 -mattr=+xsfmm32a8i \
+; RUN: -verify-machineinstrs | FileCheck %s --check-prefixes=CHECK
+; RUN: sed 's/iXLen/i64/g' %s | llc -mtriple=riscv64 -mattr=+xsfmm32a8i \
+; RUN: -verify-machineinstrs | FileCheck %s --check-prefixes=CHECK
+
+declare void @llvm.riscv.sf.mm.u.u.iXLen.nxv64i8.nxv64i8(iXLen, <vscale x 64 x i8>, <vscale x 64 x i8>, iXLen, iXLen, iXLen, iXLen)
+
+define void @test_sf_mm_u_u_w4_i8m8_i8m8(iXLen %mtd, <vscale x 64 x i8> %v1, <vscale x 64 x i8> %v2, iXLen %tm, iXLen %tn, iXLen %tk) {
+; CHECK-LABEL: test_sf_mm_u_u_w4_i8m8_i8m8:
+; CHECK: # %bb.0: # %entry
+; CHECK-NEXT: sf.vsettnt zero, a2, e8, w4
+; CHECK-NEXT: sf.vsettm zero, a1
+; CHECK-NEXT: sf.vsettk zero, a3
+; CHECK-NEXT: sf.mm.u.u mt0, v8, v16
+; CHECK-NEXT: ret
+ entry:
+ call void @llvm.riscv.sf.mm.u.u.iXLen.nxv64i8.nxv64i8(iXLen 0, <vscale x 64 x i8> %v1, <vscale x 64 x i8> %v2, iXLen %tm, iXLen %tn, iXLen %tk, iXLen 4)
+ ret void
+}
diff --git a/llvm/test/CodeGen/RISCV/rvv/sifive_sf_vlte16.ll b/llvm/test/CodeGen/RISCV/rvv/sifive_sf_vlte16.ll
new file mode 100644
index 0000000..8048dec
--- /dev/null
+++ b/llvm/test/CodeGen/RISCV/rvv/sifive_sf_vlte16.ll
@@ -0,0 +1,23 @@
+; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 4
+; RUN: sed 's/iXLen/i32/g' %s | llc -mtriple=riscv32 -mattr=+v \
+; RUN: -mattr=+zvfh -mattr=+experimental-zvfbfmin -mattr=+xsfmmbase \
+; RUN: -mattr=+xsfmm32a -mattr=+xsfmm32a8f -mattr=+xsfmm32a4i -mattr=+xsfmm64a64f \
+; RUN: -verify-machineinstrs | FileCheck %s --check-prefixes=CHECK
+; RUN: sed 's/iXLen/i64/g' %s | llc -mtriple=riscv64 -mattr=+v \
+; RUN: -mattr=+zvfh -mattr=+experimental-zvfbfmin -mattr=+xsfmmbase \
+; RUN: -mattr=+experimental-zvfbfmin -mattr=+xsfmmbase \
+; RUN: -mattr=+xsfmm32a -mattr=+xsfmm32a8f -mattr=+xsfmm32a4i -mattr=+xsfmm64a64f \
+; RUN: -verify-machineinstrs | FileCheck %s --check-prefixes=CHECK
+
+declare void @llvm.riscv.sf.vlte16.iXLen(iXLen, ptr, iXLen)
+
+define dso_local void @test_sf_vlte16(iXLen %tss, ptr %base, iXLen %vl) {
+; CHECK-LABEL: test_sf_vlte16:
+; CHECK: # %bb.0: # %entry
+; CHECK-NEXT: sf.vsettnt zero, a2, e16, w1
+; CHECK-NEXT: sf.vlte16 a0, (a1)
+; CHECK-NEXT: ret
+ entry:
+ call void @llvm.riscv.sf.vlte16.iXLen(iXLen %tss, ptr %base, iXLen %vl)
+ ret void
+}
diff --git a/llvm/test/CodeGen/RISCV/rvv/sifive_sf_vlte32.ll b/llvm/test/CodeGen/RISCV/rvv/sifive_sf_vlte32.ll
new file mode 100644
index 0000000..a526dc8
--- /dev/null
+++ b/llvm/test/CodeGen/RISCV/rvv/sifive_sf_vlte32.ll
@@ -0,0 +1,23 @@
+; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 4
+; RUN: sed 's/iXLen/i32/g' %s | llc -mtriple=riscv32 -mattr=+v \
+; RUN: -mattr=+zvfh -mattr=+experimental-zvfbfmin -mattr=+xsfmmbase \
+; RUN: -mattr=+xsfmm32a -mattr=+xsfmm32a8f -mattr=+xsfmm32a4i -mattr=+xsfmm64a64f \
+; RUN: -verify-machineinstrs | FileCheck %s --check-prefixes=CHECK
+; RUN: sed 's/iXLen/i64/g' %s | llc -mtriple=riscv64 -mattr=+v \
+; RUN: -mattr=+zvfh -mattr=+experimental-zvfbfmin -mattr=+xsfmmbase \
+; RUN: -mattr=+experimental-zvfbfmin -mattr=+xsfmmbase \
+; RUN: -mattr=+xsfmm32a -mattr=+xsfmm32a8f -mattr=+xsfmm32a4i -mattr=+xsfmm64a64f \
+; RUN: -verify-machineinstrs | FileCheck %s --check-prefixes=CHECK
+
+declare void @llvm.riscv.sf.vlte32.iXLen(iXLen, ptr, iXLen)
+
+define dso_local void @test_sf_vlte32(iXLen %tss, ptr %base, iXLen %vl) {
+; CHECK-LABEL: test_sf_vlte32:
+; CHECK: # %bb.0: # %entry
+; CHECK-NEXT: sf.vsettnt zero, a2, e32, w1
+; CHECK-NEXT: sf.vlte32 a0, (a1)
+; CHECK-NEXT: ret
+ entry:
+ call void @llvm.riscv.sf.vlte32.iXLen(iXLen %tss, ptr %base, iXLen %vl)
+ ret void
+}
diff --git a/llvm/test/CodeGen/RISCV/rvv/sifive_sf_vlte64.ll b/llvm/test/CodeGen/RISCV/rvv/sifive_sf_vlte64.ll
new file mode 100644
index 0000000..ed0c48a
--- /dev/null
+++ b/llvm/test/CodeGen/RISCV/rvv/sifive_sf_vlte64.ll
@@ -0,0 +1,23 @@
+; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 4
+; RUN: sed 's/iXLen/i32/g' %s | llc -mtriple=riscv32 -mattr=+v \
+; RUN: -mattr=+zvfh -mattr=+experimental-zvfbfmin -mattr=+xsfmmbase \
+; RUN: -mattr=+xsfmm32a -mattr=+xsfmm32a8f -mattr=+xsfmm32a4i -mattr=+xsfmm64a64f \
+; RUN: -verify-machineinstrs | FileCheck %s --check-prefixes=CHECK
+; RUN: sed 's/iXLen/i64/g' %s | llc -mtriple=riscv64 -mattr=+v \
+; RUN: -mattr=+zvfh -mattr=+experimental-zvfbfmin -mattr=+xsfmmbase \
+; RUN: -mattr=+experimental-zvfbfmin -mattr=+xsfmmbase \
+; RUN: -mattr=+xsfmm32a -mattr=+xsfmm32a8f -mattr=+xsfmm32a4i -mattr=+xsfmm64a64f \
+; RUN: -verify-machineinstrs | FileCheck %s --check-prefixes=CHECK
+
+declare void @llvm.riscv.sf.vlte64.iXLen(iXLen, ptr, iXLen)
+
+define dso_local void @test_sf_vlte64(iXLen %tss, ptr %base, iXLen %vl) {
+; CHECK-LABEL: test_sf_vlte64:
+; CHECK: # %bb.0: # %entry
+; CHECK-NEXT: sf.vsettnt zero, a2, e64, w1
+; CHECK-NEXT: sf.vlte64 a0, (a1)
+; CHECK-NEXT: ret
+ entry:
+ call void @llvm.riscv.sf.vlte64.iXLen(iXLen %tss, ptr %base, iXLen %vl)
+ ret void
+}
diff --git a/llvm/test/CodeGen/RISCV/rvv/sifive_sf_vlte8.ll b/llvm/test/CodeGen/RISCV/rvv/sifive_sf_vlte8.ll
new file mode 100644
index 0000000..67b3ed2
--- /dev/null
+++ b/llvm/test/CodeGen/RISCV/rvv/sifive_sf_vlte8.ll
@@ -0,0 +1,23 @@
+; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 4
+; RUN: sed 's/iXLen/i32/g' %s | llc -mtriple=riscv32 -mattr=+v \
+; RUN: -mattr=+zvfh -mattr=+experimental-zvfbfmin -mattr=+xsfmmbase \
+; RUN: -mattr=+xsfmm32a -mattr=+xsfmm32a8f -mattr=+xsfmm32a4i -mattr=+xsfmm64a64f \
+; RUN: -verify-machineinstrs | FileCheck %s --check-prefixes=CHECK
+; RUN: sed 's/iXLen/i64/g' %s | llc -mtriple=riscv64 -mattr=+v \
+; RUN: -mattr=+zvfh -mattr=+experimental-zvfbfmin -mattr=+xsfmmbase \
+; RUN: -mattr=+experimental-zvfbfmin -mattr=+xsfmmbase \
+; RUN: -mattr=+xsfmm32a -mattr=+xsfmm32a8f -mattr=+xsfmm32a4i -mattr=+xsfmm64a64f \
+; RUN: -verify-machineinstrs | FileCheck %s --check-prefixes=CHECK
+
+declare void @llvm.riscv.sf.vlte8.iXLen(iXLen, ptr, iXLen)
+
+define dso_local void @test_sf_vlte8(iXLen %tss, ptr %base, iXLen %vl) {
+; CHECK-LABEL: test_sf_vlte8:
+; CHECK: # %bb.0: # %entry
+; CHECK-NEXT: sf.vsettnt zero, a2, e8, w1
+; CHECK-NEXT: sf.vlte8 a0, (a1)
+; CHECK-NEXT: ret
+ entry:
+ call void @llvm.riscv.sf.vlte8.iXLen(iXLen %tss, ptr %base, iXLen %vl)
+ ret void
+}
diff --git a/llvm/test/CodeGen/RISCV/rvv/sifive_sf_vsettk.ll b/llvm/test/CodeGen/RISCV/rvv/sifive_sf_vsettk.ll
new file mode 100644
index 0000000..4da37fa
--- /dev/null
+++ b/llvm/test/CodeGen/RISCV/rvv/sifive_sf_vsettk.ll
@@ -0,0 +1,23 @@
+; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 4
+; RUN: sed 's/iXLen/i32/g' %s | llc -mtriple=riscv32 -mattr=+v \
+; RUN: -mattr=+zvfh -mattr=+experimental-zvfbfmin -mattr=+xsfmmbase \
+; RUN: -mattr=+xsfmm32a -mattr=+xsfmm32a8f -mattr=+xsfmm32a4i -mattr=+xsfmm64a64f \
+; RUN: -verify-machineinstrs | FileCheck %s --check-prefixes=CHECK
+; RUN: sed 's/iXLen/i64/g' %s | llc -mtriple=riscv64 -mattr=+v \
+; RUN: -mattr=+zvfh -mattr=+experimental-zvfbfmin -mattr=+xsfmmbase \
+; RUN: -mattr=+experimental-zvfbfmin -mattr=+xsfmmbase \
+; RUN: -mattr=+xsfmm32a -mattr=+xsfmm32a8f -mattr=+xsfmm32a4i -mattr=+xsfmm64a64f \
+; RUN: -verify-machineinstrs | FileCheck %s --check-prefixes=CHECK
+
+declare iXLen @llvm.riscv.sf.vsettk.iXLen(iXLen, iXLen, iXLen)
+
+define iXLen @test_sf_vsettk(iXLen %tk) {
+; CHECK-LABEL: test_sf_vsettk:
+; CHECK: # %bb.0: # %entry
+; CHECK-NEXT: sf.vsettnt a1, zero, e16, w2
+; CHECK-NEXT: sf.vsettk a0, a0
+; CHECK-NEXT: ret
+ entry:
+ %0 = call iXLen @llvm.riscv.sf.vsettk.iXLen(iXLen %tk, iXLen 1, iXLen 2)
+ ret iXLen %0
+}
diff --git a/llvm/test/CodeGen/RISCV/rvv/sifive_sf_vsettm.ll b/llvm/test/CodeGen/RISCV/rvv/sifive_sf_vsettm.ll
new file mode 100644
index 0000000..143c26c
--- /dev/null
+++ b/llvm/test/CodeGen/RISCV/rvv/sifive_sf_vsettm.ll
@@ -0,0 +1,23 @@
+; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 4
+; RUN: sed 's/iXLen/i32/g' %s | llc -mtriple=riscv32 -mattr=+v \
+; RUN: -mattr=+zvfh -mattr=+experimental-zvfbfmin -mattr=+xsfmmbase \
+; RUN: -mattr=+xsfmm32a -mattr=+xsfmm32a8f -mattr=+xsfmm32a4i -mattr=+xsfmm64a64f \
+; RUN: -verify-machineinstrs | FileCheck %s --check-prefixes=CHECK
+; RUN: sed 's/iXLen/i64/g' %s | llc -mtriple=riscv64 -mattr=+v \
+; RUN: -mattr=+zvfh -mattr=+experimental-zvfbfmin -mattr=+xsfmmbase \
+; RUN: -mattr=+experimental-zvfbfmin -mattr=+xsfmmbase \
+; RUN: -mattr=+xsfmm32a -mattr=+xsfmm32a8f -mattr=+xsfmm32a4i -mattr=+xsfmm64a64f \
+; RUN: -verify-machineinstrs | FileCheck %s --check-prefixes=CHECK
+
+declare iXLen @llvm.riscv.sf.vsettm.iXLen(iXLen, iXLen, iXLen)
+
+define iXLen @test_sf_vsettm(iXLen %tm) {
+; CHECK-LABEL: test_sf_vsettm:
+; CHECK: # %bb.0: # %entry
+; CHECK-NEXT: sf.vsettnt a1, zero, e8, w4
+; CHECK-NEXT: sf.vsettm a0, a0
+; CHECK-NEXT: ret
+ entry:
+ %0 = call iXLen @llvm.riscv.sf.vsettm.iXLen(iXLen %tm, iXLen 0, iXLen 3)
+ ret iXLen %0
+}
diff --git a/llvm/test/CodeGen/RISCV/rvv/sifive_sf_vsettnt.ll b/llvm/test/CodeGen/RISCV/rvv/sifive_sf_vsettnt.ll
new file mode 100644
index 0000000..48fa1bc8
--- /dev/null
+++ b/llvm/test/CodeGen/RISCV/rvv/sifive_sf_vsettnt.ll
@@ -0,0 +1,72 @@
+; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 4
+; RUN: sed 's/iXLen/i32/g' %s | llc -mtriple=riscv32 -mattr=+v \
+; RUN: -mattr=+zvfh -mattr=+experimental-zvfbfmin -mattr=+xsfmmbase \
+; RUN: -mattr=+xsfmm32a -mattr=+xsfmm32a8f -mattr=+xsfmm32a4i -mattr=+xsfmm64a64f \
+; RUN: -verify-machineinstrs | FileCheck %s --check-prefixes=CHECK
+; RUN: sed 's/iXLen/i64/g' %s | llc -mtriple=riscv64 -mattr=+v \
+; RUN: -mattr=+zvfh -mattr=+experimental-zvfbfmin -mattr=+xsfmmbase \
+; RUN: -mattr=+experimental-zvfbfmin -mattr=+xsfmmbase \
+; RUN: -mattr=+xsfmm32a -mattr=+xsfmm32a8f -mattr=+xsfmm32a4i -mattr=+xsfmm64a64f \
+; RUN: -verify-machineinstrs | FileCheck %s --check-prefixes=CHECK
+
+declare iXLen @llvm.riscv.sf.vsettnt.iXLen(iXLen, iXLen, iXLen)
+
+define iXLen @test_sf_vsettnt_e8w1(iXLen %tn) {
+; CHECK-LABEL: test_sf_vsettnt_e8w1:
+; CHECK: # %bb.0: # %entry
+; CHECK-NEXT: sf.vsettnt a0, a0, e8, w1
+; CHECK-NEXT: ret
+ entry:
+ %0 = call iXLen @llvm.riscv.sf.vsettnt.iXLen(iXLen %tn, iXLen 0, iXLen 1)
+ ret iXLen %0
+}
+
+define iXLen @test_sf_vsettnt_e8w2(iXLen %tn) {
+; CHECK-LABEL: test_sf_vsettnt_e8w2:
+; CHECK: # %bb.0: # %entry
+; CHECK-NEXT: sf.vsettnt a0, a0, e8, w2
+; CHECK-NEXT: ret
+ entry:
+ %0 = call iXLen @llvm.riscv.sf.vsettnt.iXLen(iXLen %tn, iXLen 0, iXLen 2)
+ ret iXLen %0
+}
+
+define iXLen @test_sf_vsettnt_e8w4(iXLen %tn) {
+; CHECK-LABEL: test_sf_vsettnt_e8w4:
+; CHECK: # %bb.0: # %entry
+; CHECK-NEXT: sf.vsettnt a0, a0, e8, w4
+; CHECK-NEXT: ret
+ entry:
+ %0 = call iXLen @llvm.riscv.sf.vsettnt.iXLen(iXLen %tn, iXLen 0, iXLen 3)
+ ret iXLen %0
+}
+
+define iXLen @test_sf_vsettnt_e16w1(iXLen %tn) {
+; CHECK-LABEL: test_sf_vsettnt_e16w1:
+; CHECK: # %bb.0: # %entry
+; CHECK-NEXT: sf.vsettnt a0, a0, e16, w1
+; CHECK-NEXT: ret
+ entry:
+ %0 = call iXLen @llvm.riscv.sf.vsettnt.iXLen(iXLen %tn, iXLen 1, iXLen 1)
+ ret iXLen %0
+}
+
+define iXLen @test_sf_vsettnt_e16w2(iXLen %tn) {
+; CHECK-LABEL: test_sf_vsettnt_e16w2:
+; CHECK: # %bb.0: # %entry
+; CHECK-NEXT: sf.vsettnt a0, a0, e16, w2
+; CHECK-NEXT: ret
+ entry:
+ %0 = call iXLen @llvm.riscv.sf.vsettnt.iXLen(iXLen %tn, iXLen 1, iXLen 2)
+ ret iXLen %0
+}
+
+define iXLen @test_sf_vsettnt_e16w4(iXLen %tn) {
+; CHECK-LABEL: test_sf_vsettnt_e16w4:
+; CHECK: # %bb.0: # %entry
+; CHECK-NEXT: sf.vsettnt a0, a0, e16, w4
+; CHECK-NEXT: ret
+ entry:
+ %0 = call iXLen @llvm.riscv.sf.vsettnt.iXLen(iXLen %tn, iXLen 1, iXLen 3)
+ ret iXLen %0
+}
diff --git a/llvm/test/CodeGen/RISCV/rvv/sifive_sf_vste16.ll b/llvm/test/CodeGen/RISCV/rvv/sifive_sf_vste16.ll
new file mode 100644
index 0000000..7a76151
--- /dev/null
+++ b/llvm/test/CodeGen/RISCV/rvv/sifive_sf_vste16.ll
@@ -0,0 +1,23 @@
+; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 4
+; RUN: sed 's/iXLen/i32/g' %s | llc -mtriple=riscv32 -mattr=+v \
+; RUN: -mattr=+zvfh -mattr=+experimental-zvfbfmin -mattr=+xsfmmbase \
+; RUN: -mattr=+xsfmm32a -mattr=+xsfmm32a8f -mattr=+xsfmm32a4i -mattr=+xsfmm64a64f \
+; RUN: -verify-machineinstrs | FileCheck %s --check-prefixes=CHECK
+; RUN: sed 's/iXLen/i64/g' %s | llc -mtriple=riscv64 -mattr=+v \
+; RUN: -mattr=+zvfh -mattr=+experimental-zvfbfmin -mattr=+xsfmmbase \
+; RUN: -mattr=+experimental-zvfbfmin -mattr=+xsfmmbase \
+; RUN: -mattr=+xsfmm32a -mattr=+xsfmm32a8f -mattr=+xsfmm32a4i -mattr=+xsfmm64a64f \
+; RUN: -verify-machineinstrs | FileCheck %s --check-prefixes=CHECK
+
+declare void @llvm.riscv.sf.vste16.iXLen(iXLen, ptr, iXLen)
+
+define dso_local void @test_sf_vste16(iXLen %tss, ptr %base, iXLen %vl) {
+; CHECK-LABEL: test_sf_vste16:
+; CHECK: # %bb.0: # %entry
+; CHECK-NEXT: sf.vsettnt zero, a2, e16, w1
+; CHECK-NEXT: sf.vste16 a0, (a1)
+; CHECK-NEXT: ret
+ entry:
+ call void @llvm.riscv.sf.vste16.iXLen(iXLen %tss, ptr %base, iXLen %vl)
+ ret void
+}
diff --git a/llvm/test/CodeGen/RISCV/rvv/sifive_sf_vste32.ll b/llvm/test/CodeGen/RISCV/rvv/sifive_sf_vste32.ll
new file mode 100644
index 0000000..8ff6e6a
--- /dev/null
+++ b/llvm/test/CodeGen/RISCV/rvv/sifive_sf_vste32.ll
@@ -0,0 +1,23 @@
+; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 4
+; RUN: sed 's/iXLen/i32/g' %s | llc -mtriple=riscv32 -mattr=+v \
+; RUN: -mattr=+zvfh -mattr=+experimental-zvfbfmin -mattr=+xsfmmbase \
+; RUN: -mattr=+xsfmm32a -mattr=+xsfmm32a8f -mattr=+xsfmm32a4i -mattr=+xsfmm64a64f \
+; RUN: -verify-machineinstrs | FileCheck %s --check-prefixes=CHECK
+; RUN: sed 's/iXLen/i64/g' %s | llc -mtriple=riscv64 -mattr=+v \
+; RUN: -mattr=+zvfh -mattr=+experimental-zvfbfmin -mattr=+xsfmmbase \
+; RUN: -mattr=+experimental-zvfbfmin -mattr=+xsfmmbase \
+; RUN: -mattr=+xsfmm32a -mattr=+xsfmm32a8f -mattr=+xsfmm32a4i -mattr=+xsfmm64a64f \
+; RUN: -verify-machineinstrs | FileCheck %s --check-prefixes=CHECK
+
+declare void @llvm.riscv.sf.vste32.iXLen(iXLen, ptr, iXLen)
+
+define dso_local void @test_sf_vste32(iXLen %tss, ptr %base, iXLen %vl) {
+; CHECK-LABEL: test_sf_vste32:
+; CHECK: # %bb.0: # %entry
+; CHECK-NEXT: sf.vsettnt zero, a2, e32, w1
+; CHECK-NEXT: sf.vste32 a0, (a1)
+; CHECK-NEXT: ret
+ entry:
+ call void @llvm.riscv.sf.vste32.iXLen(iXLen %tss, ptr %base, iXLen %vl)
+ ret void
+}
diff --git a/llvm/test/CodeGen/RISCV/rvv/sifive_sf_vste64.ll b/llvm/test/CodeGen/RISCV/rvv/sifive_sf_vste64.ll
new file mode 100644
index 0000000..53990e4
--- /dev/null
+++ b/llvm/test/CodeGen/RISCV/rvv/sifive_sf_vste64.ll
@@ -0,0 +1,23 @@
+; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 4
+; RUN: sed 's/iXLen/i32/g' %s | llc -mtriple=riscv32 -mattr=+v \
+; RUN: -mattr=+zvfh -mattr=+experimental-zvfbfmin -mattr=+xsfmmbase \
+; RUN: -mattr=+xsfmm32a -mattr=+xsfmm32a8f -mattr=+xsfmm32a4i -mattr=+xsfmm64a64f \
+; RUN: -verify-machineinstrs | FileCheck %s --check-prefixes=CHECK
+; RUN: sed 's/iXLen/i64/g' %s | llc -mtriple=riscv64 -mattr=+v \
+; RUN: -mattr=+zvfh -mattr=+experimental-zvfbfmin -mattr=+xsfmmbase \
+; RUN: -mattr=+experimental-zvfbfmin -mattr=+xsfmmbase \
+; RUN: -mattr=+xsfmm32a -mattr=+xsfmm32a8f -mattr=+xsfmm32a4i -mattr=+xsfmm64a64f \
+; RUN: -verify-machineinstrs | FileCheck %s --check-prefixes=CHECK
+
+declare void @llvm.riscv.sf.vste64.iXLen(iXLen, ptr, iXLen)
+
+define dso_local void @test_sf_vste64(iXLen %tss, ptr %base, iXLen %vl) {
+; CHECK-LABEL: test_sf_vste64:
+; CHECK: # %bb.0: # %entry
+; CHECK-NEXT: sf.vsettnt zero, a2, e64, w1
+; CHECK-NEXT: sf.vste64 a0, (a1)
+; CHECK-NEXT: ret
+ entry:
+ call void @llvm.riscv.sf.vste64.iXLen(iXLen %tss, ptr %base, iXLen %vl)
+ ret void
+}
diff --git a/llvm/test/CodeGen/RISCV/rvv/sifive_sf_vste8.ll b/llvm/test/CodeGen/RISCV/rvv/sifive_sf_vste8.ll
new file mode 100644
index 0000000..09b7259
--- /dev/null
+++ b/llvm/test/CodeGen/RISCV/rvv/sifive_sf_vste8.ll
@@ -0,0 +1,23 @@
+; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 4
+; RUN: sed 's/iXLen/i32/g' %s | llc -mtriple=riscv32 -mattr=+v \
+; RUN: -mattr=+zvfh -mattr=+experimental-zvfbfmin -mattr=+xsfmmbase \
+; RUN: -mattr=+xsfmm32a -mattr=+xsfmm32a8f -mattr=+xsfmm32a4i -mattr=+xsfmm64a64f \
+; RUN: -verify-machineinstrs | FileCheck %s --check-prefixes=CHECK
+; RUN: sed 's/iXLen/i64/g' %s | llc -mtriple=riscv64 -mattr=+v \
+; RUN: -mattr=+zvfh -mattr=+experimental-zvfbfmin -mattr=+xsfmmbase \
+; RUN: -mattr=+experimental-zvfbfmin -mattr=+xsfmmbase \
+; RUN: -mattr=+xsfmm32a -mattr=+xsfmm32a8f -mattr=+xsfmm32a4i -mattr=+xsfmm64a64f \
+; RUN: -verify-machineinstrs | FileCheck %s --check-prefixes=CHECK
+
+declare void @llvm.riscv.sf.vste8.iXLen(iXLen, ptr, iXLen)
+
+define dso_local void @test_sf_vste8(iXLen %tss, ptr %base, iXLen %vl) {
+; CHECK-LABEL: test_sf_vste8:
+; CHECK: # %bb.0: # %entry
+; CHECK-NEXT: sf.vsettnt zero, a2, e8, w1
+; CHECK-NEXT: sf.vste8 a0, (a1)
+; CHECK-NEXT: ret
+ entry:
+ call void @llvm.riscv.sf.vste8.iXLen(iXLen %tss, ptr %base, iXLen %vl)
+ ret void
+}
diff --git a/llvm/test/CodeGen/RISCV/rvv/sifive_sf_vtdiscard.ll b/llvm/test/CodeGen/RISCV/rvv/sifive_sf_vtdiscard.ll
new file mode 100644
index 0000000..394eb60
--- /dev/null
+++ b/llvm/test/CodeGen/RISCV/rvv/sifive_sf_vtdiscard.ll
@@ -0,0 +1,22 @@
+; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 4
+; RUN: sed 's/iXLen/i32/g' %s | llc -mtriple=riscv32 -mattr=+v \
+; RUN: -mattr=+zvfh -mattr=+experimental-zvfbfmin -mattr=+xsfmmbase \
+; RUN: -mattr=+xsfmm32a -mattr=+xsfmm32a8f -mattr=+xsfmm32a4i -mattr=+xsfmm64a64f \
+; RUN: -verify-machineinstrs | FileCheck %s --check-prefixes=CHECK
+; RUN: sed 's/iXLen/i64/g' %s | llc -mtriple=riscv64 -mattr=+v \
+; RUN: -mattr=+zvfh -mattr=+experimental-zvfbfmin -mattr=+xsfmmbase \
+; RUN: -mattr=+experimental-zvfbfmin -mattr=+xsfmmbase \
+; RUN: -mattr=+xsfmm32a -mattr=+xsfmm32a8f -mattr=+xsfmm32a4i -mattr=+xsfmm64a64f \
+; RUN: -verify-machineinstrs | FileCheck %s --check-prefixes=CHECK
+
+declare void @llvm.riscv.sf.vtdiscard()
+
+define dso_local void @test_sf_vtdiscard() {
+; CHECK-LABEL: test_sf_vtdiscard:
+; CHECK: # %bb.0: # %entry
+; CHECK-NEXT: sf.vtdiscard
+; CHECK-NEXT: ret
+ entry:
+ call void @llvm.riscv.sf.vtdiscard()
+ ret void
+}
diff --git a/llvm/test/CodeGen/RISCV/rvv/sifive_sf_vtmv_t_v.ll b/llvm/test/CodeGen/RISCV/rvv/sifive_sf_vtmv_t_v.ll
new file mode 100644
index 0000000..66c9d26
--- /dev/null
+++ b/llvm/test/CodeGen/RISCV/rvv/sifive_sf_vtmv_t_v.ll
@@ -0,0 +1,114 @@
+; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 4
+; RUN: sed 's/iXLen/i32/g' %s | llc -mtriple=riscv32 -mattr=+v \
+; RUN: -mattr=+zvfh -mattr=+zvfbfmin -mattr=+xsfmmbase \
+; RUN: -mattr=+xsfmm32a -mattr=+xsfmm32a8f -mattr=+xsfmm32a4i -mattr=+xsfmm64a64f \
+; RUN: -verify-machineinstrs | FileCheck %s --check-prefixes=CHECK
+; RUN: sed 's/iXLen/i64/g' %s | llc -mtriple=riscv64 -mattr=+v \
+; RUN: -mattr=+zvfh -mattr=+zvfbfmin -mattr=+xsfmmbase \
+; RUN: -mattr=+zvfbfmin -mattr=+xsfmmbase \
+; RUN: -mattr=+xsfmm32a -mattr=+xsfmm32a8f -mattr=+xsfmm32a4i -mattr=+xsfmm64a64f \
+; RUN: -verify-machineinstrs | FileCheck %s --check-prefixes=CHECK
+
+declare void @llvm.riscv.sf.vtmv.t.v.nxv32bf16.iXLen(iXLen, <vscale x 32 x bfloat>, iXLen)
+
+define void @test_sf_vtmv_t_v_bf16m8(iXLen %tss, <vscale x 32 x bfloat> %src, iXLen %vl) {
+; CHECK-LABEL: test_sf_vtmv_t_v_bf16m8:
+; CHECK: # %bb.0: # %entry
+; CHECK-NEXT: sf.vsettnt zero, a1, e16, w1
+; CHECK-NEXT: sf.vtmv.t.v a0, v8
+; CHECK-NEXT: ret
+ entry:
+ call void @llvm.riscv.sf.vtmv.t.v.nxv32bf16.iXLen(iXLen %tss, <vscale x 32 x bfloat> %src, iXLen %vl)
+ ret void
+}
+
+declare void @llvm.riscv.sf.vtmv.t.v.nxv32f16.iXLen(iXLen, <vscale x 32 x half>, iXLen)
+
+define void @test_sf_vtmv_t_v_f16(iXLen %tss, <vscale x 32 x half> %src, iXLen %vl) {
+; CHECK-LABEL: test_sf_vtmv_t_v_f16:
+; CHECK: # %bb.0: # %entry
+; CHECK-NEXT: sf.vsettnt zero, a1, e16, w1
+; CHECK-NEXT: sf.vtmv.t.v a0, v8
+; CHECK-NEXT: ret
+ entry:
+ call void @llvm.riscv.sf.vtmv.t.v.nxv32f16.iXLen(iXLen %tss, <vscale x 32 x half> %src, iXLen %vl)
+ ret void
+}
+
+declare void @llvm.riscv.sf.vtmv.t.v.nxv16f32.iXLen(iXLen, <vscale x 16 x float>, iXLen)
+
+define void @test_sf_vtmv_t_v_f32(iXLen %tss, <vscale x 16 x float> %src, iXLen %vl) {
+; CHECK-LABEL: test_sf_vtmv_t_v_f32:
+; CHECK: # %bb.0: # %entry
+; CHECK-NEXT: sf.vsettnt zero, a1, e32, w1
+; CHECK-NEXT: sf.vtmv.t.v a0, v8
+; CHECK-NEXT: ret
+ entry:
+ call void @llvm.riscv.sf.vtmv.t.v.nxv16f32.iXLen(iXLen %tss, <vscale x 16 x float> %src, iXLen %vl)
+ ret void
+}
+
+declare void @llvm.riscv.sf.vtmv.t.v.nxv8f64.iXLen(iXLen, <vscale x 8 x double>, iXLen)
+
+define void @test_sf_vtmv_t_v_f64(iXLen %tss, <vscale x 8 x double> %src, iXLen %vl) {
+; CHECK-LABEL: test_sf_vtmv_t_v_f64:
+; CHECK: # %bb.0: # %entry
+; CHECK-NEXT: sf.vsettnt zero, a1, e64, w1
+; CHECK-NEXT: sf.vtmv.t.v a0, v8
+; CHECK-NEXT: ret
+ entry:
+ call void @llvm.riscv.sf.vtmv.t.v.nxv8f64.iXLen(iXLen %tss, <vscale x 8 x double> %src, iXLen %vl)
+ ret void
+}
+
+declare void @llvm.riscv.sf.vtmv.t.v.nxv64i8.iXLen(iXLen, <vscale x 64 x i8>, iXLen)
+
+define void @test_sf_vtmv_t_v_i8(iXLen %tss, <vscale x 64 x i8> %src, iXLen %vl) {
+; CHECK-LABEL: test_sf_vtmv_t_v_i8:
+; CHECK: # %bb.0: # %entry
+; CHECK-NEXT: sf.vsettnt zero, a1, e8, w1
+; CHECK-NEXT: sf.vtmv.t.v a0, v8
+; CHECK-NEXT: ret
+ entry:
+ call void @llvm.riscv.sf.vtmv.t.v.nxv64i8.iXLen(iXLen %tss, <vscale x 64 x i8> %src, iXLen %vl)
+ ret void
+}
+
+declare void @llvm.riscv.sf.vtmv.t.v.nxv32i16.iXLen(iXLen, <vscale x 32 x i16>, iXLen)
+
+define void @test_sf_vtmv_t_v_i16(iXLen %tss, <vscale x 32 x i16> %src, iXLen %vl) {
+; CHECK-LABEL: test_sf_vtmv_t_v_i16:
+; CHECK: # %bb.0: # %entry
+; CHECK-NEXT: sf.vsettnt zero, a1, e16, w1
+; CHECK-NEXT: sf.vtmv.t.v a0, v8
+; CHECK-NEXT: ret
+ entry:
+ call void @llvm.riscv.sf.vtmv.t.v.nxv32i16.iXLen(iXLen %tss, <vscale x 32 x i16> %src, iXLen %vl)
+ ret void
+}
+
+declare void @llvm.riscv.sf.vtmv.t.v.nxv16i32.iXLen(iXLen, <vscale x 16 x i32>, iXLen)
+
+define void @test_sf_vtmv_t_v_i32(iXLen %tss, <vscale x 16 x i32> %src, iXLen %vl) {
+; CHECK-LABEL: test_sf_vtmv_t_v_i32:
+; CHECK: # %bb.0: # %entry
+; CHECK-NEXT: sf.vsettnt zero, a1, e32, w1
+; CHECK-NEXT: sf.vtmv.t.v a0, v8
+; CHECK-NEXT: ret
+ entry:
+ call void @llvm.riscv.sf.vtmv.t.v.nxv16i32.iXLen(iXLen %tss, <vscale x 16 x i32> %src, iXLen %vl)
+ ret void
+}
+
+declare void @llvm.riscv.sf.vtmv.t.v.nxv8i64.iXLen(iXLen, <vscale x 8 x i64>, iXLen)
+
+define void @test_sf_vtmv_t_v_i64(iXLen %tss, <vscale x 8 x i64> %src, iXLen %vl) {
+; CHECK-LABEL: test_sf_vtmv_t_v_i64:
+; CHECK: # %bb.0: # %entry
+; CHECK-NEXT: sf.vsettnt zero, a1, e64, w1
+; CHECK-NEXT: sf.vtmv.t.v a0, v8
+; CHECK-NEXT: ret
+ entry:
+ call void @llvm.riscv.sf.vtmv.t.v.nxv8i64.iXLen(iXLen %tss, <vscale x 8 x i64> %src, iXLen %vl)
+ ret void
+}
diff --git a/llvm/test/CodeGen/RISCV/rvv/sifive_sf_vtmv_v_t.ll b/llvm/test/CodeGen/RISCV/rvv/sifive_sf_vtmv_v_t.ll
new file mode 100644
index 0000000..0dcc2ab
--- /dev/null
+++ b/llvm/test/CodeGen/RISCV/rvv/sifive_sf_vtmv_v_t.ll
@@ -0,0 +1,114 @@
+; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 4
+; RUN: sed 's/iXLen/i32/g' %s | llc -mtriple=riscv32 -mattr=+v \
+; RUN: -mattr=+zvfh -mattr=+zvfbfmin -mattr=+xsfmmbase \
+; RUN: -mattr=+xsfmm32a -mattr=+xsfmm32a8f -mattr=+xsfmm32a4i -mattr=+xsfmm64a64f \
+; RUN: -verify-machineinstrs | FileCheck %s --check-prefixes=CHECK
+; RUN: sed 's/iXLen/i64/g' %s | llc -mtriple=riscv64 -mattr=+v \
+; RUN: -mattr=+zvfh -mattr=+zvfbfmin -mattr=+xsfmmbase \
+; RUN: -mattr=+zvfbfmin -mattr=+xsfmmbase \
+; RUN: -mattr=+xsfmm32a -mattr=+xsfmm32a8f -mattr=+xsfmm32a4i -mattr=+xsfmm64a64f \
+; RUN: -verify-machineinstrs | FileCheck %s --check-prefixes=CHECK
+
+declare <vscale x 32 x bfloat> @llvm.riscv.sf.vtmv.v.t.nxv32bf16.iXLen(iXLen, iXLen)
+
+define <vscale x 32 x bfloat> @test_sf_vtmv_v_t_bf16m8(iXLen %tss, iXLen %vl) {
+; CHECK-LABEL: test_sf_vtmv_v_t_bf16m8:
+; CHECK: # %bb.0: # %entry
+; CHECK-NEXT: sf.vsettnt zero, a1, e16, w1
+; CHECK-NEXT: sf.vtmv.v.t v8, a0
+; CHECK-NEXT: ret
+ entry:
+ %0 = call <vscale x 32 x bfloat> @llvm.riscv.sf.vtmv.v.t.nxv32bf16.iXLen(iXLen %tss, iXLen %vl)
+ ret <vscale x 32 x bfloat> %0
+}
+
+declare <vscale x 32 x half> @llvm.riscv.sf.vtmv.v.t.nxv32f16.iXLen(iXLen, iXLen)
+
+define <vscale x 32 x half> @test_sf_vtmv_v_t_f16(iXLen %tss, iXLen %vl) {
+; CHECK-LABEL: test_sf_vtmv_v_t_f16:
+; CHECK: # %bb.0: # %entry
+; CHECK-NEXT: sf.vsettnt zero, a1, e16, w1
+; CHECK-NEXT: sf.vtmv.v.t v8, a0
+; CHECK-NEXT: ret
+ entry:
+ %0 = call <vscale x 32 x half> @llvm.riscv.sf.vtmv.v.t.nxv32f16.iXLen(iXLen %tss, iXLen %vl)
+ ret <vscale x 32 x half> %0
+}
+
+declare <vscale x 16 x float> @llvm.riscv.sf.vtmv.v.t.nxv16f32.iXLen(iXLen, iXLen)
+
+define <vscale x 16 x float> @test_sf_vtmv_v_t_f32(iXLen %tss, iXLen %vl) {
+; CHECK-LABEL: test_sf_vtmv_v_t_f32:
+; CHECK: # %bb.0: # %entry
+; CHECK-NEXT: sf.vsettnt zero, a1, e32, w1
+; CHECK-NEXT: sf.vtmv.v.t v8, a0
+; CHECK-NEXT: ret
+ entry:
+ %0 = call <vscale x 16 x float> @llvm.riscv.sf.vtmv.v.t.nxv16f32.iXLen(iXLen %tss, iXLen %vl)
+ ret <vscale x 16 x float> %0
+}
+
+declare <vscale x 8 x double> @llvm.riscv.sf.vtmv.v.t.nxv8f64.iXLen(iXLen, iXLen)
+
+define <vscale x 8 x double> @test_sf_vtmv_v_t_f64(iXLen %tss, iXLen %vl) {
+; CHECK-LABEL: test_sf_vtmv_v_t_f64:
+; CHECK: # %bb.0: # %entry
+; CHECK-NEXT: sf.vsettnt zero, a1, e64, w1
+; CHECK-NEXT: sf.vtmv.v.t v8, a0
+; CHECK-NEXT: ret
+ entry:
+ %0 = call <vscale x 8 x double> @llvm.riscv.sf.vtmv.v.t.nxv8f64.iXLen(iXLen %tss, iXLen %vl)
+ ret <vscale x 8 x double> %0
+}
+
+declare <vscale x 64 x i8> @llvm.riscv.sf.vtmv.v.t.nxv64i8.iXLen(iXLen, iXLen)
+
+define <vscale x 64 x i8> @test_sf_vtmv_v_t_i8(iXLen %tss, iXLen %vl) {
+; CHECK-LABEL: test_sf_vtmv_v_t_i8:
+; CHECK: # %bb.0: # %entry
+; CHECK-NEXT: sf.vsettnt zero, a1, e8, w1
+; CHECK-NEXT: sf.vtmv.v.t v8, a0
+; CHECK-NEXT: ret
+ entry:
+ %0 = call <vscale x 64 x i8> @llvm.riscv.sf.vtmv.v.t.nxv64i8.iXLen(iXLen %tss, iXLen %vl)
+ ret <vscale x 64 x i8> %0
+}
+
+declare <vscale x 32 x i16> @llvm.riscv.sf.vtmv.v.t.nxv32i16.iXLen(iXLen, iXLen)
+
+define <vscale x 32 x i16> @test_sf_vtmv_v_t_i16(iXLen %tss, iXLen %vl) {
+; CHECK-LABEL: test_sf_vtmv_v_t_i16:
+; CHECK: # %bb.0: # %entry
+; CHECK-NEXT: sf.vsettnt zero, a1, e16, w1
+; CHECK-NEXT: sf.vtmv.v.t v8, a0
+; CHECK-NEXT: ret
+ entry:
+ %0 = call <vscale x 32 x i16> @llvm.riscv.sf.vtmv.v.t.nxv32i16.iXLen(iXLen %tss, iXLen %vl)
+ ret <vscale x 32 x i16> %0
+}
+
+declare <vscale x 16 x i32> @llvm.riscv.sf.vtmv.v.t.nxv16i32.iXLen(iXLen, iXLen)
+
+define <vscale x 16 x i32> @test_sf_vtmv_v_t_i32(iXLen %tss, iXLen %vl) {
+; CHECK-LABEL: test_sf_vtmv_v_t_i32:
+; CHECK: # %bb.0: # %entry
+; CHECK-NEXT: sf.vsettnt zero, a1, e32, w1
+; CHECK-NEXT: sf.vtmv.v.t v8, a0
+; CHECK-NEXT: ret
+ entry:
+ %0 = call <vscale x 16 x i32> @llvm.riscv.sf.vtmv.v.t.nxv16i32.iXLen(iXLen %tss, iXLen %vl)
+ ret <vscale x 16 x i32> %0
+}
+
+declare <vscale x 8 x i64> @llvm.riscv.sf.vtmv.v.t.nxv8i64.iXLen(iXLen, iXLen)
+
+define <vscale x 8 x i64> @test_sf_vtmv_v_t_i64(iXLen %tss, iXLen %vl) {
+; CHECK-LABEL: test_sf_vtmv_v_t_i64:
+; CHECK: # %bb.0: # %entry
+; CHECK-NEXT: sf.vsettnt zero, a1, e64, w1
+; CHECK-NEXT: sf.vtmv.v.t v8, a0
+; CHECK-NEXT: ret
+ entry:
+ %0 = call <vscale x 8 x i64> @llvm.riscv.sf.vtmv.v.t.nxv8i64.iXLen(iXLen %tss, iXLen %vl)
+ ret <vscale x 8 x i64> %0
+}
diff --git a/llvm/test/CodeGen/RISCV/rvv/sifive_sf_vtzero_t.ll b/llvm/test/CodeGen/RISCV/rvv/sifive_sf_vtzero_t.ll
new file mode 100644
index 0000000..bbccb02
--- /dev/null
+++ b/llvm/test/CodeGen/RISCV/rvv/sifive_sf_vtzero_t.ll
@@ -0,0 +1,24 @@
+; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 4
+; RUN: sed 's/iXLen/i32/g' %s | llc -mtriple=riscv32 -mattr=+v \
+; RUN: -mattr=+zvfh -mattr=+experimental-zvfbfmin -mattr=+xsfmmbase \
+; RUN: -mattr=+xsfmm32a -mattr=+xsfmm32a8f -mattr=+xsfmm32a4i -mattr=+xsfmm64a64f \
+; RUN: -verify-machineinstrs | FileCheck %s --check-prefixes=CHECK
+; RUN: sed 's/iXLen/i64/g' %s | llc -mtriple=riscv64 -mattr=+v \
+; RUN: -mattr=+zvfh -mattr=+experimental-zvfbfmin -mattr=+xsfmmbase \
+; RUN: -mattr=+experimental-zvfbfmin -mattr=+xsfmmbase \
+; RUN: -mattr=+xsfmm32a -mattr=+xsfmm32a8f -mattr=+xsfmm32a4i -mattr=+xsfmm64a64f \
+; RUN: -verify-machineinstrs | FileCheck %s --check-prefixes=CHECK
+
+declare void @llvm.riscv.sf.vtzero.t.iXLen(iXLen, iXLen, iXLen, iXLen, iXLen)
+define void @test_sf_vtzero_t(iXLen %tm, iXLen %tn) {
+; CHECK-LABEL: test_sf_vtzero_t:
+; CHECK: # %bb.0: # %entry
+; CHECK-NEXT: sf.vsettnt zero, a1, e8, w4
+; CHECK-NEXT: sf.vsettm zero, a0
+; CHECK-NEXT: sf.vtzero.t mt0
+; CHECK-NEXT: ret
+ entry:
+ call void @llvm.riscv.sf.vtzero.t.iXLen(iXLen 0, iXLen %tm, iXLen %tn, iXLen 3, iXLen 4)
+ ret void
+}
+
diff --git a/llvm/test/CodeGen/RISCV/select-to-and-zext.ll b/llvm/test/CodeGen/RISCV/select-to-and-zext.ll
index 2f03ff9..318268a 100644
--- a/llvm/test/CodeGen/RISCV/select-to-and-zext.ll
+++ b/llvm/test/CodeGen/RISCV/select-to-and-zext.ll
@@ -15,8 +15,7 @@ define i32 @from_cmpeq(i32 %xx, i32 %y) {
;
; RV64I-LABEL: from_cmpeq:
; RV64I: # %bb.0:
-; RV64I-NEXT: sext.w a0, a0
-; RV64I-NEXT: addi a0, a0, -9
+; RV64I-NEXT: addiw a0, a0, -9
; RV64I-NEXT: seqz a0, a0
; RV64I-NEXT: and a0, a0, a1
; RV64I-NEXT: ret
@@ -39,8 +38,7 @@ define i32 @from_cmpeq_fail_bad_andmask(i32 %xx, i32 %y) {
;
; RV64I-LABEL: from_cmpeq_fail_bad_andmask:
; RV64I: # %bb.0:
-; RV64I-NEXT: sext.w a0, a0
-; RV64I-NEXT: addi a0, a0, -9
+; RV64I-NEXT: addiw a0, a0, -9
; RV64I-NEXT: snez a0, a0
; RV64I-NEXT: addi a0, a0, -1
; RV64I-NEXT: and a0, a1, a0
diff --git a/llvm/test/CodeGen/RISCV/setcc-logic.ll b/llvm/test/CodeGen/RISCV/setcc-logic.ll
index fabb573..4e14893 100644
--- a/llvm/test/CodeGen/RISCV/setcc-logic.ll
+++ b/llvm/test/CodeGen/RISCV/setcc-logic.ll
@@ -104,9 +104,8 @@ define i1 @and_icmps_const_not1bit_diff(i32 %x) nounwind {
;
; RV64I-LABEL: and_icmps_const_not1bit_diff:
; RV64I: # %bb.0:
-; RV64I-NEXT: sext.w a0, a0
-; RV64I-NEXT: addi a1, a0, -44
-; RV64I-NEXT: addi a0, a0, -92
+; RV64I-NEXT: addiw a1, a0, -44
+; RV64I-NEXT: addiw a0, a0, -92
; RV64I-NEXT: snez a1, a1
; RV64I-NEXT: snez a0, a0
; RV64I-NEXT: and a0, a1, a0
diff --git a/llvm/test/CodeGen/RISCV/sext-zext-trunc.ll b/llvm/test/CodeGen/RISCV/sext-zext-trunc.ll
index bdbe4ed..07bfbe6 100644
--- a/llvm/test/CodeGen/RISCV/sext-zext-trunc.ll
+++ b/llvm/test/CodeGen/RISCV/sext-zext-trunc.ll
@@ -674,8 +674,7 @@ define i32 @sext_of_not_cmp_i32(i32 %x) {
;
; RV64-LABEL: sext_of_not_cmp_i32:
; RV64: # %bb.0:
-; RV64-NEXT: sext.w a0, a0
-; RV64-NEXT: addi a0, a0, -7
+; RV64-NEXT: addiw a0, a0, -7
; RV64-NEXT: seqz a0, a0
; RV64-NEXT: addi a0, a0, -1
; RV64-NEXT: ret
@@ -718,8 +717,7 @@ define i32 @dec_of_zexted_cmp_i32(i32 %x) {
;
; RV64-LABEL: dec_of_zexted_cmp_i32:
; RV64: # %bb.0:
-; RV64-NEXT: sext.w a0, a0
-; RV64-NEXT: addi a0, a0, -7
+; RV64-NEXT: addiw a0, a0, -7
; RV64-NEXT: seqz a0, a0
; RV64-NEXT: addi a0, a0, -1
; RV64-NEXT: ret
diff --git a/llvm/test/CodeGen/RISCV/xaluo.ll b/llvm/test/CodeGen/RISCV/xaluo.ll
index 2751332c..bf6802d 100644
--- a/llvm/test/CodeGen/RISCV/xaluo.ll
+++ b/llvm/test/CodeGen/RISCV/xaluo.ll
@@ -1047,8 +1047,8 @@ define zeroext i1 @usubo.i32.constant.lhs(i32 signext %v1, ptr %res) {
; RV64-LABEL: usubo.i32.constant.lhs:
; RV64: # %bb.0: # %entry
; RV64-NEXT: li a2, -2
-; RV64-NEXT: subw a2, a2, a0
-; RV64-NEXT: addi a0, a2, 1
+; RV64-NEXT: sub a2, a2, a0
+; RV64-NEXT: addiw a0, a2, 1
; RV64-NEXT: seqz a0, a0
; RV64-NEXT: sw a2, 0(a1)
; RV64-NEXT: ret
@@ -1065,8 +1065,8 @@ define zeroext i1 @usubo.i32.constant.lhs(i32 signext %v1, ptr %res) {
; RV64ZBA-LABEL: usubo.i32.constant.lhs:
; RV64ZBA: # %bb.0: # %entry
; RV64ZBA-NEXT: li a2, -2
-; RV64ZBA-NEXT: subw a2, a2, a0
-; RV64ZBA-NEXT: addi a0, a2, 1
+; RV64ZBA-NEXT: sub a2, a2, a0
+; RV64ZBA-NEXT: addiw a0, a2, 1
; RV64ZBA-NEXT: seqz a0, a0
; RV64ZBA-NEXT: sw a2, 0(a1)
; RV64ZBA-NEXT: ret
@@ -1083,8 +1083,8 @@ define zeroext i1 @usubo.i32.constant.lhs(i32 signext %v1, ptr %res) {
; RV64ZICOND-LABEL: usubo.i32.constant.lhs:
; RV64ZICOND: # %bb.0: # %entry
; RV64ZICOND-NEXT: li a2, -2
-; RV64ZICOND-NEXT: subw a2, a2, a0
-; RV64ZICOND-NEXT: addi a0, a2, 1
+; RV64ZICOND-NEXT: sub a2, a2, a0
+; RV64ZICOND-NEXT: addiw a0, a2, 1
; RV64ZICOND-NEXT: seqz a0, a0
; RV64ZICOND-NEXT: sw a2, 0(a1)
; RV64ZICOND-NEXT: ret