356 lines · plain
1; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 22; RUN: llc < %s -mtriple=ve | FileCheck %s3 4;;; Test ‘llvm.umin.*’ intrinsic5;;;6;;; Syntax:7;;; This is an overloaded intrinsic. You can use @llvm.umin on any8;;; integer bit width or any vector of integer elements.9;;;10;;; declare i32 @llvm.umin.i32(i32 %a, i32 %b)11;;; declare <4 x i32> @llvm.umin.v4i32(<4 x i32> %a, <4 x i32> %b)12;;;13;;; Overview:14;;; Return the smaller of %a and %b comparing the values as unsigned15;;; integers. Vector intrinsics operate on a per-element basis. The16;;; smaller element of %a and %b at a given index is returned for17;;; that index.18;;;19;;; Arguments:20;;; The arguments (%a and %b) may be of any integer type or a vector21;;; with integer element type. The argument types must match each22;;; other, and the return type must match the argument type.23;;;24;;; Note:25;;; We test only i1/u8/u16/u32/u64/u128.26 27; Function Attrs: mustprogress nofree nosync nounwind readnone willreturn28define zeroext i1 @func_umin_var_i1(i1 noundef zeroext %0, i1 noundef zeroext %1) {29; CHECK-LABEL: func_umin_var_i1:30; CHECK: # %bb.0:31; CHECK-NEXT: and %s0, %s0, %s132; CHECK-NEXT: b.l.t (, %s10)33 %3 = tail call i1 @llvm.umin.i1(i1 %0, i1 %1)34 ret i1 %335}36 37; Function Attrs: mustprogress nofree nosync nounwind readnone willreturn38define zeroext i8 @func_umin_var_u8(i8 noundef zeroext %0, i8 noundef zeroext %1) {39; CHECK-LABEL: func_umin_var_u8:40; CHECK: # %bb.0:41; CHECK-NEXT: mins.w.sx %s0, %s0, %s142; CHECK-NEXT: adds.w.zx %s0, %s0, (0)143; CHECK-NEXT: b.l.t (, %s10)44 %3 = tail call i8 @llvm.umin.i8(i8 %0, i8 %1)45 ret i8 %346}47 48; Function Attrs: mustprogress nofree nosync nounwind readnone willreturn49define zeroext i16 @func_umin_var_u16(i16 noundef zeroext %0, i16 noundef zeroext %1) {50; CHECK-LABEL: func_umin_var_u16:51; CHECK: # %bb.0:52; CHECK-NEXT: mins.w.sx %s0, %s0, %s153; CHECK-NEXT: adds.w.zx %s0, %s0, (0)154; CHECK-NEXT: b.l.t (, %s10)55 %3 = tail call i16 @llvm.umin.i16(i16 %0, i16 %1)56 ret i16 %357}58 59; Function Attrs: mustprogress nofree nosync nounwind readnone willreturn60define zeroext i32 @func_umin_var_u32(i32 noundef zeroext %0, i32 noundef zeroext %1) {61; CHECK-LABEL: func_umin_var_u32:62; CHECK: # %bb.0:63; CHECK-NEXT: cmpu.w %s2, %s0, %s164; CHECK-NEXT: cmov.w.lt %s1, %s0, %s265; CHECK-NEXT: adds.w.zx %s0, %s1, (0)166; CHECK-NEXT: b.l.t (, %s10)67 %3 = tail call i32 @llvm.umin.i32(i32 %0, i32 %1)68 ret i32 %369}70 71; Function Attrs: mustprogress nofree nosync nounwind readnone willreturn72define i64 @func_umin_var_u64(i64 noundef %0, i64 noundef %1) {73; CHECK-LABEL: func_umin_var_u64:74; CHECK: # %bb.0:75; CHECK-NEXT: cmpu.l %s2, %s0, %s176; CHECK-NEXT: cmov.l.lt %s1, %s0, %s277; CHECK-NEXT: or %s0, 0, %s178; CHECK-NEXT: b.l.t (, %s10)79 %3 = tail call i64 @llvm.umin.i64(i64 %0, i64 %1)80 ret i64 %381}82 83; Function Attrs: mustprogress nofree nosync nounwind readnone willreturn84define i128 @func_umin_var_u128(i128 noundef %0, i128 noundef %1) {85; CHECK-LABEL: func_umin_var_u128:86; CHECK: # %bb.0:87; CHECK-NEXT: cmpu.l %s4, %s1, %s388; CHECK-NEXT: or %s5, 0, (0)189; CHECK-NEXT: or %s6, 0, (0)190; CHECK-NEXT: cmov.l.lt %s6, (63)0, %s491; CHECK-NEXT: cmpu.l %s7, %s0, %s292; CHECK-NEXT: cmov.l.lt %s5, (63)0, %s793; CHECK-NEXT: cmov.l.eq %s6, %s5, %s494; CHECK-NEXT: cmov.w.ne %s2, %s0, %s695; CHECK-NEXT: cmov.w.ne %s3, %s1, %s696; CHECK-NEXT: or %s0, 0, %s297; CHECK-NEXT: or %s1, 0, %s398; CHECK-NEXT: b.l.t (, %s10)99 %3 = tail call i128 @llvm.umin.i128(i128 %0, i128 %1)100 ret i128 %3101}102 103; Function Attrs: mustprogress nofree norecurse nosync nounwind readnone willreturn104define zeroext i1 @func_umin_fore_zero_i1(i1 noundef zeroext %0) {105; CHECK-LABEL: func_umin_fore_zero_i1:106; CHECK: # %bb.0:107; CHECK-NEXT: or %s0, 0, (0)1108; CHECK-NEXT: b.l.t (, %s10)109 ret i1 false110}111 112; Function Attrs: mustprogress nofree norecurse nosync nounwind readnone willreturn113define zeroext i8 @func_umin_fore_zero_u8(i8 noundef zeroext %0) {114; CHECK-LABEL: func_umin_fore_zero_u8:115; CHECK: # %bb.0:116; CHECK-NEXT: or %s0, 0, (0)1117; CHECK-NEXT: b.l.t (, %s10)118 ret i8 0119}120 121; Function Attrs: mustprogress nofree norecurse nosync nounwind readnone willreturn122define zeroext i16 @func_umin_fore_zero_u16(i16 noundef zeroext %0) {123; CHECK-LABEL: func_umin_fore_zero_u16:124; CHECK: # %bb.0:125; CHECK-NEXT: or %s0, 0, (0)1126; CHECK-NEXT: b.l.t (, %s10)127 ret i16 0128}129 130; Function Attrs: mustprogress nofree norecurse nosync nounwind readnone willreturn131define zeroext i32 @func_umin_fore_zero_u32(i32 noundef zeroext %0) {132; CHECK-LABEL: func_umin_fore_zero_u32:133; CHECK: # %bb.0:134; CHECK-NEXT: or %s0, 0, (0)1135; CHECK-NEXT: b.l.t (, %s10)136 ret i32 0137}138 139; Function Attrs: mustprogress nofree norecurse nosync nounwind readnone willreturn140define i64 @func_umin_fore_zero_u64(i64 noundef %0) {141; CHECK-LABEL: func_umin_fore_zero_u64:142; CHECK: # %bb.0:143; CHECK-NEXT: or %s0, 0, (0)1144; CHECK-NEXT: b.l.t (, %s10)145 ret i64 0146}147 148; Function Attrs: mustprogress nofree norecurse nosync nounwind readnone willreturn149define i128 @func_umin_fore_zero_u128(i128 noundef %0) {150; CHECK-LABEL: func_umin_fore_zero_u128:151; CHECK: # %bb.0:152; CHECK-NEXT: or %s0, 0, (0)1153; CHECK-NEXT: or %s1, 0, (0)1154; CHECK-NEXT: b.l.t (, %s10)155 ret i128 0156}157 158; Function Attrs: mustprogress nofree norecurse nosync nounwind readnone willreturn159define zeroext i1 @func_umin_back_zero_i1(i1 noundef zeroext %0) {160; CHECK-LABEL: func_umin_back_zero_i1:161; CHECK: # %bb.0:162; CHECK-NEXT: or %s0, 0, (0)1163; CHECK-NEXT: b.l.t (, %s10)164 ret i1 false165}166 167; Function Attrs: mustprogress nofree norecurse nosync nounwind readnone willreturn168define zeroext i8 @func_umin_back_zero_u8(i8 noundef zeroext %0) {169; CHECK-LABEL: func_umin_back_zero_u8:170; CHECK: # %bb.0:171; CHECK-NEXT: or %s0, 0, (0)1172; CHECK-NEXT: b.l.t (, %s10)173 ret i8 0174}175 176; Function Attrs: mustprogress nofree norecurse nosync nounwind readnone willreturn177define zeroext i16 @func_umin_back_zero_u16(i16 noundef zeroext %0) {178; CHECK-LABEL: func_umin_back_zero_u16:179; CHECK: # %bb.0:180; CHECK-NEXT: or %s0, 0, (0)1181; CHECK-NEXT: b.l.t (, %s10)182 ret i16 0183}184 185; Function Attrs: mustprogress nofree norecurse nosync nounwind readnone willreturn186define zeroext i32 @func_umin_back_zero_u32(i32 noundef zeroext %0) {187; CHECK-LABEL: func_umin_back_zero_u32:188; CHECK: # %bb.0:189; CHECK-NEXT: or %s0, 0, (0)1190; CHECK-NEXT: b.l.t (, %s10)191 ret i32 0192}193 194; Function Attrs: mustprogress nofree norecurse nosync nounwind readnone willreturn195define i64 @func_umin_back_zero_u64(i64 noundef %0) {196; CHECK-LABEL: func_umin_back_zero_u64:197; CHECK: # %bb.0:198; CHECK-NEXT: or %s0, 0, (0)1199; CHECK-NEXT: b.l.t (, %s10)200 ret i64 0201}202 203; Function Attrs: mustprogress nofree norecurse nosync nounwind readnone willreturn204define i128 @func_umin_back_zero_u128(i128 noundef %0) {205; CHECK-LABEL: func_umin_back_zero_u128:206; CHECK: # %bb.0:207; CHECK-NEXT: or %s0, 0, (0)1208; CHECK-NEXT: or %s1, 0, (0)1209; CHECK-NEXT: b.l.t (, %s10)210 ret i128 0211}212 213; Function Attrs: mustprogress nofree norecurse nosync nounwind readnone willreturn214define zeroext i1 @func_umin_fore_const_i1(i1 noundef returned zeroext %0) {215; CHECK-LABEL: func_umin_fore_const_i1:216; CHECK: # %bb.0:217; CHECK-NEXT: b.l.t (, %s10)218 ret i1 %0219}220 221; Function Attrs: mustprogress nofree norecurse nosync nounwind readnone willreturn222define zeroext i8 @func_umin_fore_const_u8(i8 noundef returned zeroext %0) {223; CHECK-LABEL: func_umin_fore_const_u8:224; CHECK: # %bb.0:225; CHECK-NEXT: b.l.t (, %s10)226 ret i8 %0227}228 229; Function Attrs: mustprogress nofree nosync nounwind readnone willreturn230define zeroext i16 @func_umin_fore_const_u16(i16 noundef zeroext %0) {231; CHECK-LABEL: func_umin_fore_const_u16:232; CHECK: # %bb.0:233; CHECK-NEXT: mins.w.sx %s0, %s0, (56)0234; CHECK-NEXT: adds.w.zx %s0, %s0, (0)1235; CHECK-NEXT: b.l.t (, %s10)236 %2 = tail call i16 @llvm.umin.i16(i16 %0, i16 255)237 ret i16 %2238}239 240; Function Attrs: mustprogress nofree nosync nounwind readnone willreturn241define zeroext i32 @func_umin_fore_const_u32(i32 noundef zeroext %0) {242; CHECK-LABEL: func_umin_fore_const_u32:243; CHECK: # %bb.0:244; CHECK-NEXT: cmpu.w %s1, %s0, (56)0245; CHECK-NEXT: cmov.w.ge %s0, (56)0, %s1246; CHECK-NEXT: adds.w.zx %s0, %s0, (0)1247; CHECK-NEXT: b.l.t (, %s10)248 %2 = tail call i32 @llvm.umin.i32(i32 %0, i32 255)249 ret i32 %2250}251 252; Function Attrs: mustprogress nofree nosync nounwind readnone willreturn253define i64 @func_umin_fore_const_u64(i64 noundef %0) {254; CHECK-LABEL: func_umin_fore_const_u64:255; CHECK: # %bb.0:256; CHECK-NEXT: cmpu.l %s1, %s0, (56)0257; CHECK-NEXT: cmov.l.ge %s0, (56)0, %s1258; CHECK-NEXT: b.l.t (, %s10)259 %2 = tail call i64 @llvm.umin.i64(i64 %0, i64 255)260 ret i64 %2261}262 263; Function Attrs: mustprogress nofree nosync nounwind readnone willreturn264define i128 @func_umin_fore_const_u128(i128 noundef %0) {265; CHECK-LABEL: func_umin_fore_const_u128:266; CHECK: # %bb.0:267; CHECK-NEXT: cmpu.l %s2, %s0, (56)0268; CHECK-NEXT: cmov.l.ge %s0, (56)0, %s2269; CHECK-NEXT: cmov.l.ne %s0, (56)0, %s1270; CHECK-NEXT: or %s1, 0, (0)1271; CHECK-NEXT: b.l.t (, %s10)272 %2 = tail call i128 @llvm.umin.i128(i128 %0, i128 255)273 ret i128 %2274}275 276; Function Attrs: mustprogress nofree norecurse nosync nounwind readnone willreturn277define zeroext i1 @func_umin_back_const_i1(i1 noundef returned zeroext %0) {278; CHECK-LABEL: func_umin_back_const_i1:279; CHECK: # %bb.0:280; CHECK-NEXT: b.l.t (, %s10)281 ret i1 %0282}283 284; Function Attrs: mustprogress nofree norecurse nosync nounwind readnone willreturn285define zeroext i8 @func_umin_back_const_u8(i8 noundef returned zeroext %0) {286; CHECK-LABEL: func_umin_back_const_u8:287; CHECK: # %bb.0:288; CHECK-NEXT: b.l.t (, %s10)289 ret i8 %0290}291 292; Function Attrs: mustprogress nofree nosync nounwind readnone willreturn293define zeroext i16 @func_umin_back_const_u16(i16 noundef zeroext %0) {294; CHECK-LABEL: func_umin_back_const_u16:295; CHECK: # %bb.0:296; CHECK-NEXT: mins.w.sx %s0, %s0, (56)0297; CHECK-NEXT: adds.w.zx %s0, %s0, (0)1298; CHECK-NEXT: b.l.t (, %s10)299 %2 = tail call i16 @llvm.umin.i16(i16 %0, i16 255)300 ret i16 %2301}302 303; Function Attrs: mustprogress nofree nosync nounwind readnone willreturn304define zeroext i32 @func_umin_back_const_u32(i32 noundef zeroext %0) {305; CHECK-LABEL: func_umin_back_const_u32:306; CHECK: # %bb.0:307; CHECK-NEXT: cmpu.w %s1, %s0, (56)0308; CHECK-NEXT: cmov.w.ge %s0, (56)0, %s1309; CHECK-NEXT: adds.w.zx %s0, %s0, (0)1310; CHECK-NEXT: b.l.t (, %s10)311 %2 = tail call i32 @llvm.umin.i32(i32 %0, i32 255)312 ret i32 %2313}314 315; Function Attrs: mustprogress nofree nosync nounwind readnone willreturn316define i64 @func_umin_back_const_u64(i64 noundef %0) {317; CHECK-LABEL: func_umin_back_const_u64:318; CHECK: # %bb.0:319; CHECK-NEXT: cmpu.l %s1, %s0, (56)0320; CHECK-NEXT: cmov.l.ge %s0, (56)0, %s1321; CHECK-NEXT: b.l.t (, %s10)322 %2 = tail call i64 @llvm.umin.i64(i64 %0, i64 255)323 ret i64 %2324}325 326; Function Attrs: mustprogress nofree nosync nounwind readnone willreturn327define i128 @func_umin_back_const_u128(i128 noundef %0) {328; CHECK-LABEL: func_umin_back_const_u128:329; CHECK: # %bb.0:330; CHECK-NEXT: cmpu.l %s2, %s0, (56)0331; CHECK-NEXT: cmov.l.ge %s0, (56)0, %s2332; CHECK-NEXT: cmov.l.ne %s0, (56)0, %s1333; CHECK-NEXT: or %s1, 0, (0)1334; CHECK-NEXT: b.l.t (, %s10)335 %2 = tail call i128 @llvm.umin.i128(i128 %0, i128 255)336 ret i128 %2337}338 339; Function Attrs: nocallback nofree nosync nounwind readnone speculatable willreturn340declare i32 @llvm.umin.i32(i32, i32)341 342; Function Attrs: nocallback nofree nosync nounwind readnone speculatable willreturn343declare i1 @llvm.umin.i1(i1, i1)344 345; Function Attrs: nocallback nofree nosync nounwind readnone speculatable willreturn346declare i8 @llvm.umin.i8(i8, i8)347 348; Function Attrs: nocallback nofree nosync nounwind readnone speculatable willreturn349declare i16 @llvm.umin.i16(i16, i16)350 351; Function Attrs: nocallback nofree nosync nounwind readnone speculatable willreturn352declare i64 @llvm.umin.i64(i64, i64)353 354; Function Attrs: nocallback nofree nosync nounwind readnone speculatable willreturn355declare i128 @llvm.umin.i128(i128, i128)356