@@ -909,3 +909,24 @@ defm : StoreUpdatePat<post_truncsti16, TH_SHIA, i32>;
909
909
defm : StoreUpdatePat<pre_truncsti16, TH_SHIB, i32>;
910
910
}
911
911
912
+ let Predicates = [HasVendorXTHeadCondMov, IsRV64] in {
913
+ def : Pat<(select (XLenVT GPR:$cond), (i32 GPR:$a), (i32 GPR:$b)),
914
+ (TH_MVEQZ GPR:$a, GPR:$b, GPR:$cond)>;
915
+ def : Pat<(select (XLenVT GPR:$cond), (i32 GPR:$a), (i32 0)),
916
+ (TH_MVEQZ GPR:$a, (XLenVT X0), GPR:$cond)>;
917
+ def : Pat<(select (XLenVT GPR:$cond), (i32 0), (i32 GPR:$b)),
918
+ (TH_MVNEZ GPR:$b, (XLenVT X0), GPR:$cond)>;
919
+
920
+ def : Pat<(select (riscv_seteq (XLenVT GPR:$cond)), (i32 GPR:$a), (i32 GPR:$b)),
921
+ (TH_MVNEZ GPR:$a, GPR:$b, GPR:$cond)>;
922
+ def : Pat<(select (riscv_setne (XLenVT GPR:$cond)), (i32 GPR:$a), (i32 GPR:$b)),
923
+ (TH_MVEQZ GPR:$a, GPR:$b, GPR:$cond)>;
924
+ def : Pat<(select (riscv_seteq (XLenVT GPR:$cond)), (i32 GPR:$a), (i32 0)),
925
+ (TH_MVNEZ GPR:$a, (XLenVT X0), GPR:$cond)>;
926
+ def : Pat<(select (riscv_setne (XLenVT GPR:$cond)), (i32 GPR:$a), (i32 0)),
927
+ (TH_MVEQZ GPR:$a, (XLenVT X0), GPR:$cond)>;
928
+ def : Pat<(select (riscv_seteq (XLenVT GPR:$cond)), (i32 0), (i32 GPR:$b)),
929
+ (TH_MVEQZ GPR:$b, (XLenVT X0), GPR:$cond)>;
930
+ def : Pat<(select (riscv_setne (XLenVT GPR:$cond)), (i32 0), (i32 GPR:$b)),
931
+ (TH_MVNEZ GPR:$b, (XLenVT X0), GPR:$cond)>;
932
+ } // Predicates = [HasVendorXTHeadCondMov]
0 commit comments