550 lines · plain
1; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py2; RUN: llc < %s -mtriple=x86_64-unkown-unkown -mattr=+avx512bw -mattr=+avx512fp16 | FileCheck %s3 4declare <32 x half> @llvm.x86.avx512.sitofp.round.v32f16.v32i16(<32 x i16>, i32)5 6define <32 x half> @test_int_x86_avx512fp16_mask_cvtw2ph_512(<32 x i16> %arg0, <32 x half> %arg1, i32 %mask) {7; CHECK-LABEL: test_int_x86_avx512fp16_mask_cvtw2ph_512:8; CHECK: # %bb.0:9; CHECK-NEXT: kmovd %edi, %k110; CHECK-NEXT: vcvtw2ph %zmm0, %zmm1 {%k1}11; CHECK-NEXT: vmovaps %zmm1, %zmm012; CHECK-NEXT: retq13 %msk = bitcast i32 %mask to <32 x i1>14 %res0 = call <32 x half> @llvm.x86.avx512.sitofp.round.v32f16.v32i16(<32 x i16> %arg0, i32 4)15 %res = select <32 x i1> %msk, <32 x half> %res0, <32 x half> %arg116 ret <32 x half> %res17}18 19define <32 x half> @test_int_x86_avx512fp16_mask_cvtw2ph_512_2(<32 x i16> %arg0, <32 x half> %arg1, i32 %mask) {20; CHECK-LABEL: test_int_x86_avx512fp16_mask_cvtw2ph_512_2:21; CHECK: # %bb.0:22; CHECK-NEXT: kmovd %edi, %k123; CHECK-NEXT: vcvtw2ph %zmm0, %zmm1 {%k1}24; CHECK-NEXT: vmovaps %zmm1, %zmm025; CHECK-NEXT: retq26 %msk = bitcast i32 %mask to <32 x i1>27 %res0 = sitofp <32 x i16> %arg0 to <32 x half>28 %res = select <32 x i1> %msk, <32 x half> %res0, <32 x half> %arg129 ret <32 x half> %res30}31 32define <32 x half> @test_int_x86_avx512fp16_mask_cvtw2ph_512_b(ptr %arg0, <32 x half> %arg1, i32 %mask) {33; CHECK-LABEL: test_int_x86_avx512fp16_mask_cvtw2ph_512_b:34; CHECK: # %bb.0:35; CHECK-NEXT: kmovd %esi, %k136; CHECK-NEXT: vcvtw2ph (%rdi){1to32}, %zmm0 {%k1}37; CHECK-NEXT: retq38 %msk = bitcast i32 %mask to <32 x i1>39 %scalar = load i16, ptr %arg040 %scalar_in_vector = insertelement <32 x i16> undef, i16 %scalar, i32 041 %val = shufflevector <32 x i16> %scalar_in_vector, <32 x i16> undef, <32 x i32> zeroinitializer42 %res0 = call <32 x half> @llvm.x86.avx512.sitofp.round.v32f16.v32i16(<32 x i16> %val, i32 4)43 %res = select <32 x i1> %msk, <32 x half> %res0, <32 x half> %arg144 ret <32 x half> %res45}46 47define <32 x half> @test_int_x86_avx512fp16_mask_cvtw2ph_512_b_2(ptr %arg0, <32 x half> %arg1, i32 %mask) {48; CHECK-LABEL: test_int_x86_avx512fp16_mask_cvtw2ph_512_b_2:49; CHECK: # %bb.0:50; CHECK-NEXT: kmovd %esi, %k151; CHECK-NEXT: vcvtw2ph (%rdi){1to32}, %zmm0 {%k1}52; CHECK-NEXT: retq53 %msk = bitcast i32 %mask to <32 x i1>54 %scalar = load i16, ptr %arg055 %scalar_in_vector = insertelement <32 x i16> undef, i16 %scalar, i32 056 %val = shufflevector <32 x i16> %scalar_in_vector, <32 x i16> undef, <32 x i32> zeroinitializer57 %res0 = sitofp <32 x i16> %val to <32 x half>58 %res = select <32 x i1> %msk, <32 x half> %res0, <32 x half> %arg159 ret <32 x half> %res60}61 62define <32 x half> @test_int_x86_avx512fp16_mask_cvtw2ph_512_r(<32 x i16> %arg0, <32 x half> %arg1, i32 %mask) {63; CHECK-LABEL: test_int_x86_avx512fp16_mask_cvtw2ph_512_r:64; CHECK: # %bb.0:65; CHECK-NEXT: kmovd %edi, %k166; CHECK-NEXT: vcvtw2ph {ru-sae}, %zmm0, %zmm1 {%k1}67; CHECK-NEXT: vmovaps %zmm1, %zmm068; CHECK-NEXT: retq69 %msk = bitcast i32 %mask to <32 x i1>70 %res0 = call <32 x half> @llvm.x86.avx512.sitofp.round.v32f16.v32i16(<32 x i16> %arg0, i32 10)71 %res = select <32 x i1> %msk, <32 x half> %res0, <32 x half> %arg172 ret <32 x half> %res73}74 75define <32 x half> @test_int_x86_avx512fp16_mask_cvtw2ph_512_nomask(<32 x i16> %arg0) {76; CHECK-LABEL: test_int_x86_avx512fp16_mask_cvtw2ph_512_nomask:77; CHECK: # %bb.0:78; CHECK-NEXT: vcvtw2ph %zmm0, %zmm079; CHECK-NEXT: retq80 %res = call <32 x half> @llvm.x86.avx512.sitofp.round.v32f16.v32i16(<32 x i16> %arg0, i32 4)81 ret <32 x half> %res82}83 84define <32 x half> @test_int_x86_avx512fp16_mask_cvtw2ph_512_nomask_2(<32 x i16> %arg0) {85; CHECK-LABEL: test_int_x86_avx512fp16_mask_cvtw2ph_512_nomask_2:86; CHECK: # %bb.0:87; CHECK-NEXT: vcvtw2ph %zmm0, %zmm088; CHECK-NEXT: retq89 %res = sitofp <32 x i16> %arg0 to <32 x half>90 ret <32 x half> %res91}92 93define <32 x half> @test_int_x86_avx512fp16_mask_cvtw2ph_512_z(<32 x i16> %arg0, i32 %mask) {94; CHECK-LABEL: test_int_x86_avx512fp16_mask_cvtw2ph_512_z:95; CHECK: # %bb.0:96; CHECK-NEXT: kmovd %edi, %k197; CHECK-NEXT: vcvtw2ph %zmm0, %zmm0 {%k1} {z}98; CHECK-NEXT: retq99 %msk = bitcast i32 %mask to <32 x i1>100 %res0 = call <32 x half> @llvm.x86.avx512.sitofp.round.v32f16.v32i16(<32 x i16> %arg0, i32 4)101 %res = select <32 x i1> %msk, <32 x half> %res0, <32 x half> zeroinitializer102 ret <32 x half> %res103}104 105define <32 x half> @test_int_x86_avx512fp16_mask_cvtw2ph_512_z_2(<32 x i16> %arg0, i32 %mask) {106; CHECK-LABEL: test_int_x86_avx512fp16_mask_cvtw2ph_512_z_2:107; CHECK: # %bb.0:108; CHECK-NEXT: kmovd %edi, %k1109; CHECK-NEXT: vcvtw2ph %zmm0, %zmm0 {%k1} {z}110; CHECK-NEXT: retq111 %msk = bitcast i32 %mask to <32 x i1>112 %res0 = sitofp <32 x i16> %arg0 to <32 x half>113 %res = select <32 x i1> %msk, <32 x half> %res0, <32 x half> zeroinitializer114 ret <32 x half> %res115}116 117define <32 x half> @test_int_x86_avx512fp16_mask_cvtw2ph_512_load(ptr %arg0, <32 x half> %arg1, i32 %mask) {118; CHECK-LABEL: test_int_x86_avx512fp16_mask_cvtw2ph_512_load:119; CHECK: # %bb.0:120; CHECK-NEXT: kmovd %esi, %k1121; CHECK-NEXT: vcvtw2ph (%rdi), %zmm0 {%k1}122; CHECK-NEXT: retq123 %msk = bitcast i32 %mask to <32 x i1>124 %val = load <32 x i16>, ptr %arg0125 %res0 = call <32 x half> @llvm.x86.avx512.sitofp.round.v32f16.v32i16(<32 x i16> %val, i32 4)126 %res = select <32 x i1> %msk, <32 x half> %res0, <32 x half> %arg1127 ret <32 x half> %res128}129 130define <32 x half> @test_int_x86_avx512fp16_mask_cvtw2ph_512_load_2(ptr %arg0, <32 x half> %arg1, i32 %mask) {131; CHECK-LABEL: test_int_x86_avx512fp16_mask_cvtw2ph_512_load_2:132; CHECK: # %bb.0:133; CHECK-NEXT: kmovd %esi, %k1134; CHECK-NEXT: vcvtw2ph (%rdi), %zmm0 {%k1}135; CHECK-NEXT: retq136 %msk = bitcast i32 %mask to <32 x i1>137 %val = load <32 x i16>, ptr %arg0138 %res0 = sitofp <32 x i16> %val to <32 x half>139 %res = select <32 x i1> %msk, <32 x half> %res0, <32 x half> %arg1140 ret <32 x half> %res141}142 143declare <32 x i16> @llvm.x86.avx512fp16.mask.vcvtph2w.512(<32 x half>, <32 x i16>, i32, i32)144 145define <32 x i16> @test_int_x86_avx512fp16_mask_cvtph2w_512(<32 x half> %arg0, <32 x i16> %arg1, i32 %mask) {146; CHECK-LABEL: test_int_x86_avx512fp16_mask_cvtph2w_512:147; CHECK: # %bb.0:148; CHECK-NEXT: kmovd %edi, %k1149; CHECK-NEXT: vcvtph2w %zmm0, %zmm1 {%k1}150; CHECK-NEXT: vmovaps %zmm1, %zmm0151; CHECK-NEXT: retq152 %res = call <32 x i16> @llvm.x86.avx512fp16.mask.vcvtph2w.512(<32 x half> %arg0, <32 x i16> %arg1, i32 %mask, i32 4)153 ret <32 x i16> %res154}155 156define <32 x i16> @test_int_x86_avx512fp16_mask_cvtph2w_512_b(ptr %arg0, <32 x i16> %arg1, i32 %mask) {157; CHECK-LABEL: test_int_x86_avx512fp16_mask_cvtph2w_512_b:158; CHECK: # %bb.0:159; CHECK-NEXT: kmovd %esi, %k1160; CHECK-NEXT: vcvtph2w (%rdi){1to32}, %zmm0 {%k1}161; CHECK-NEXT: retq162 %scalar = load half, ptr %arg0163 %scalar_in_vector = insertelement <32 x half> undef, half %scalar, i32 0164 %val = shufflevector <32 x half> %scalar_in_vector, <32 x half> undef, <32 x i32> zeroinitializer165 %res = call <32 x i16> @llvm.x86.avx512fp16.mask.vcvtph2w.512(<32 x half> %val, <32 x i16> %arg1, i32 %mask, i32 4)166 ret <32 x i16> %res167}168 169define <32 x i16> @test_int_x86_avx512fp16_mask_cvtph2w_512_r(<32 x half> %arg0, <32 x i16> %arg1, i32 %mask) {170; CHECK-LABEL: test_int_x86_avx512fp16_mask_cvtph2w_512_r:171; CHECK: # %bb.0:172; CHECK-NEXT: kmovd %edi, %k1173; CHECK-NEXT: vcvtph2w {rd-sae}, %zmm0, %zmm1 {%k1}174; CHECK-NEXT: vmovaps %zmm1, %zmm0175; CHECK-NEXT: retq176 %res = call <32 x i16> @llvm.x86.avx512fp16.mask.vcvtph2w.512(<32 x half> %arg0, <32 x i16> %arg1, i32 %mask, i32 9)177 ret <32 x i16> %res178}179 180define <32 x i16> @test_int_x86_avx512fp16_mask_cvtph2w_512_nomask(<32 x half> %arg0, <32 x i16> %arg1) {181; CHECK-LABEL: test_int_x86_avx512fp16_mask_cvtph2w_512_nomask:182; CHECK: # %bb.0:183; CHECK-NEXT: vcvtph2w %zmm0, %zmm0184; CHECK-NEXT: retq185 %res = call <32 x i16> @llvm.x86.avx512fp16.mask.vcvtph2w.512(<32 x half> %arg0, <32 x i16> %arg1, i32 -1, i32 4)186 ret <32 x i16> %res187}188 189define <32 x i16> @test_int_x86_avx512fp16_mask_cvtph2w_512_z(<32 x half> %arg0, i32 %mask) {190; CHECK-LABEL: test_int_x86_avx512fp16_mask_cvtph2w_512_z:191; CHECK: # %bb.0:192; CHECK-NEXT: kmovd %edi, %k1193; CHECK-NEXT: vcvtph2w %zmm0, %zmm0 {%k1} {z}194; CHECK-NEXT: retq195 %res = call <32 x i16> @llvm.x86.avx512fp16.mask.vcvtph2w.512(<32 x half> %arg0, <32 x i16> zeroinitializer, i32 %mask, i32 4)196 ret <32 x i16> %res197}198 199define <32 x i16> @test_int_x86_avx512fp16_mask_cvtph2w_512_load(ptr %arg0, <32 x i16> %arg1, i32 %mask) {200; CHECK-LABEL: test_int_x86_avx512fp16_mask_cvtph2w_512_load:201; CHECK: # %bb.0:202; CHECK-NEXT: kmovd %esi, %k1203; CHECK-NEXT: vcvtph2w (%rdi), %zmm0 {%k1}204; CHECK-NEXT: retq205 %val = load <32 x half>, ptr %arg0206 %res = call <32 x i16> @llvm.x86.avx512fp16.mask.vcvtph2w.512(<32 x half> %val, <32 x i16> %arg1, i32 %mask, i32 4)207 ret <32 x i16> %res208}209 210 211declare <32 x half> @llvm.x86.avx512.uitofp.round.v32f16.v32i16(<32 x i16>, i32)212 213define <32 x half> @test_int_x86_avx512fp16_mask_cvtuw2ph_512(<32 x i16> %arg0, <32 x half> %arg1, i32 %mask) {214; CHECK-LABEL: test_int_x86_avx512fp16_mask_cvtuw2ph_512:215; CHECK: # %bb.0:216; CHECK-NEXT: kmovd %edi, %k1217; CHECK-NEXT: vcvtuw2ph %zmm0, %zmm1 {%k1}218; CHECK-NEXT: vmovaps %zmm1, %zmm0219; CHECK-NEXT: retq220 %msk = bitcast i32 %mask to <32 x i1>221 %res0 = call <32 x half> @llvm.x86.avx512.uitofp.round.v32f16.v32i16(<32 x i16> %arg0, i32 4)222 %res = select <32 x i1> %msk, <32 x half> %res0, <32 x half> %arg1223 ret <32 x half> %res224}225 226define <32 x half> @test_int_x86_avx512fp16_mask_cvtuw2ph_512_2(<32 x i16> %arg0, <32 x half> %arg1, i32 %mask) {227; CHECK-LABEL: test_int_x86_avx512fp16_mask_cvtuw2ph_512_2:228; CHECK: # %bb.0:229; CHECK-NEXT: kmovd %edi, %k1230; CHECK-NEXT: vcvtuw2ph %zmm0, %zmm1 {%k1}231; CHECK-NEXT: vmovaps %zmm1, %zmm0232; CHECK-NEXT: retq233 %msk = bitcast i32 %mask to <32 x i1>234 %res0 = uitofp <32 x i16> %arg0 to <32 x half>235 %res = select <32 x i1> %msk, <32 x half> %res0, <32 x half> %arg1236 ret <32 x half> %res237}238 239define <32 x half> @test_int_x86_avx512fp16_mask_cvtuw2ph_512_b(ptr %arg0, <32 x half> %arg1, i32 %mask) {240; CHECK-LABEL: test_int_x86_avx512fp16_mask_cvtuw2ph_512_b:241; CHECK: # %bb.0:242; CHECK-NEXT: kmovd %esi, %k1243; CHECK-NEXT: vcvtuw2ph (%rdi){1to32}, %zmm0 {%k1}244; CHECK-NEXT: retq245 %msk = bitcast i32 %mask to <32 x i1>246 %scalar = load i16, ptr %arg0247 %scalar_in_vector = insertelement <32 x i16> undef, i16 %scalar, i32 0248 %val = shufflevector <32 x i16> %scalar_in_vector, <32 x i16> undef, <32 x i32> zeroinitializer249 %res0 = call <32 x half> @llvm.x86.avx512.uitofp.round.v32f16.v32i16(<32 x i16> %val, i32 4)250 %res = select <32 x i1> %msk, <32 x half> %res0, <32 x half> %arg1251 ret <32 x half> %res252}253 254define <32 x half> @test_int_x86_avx512fp16_mask_cvtuw2ph_512_b_2(ptr %arg0, <32 x half> %arg1, i32 %mask) {255; CHECK-LABEL: test_int_x86_avx512fp16_mask_cvtuw2ph_512_b_2:256; CHECK: # %bb.0:257; CHECK-NEXT: kmovd %esi, %k1258; CHECK-NEXT: vcvtuw2ph (%rdi){1to32}, %zmm0 {%k1}259; CHECK-NEXT: retq260 %msk = bitcast i32 %mask to <32 x i1>261 %scalar = load i16, ptr %arg0262 %scalar_in_vector = insertelement <32 x i16> undef, i16 %scalar, i32 0263 %val = shufflevector <32 x i16> %scalar_in_vector, <32 x i16> undef, <32 x i32> zeroinitializer264 %res0 = uitofp <32 x i16> %val to <32 x half>265 %res = select <32 x i1> %msk, <32 x half> %res0, <32 x half> %arg1266 ret <32 x half> %res267}268 269define <32 x half> @test_int_x86_avx512fp16_mask_cvtuw2ph_512_r(<32 x i16> %arg0, <32 x half> %arg1, i32 %mask) {270; CHECK-LABEL: test_int_x86_avx512fp16_mask_cvtuw2ph_512_r:271; CHECK: # %bb.0:272; CHECK-NEXT: kmovd %edi, %k1273; CHECK-NEXT: vcvtuw2ph {ru-sae}, %zmm0, %zmm1 {%k1}274; CHECK-NEXT: vmovaps %zmm1, %zmm0275; CHECK-NEXT: retq276 %msk = bitcast i32 %mask to <32 x i1>277 %res0 = call <32 x half> @llvm.x86.avx512.uitofp.round.v32f16.v32i16(<32 x i16> %arg0, i32 10)278 %res = select <32 x i1> %msk, <32 x half> %res0, <32 x half> %arg1279 ret <32 x half> %res280}281 282define <32 x half> @test_int_x86_avx512fp16_mask_cvtuw2ph_512_nomask(<32 x i16> %arg0) {283; CHECK-LABEL: test_int_x86_avx512fp16_mask_cvtuw2ph_512_nomask:284; CHECK: # %bb.0:285; CHECK-NEXT: vcvtuw2ph %zmm0, %zmm0286; CHECK-NEXT: retq287 %res = call <32 x half> @llvm.x86.avx512.uitofp.round.v32f16.v32i16(<32 x i16> %arg0, i32 4)288 ret <32 x half> %res289}290 291define <32 x half> @test_int_x86_avx512fp16_mask_cvtuw2ph_512_nomask_2(<32 x i16> %arg0) {292; CHECK-LABEL: test_int_x86_avx512fp16_mask_cvtuw2ph_512_nomask_2:293; CHECK: # %bb.0:294; CHECK-NEXT: vcvtuw2ph %zmm0, %zmm0295; CHECK-NEXT: retq296 %res = uitofp <32 x i16> %arg0 to <32 x half>297 ret <32 x half> %res298}299 300define <32 x half> @test_int_x86_avx512fp16_mask_cvtuw2ph_512_z(<32 x i16> %arg0, i32 %mask) {301; CHECK-LABEL: test_int_x86_avx512fp16_mask_cvtuw2ph_512_z:302; CHECK: # %bb.0:303; CHECK-NEXT: kmovd %edi, %k1304; CHECK-NEXT: vcvtuw2ph %zmm0, %zmm0 {%k1} {z}305; CHECK-NEXT: retq306 %msk = bitcast i32 %mask to <32 x i1>307 %res0 = call <32 x half> @llvm.x86.avx512.uitofp.round.v32f16.v32i16(<32 x i16> %arg0, i32 4)308 %res = select <32 x i1> %msk, <32 x half> %res0, <32 x half> zeroinitializer309 ret <32 x half> %res310}311 312define <32 x half> @test_int_x86_avx512fp16_mask_cvtuw2ph_512_z_2(<32 x i16> %arg0, i32 %mask) {313; CHECK-LABEL: test_int_x86_avx512fp16_mask_cvtuw2ph_512_z_2:314; CHECK: # %bb.0:315; CHECK-NEXT: kmovd %edi, %k1316; CHECK-NEXT: vcvtuw2ph %zmm0, %zmm0 {%k1} {z}317; CHECK-NEXT: retq318 %msk = bitcast i32 %mask to <32 x i1>319 %res0 = uitofp <32 x i16> %arg0 to <32 x half>320 %res = select <32 x i1> %msk, <32 x half> %res0, <32 x half> zeroinitializer321 ret <32 x half> %res322}323 324define <32 x half> @test_int_x86_avx512fp16_mask_cvtuw2ph_512_load(ptr %arg0, <32 x half> %arg1, i32 %mask) {325; CHECK-LABEL: test_int_x86_avx512fp16_mask_cvtuw2ph_512_load:326; CHECK: # %bb.0:327; CHECK-NEXT: kmovd %esi, %k1328; CHECK-NEXT: vcvtuw2ph (%rdi), %zmm0 {%k1}329; CHECK-NEXT: retq330 %msk = bitcast i32 %mask to <32 x i1>331 %val = load <32 x i16>, ptr %arg0332 %res0 = call <32 x half> @llvm.x86.avx512.uitofp.round.v32f16.v32i16(<32 x i16> %val, i32 4)333 %res = select <32 x i1> %msk, <32 x half> %res0, <32 x half> %arg1334 ret <32 x half> %res335}336 337define <32 x half> @test_int_x86_avx512fp16_mask_cvtuw2ph_512_load_2(ptr %arg0, <32 x half> %arg1, i32 %mask) {338; CHECK-LABEL: test_int_x86_avx512fp16_mask_cvtuw2ph_512_load_2:339; CHECK: # %bb.0:340; CHECK-NEXT: kmovd %esi, %k1341; CHECK-NEXT: vcvtuw2ph (%rdi), %zmm0 {%k1}342; CHECK-NEXT: retq343 %msk = bitcast i32 %mask to <32 x i1>344 %val = load <32 x i16>, ptr %arg0345 %res0 = uitofp <32 x i16> %val to <32 x half>346 %res = select <32 x i1> %msk, <32 x half> %res0, <32 x half> %arg1347 ret <32 x half> %res348}349 350declare <32 x i16> @llvm.x86.avx512fp16.mask.vcvtph2uw.512(<32 x half>, <32 x i16>, i32, i32)351 352define <32 x i16> @test_int_x86_avx512fp16_mask_cvtph2uw_512(<32 x half> %arg0, <32 x i16> %arg1, i32 %mask) {353; CHECK-LABEL: test_int_x86_avx512fp16_mask_cvtph2uw_512:354; CHECK: # %bb.0:355; CHECK-NEXT: kmovd %edi, %k1356; CHECK-NEXT: vcvtph2uw %zmm0, %zmm1 {%k1}357; CHECK-NEXT: vmovaps %zmm1, %zmm0358; CHECK-NEXT: retq359 %res = call <32 x i16> @llvm.x86.avx512fp16.mask.vcvtph2uw.512(<32 x half> %arg0, <32 x i16> %arg1, i32 %mask, i32 4)360 ret <32 x i16> %res361}362 363define <32 x i16> @test_int_x86_avx512fp16_mask_cvtph2uw_512_b(ptr %arg0, <32 x i16> %arg1, i32 %mask) {364; CHECK-LABEL: test_int_x86_avx512fp16_mask_cvtph2uw_512_b:365; CHECK: # %bb.0:366; CHECK-NEXT: kmovd %esi, %k1367; CHECK-NEXT: vcvtph2uw (%rdi){1to32}, %zmm0 {%k1}368; CHECK-NEXT: retq369 %scalar = load half, ptr %arg0370 %scalar_in_vector = insertelement <32 x half> undef, half %scalar, i32 0371 %val = shufflevector <32 x half> %scalar_in_vector, <32 x half> undef, <32 x i32> zeroinitializer372 %res = call <32 x i16> @llvm.x86.avx512fp16.mask.vcvtph2uw.512(<32 x half> %val, <32 x i16> %arg1, i32 %mask, i32 4)373 ret <32 x i16> %res374}375 376define <32 x i16> @test_int_x86_avx512fp16_mask_cvtph2uw_512_r(<32 x half> %arg0, <32 x i16> %arg1, i32 %mask) {377; CHECK-LABEL: test_int_x86_avx512fp16_mask_cvtph2uw_512_r:378; CHECK: # %bb.0:379; CHECK-NEXT: kmovd %edi, %k1380; CHECK-NEXT: vcvtph2uw {rd-sae}, %zmm0, %zmm1 {%k1}381; CHECK-NEXT: vmovaps %zmm1, %zmm0382; CHECK-NEXT: retq383 %res = call <32 x i16> @llvm.x86.avx512fp16.mask.vcvtph2uw.512(<32 x half> %arg0, <32 x i16> %arg1, i32 %mask, i32 9)384 ret <32 x i16> %res385}386 387define <32 x i16> @test_int_x86_avx512fp16_mask_cvtph2uw_512_nomask(<32 x half> %arg0, <32 x i16> %arg1) {388; CHECK-LABEL: test_int_x86_avx512fp16_mask_cvtph2uw_512_nomask:389; CHECK: # %bb.0:390; CHECK-NEXT: vcvtph2uw %zmm0, %zmm0391; CHECK-NEXT: retq392 %res = call <32 x i16> @llvm.x86.avx512fp16.mask.vcvtph2uw.512(<32 x half> %arg0, <32 x i16> %arg1, i32 -1, i32 4)393 ret <32 x i16> %res394}395 396define <32 x i16> @test_int_x86_avx512fp16_mask_cvtph2uw_512_z(<32 x half> %arg0, i32 %mask) {397; CHECK-LABEL: test_int_x86_avx512fp16_mask_cvtph2uw_512_z:398; CHECK: # %bb.0:399; CHECK-NEXT: kmovd %edi, %k1400; CHECK-NEXT: vcvtph2uw %zmm0, %zmm0 {%k1} {z}401; CHECK-NEXT: retq402 %res = call <32 x i16> @llvm.x86.avx512fp16.mask.vcvtph2uw.512(<32 x half> %arg0, <32 x i16> zeroinitializer, i32 %mask, i32 4)403 ret <32 x i16> %res404}405 406define <32 x i16> @test_int_x86_avx512fp16_mask_cvtph2uw_512_load(ptr %arg0, <32 x i16> %arg1, i32 %mask) {407; CHECK-LABEL: test_int_x86_avx512fp16_mask_cvtph2uw_512_load:408; CHECK: # %bb.0:409; CHECK-NEXT: kmovd %esi, %k1410; CHECK-NEXT: vcvtph2uw (%rdi), %zmm0 {%k1}411; CHECK-NEXT: retq412 %val = load <32 x half>, ptr %arg0413 %res = call <32 x i16> @llvm.x86.avx512fp16.mask.vcvtph2uw.512(<32 x half> %val, <32 x i16> %arg1, i32 %mask, i32 4)414 ret <32 x i16> %res415}416 417declare <32 x i16> @llvm.x86.avx512fp16.mask.vcvttph2w.512(<32 x half>, <32 x i16>, i32, i32)418 419define <32 x i16> @test_int_x86_avx512fp16_mask_cvttph2w_512(<32 x half> %arg0, <32 x i16> %arg1, i32 %mask) {420; CHECK-LABEL: test_int_x86_avx512fp16_mask_cvttph2w_512:421; CHECK: # %bb.0:422; CHECK-NEXT: kmovd %edi, %k1423; CHECK-NEXT: vcvttph2w %zmm0, %zmm1 {%k1}424; CHECK-NEXT: vmovaps %zmm1, %zmm0425; CHECK-NEXT: retq426 %res = call <32 x i16> @llvm.x86.avx512fp16.mask.vcvttph2w.512(<32 x half> %arg0, <32 x i16> %arg1, i32 %mask, i32 4)427 ret <32 x i16> %res428}429 430define <32 x i16> @test_int_x86_avx512fp16_mask_cvttph2w_512_b(ptr %arg0, <32 x i16> %arg1, i32 %mask) {431; CHECK-LABEL: test_int_x86_avx512fp16_mask_cvttph2w_512_b:432; CHECK: # %bb.0:433; CHECK-NEXT: kmovd %esi, %k1434; CHECK-NEXT: vcvttph2w (%rdi){1to32}, %zmm0 {%k1}435; CHECK-NEXT: retq436 %scalar = load half, ptr %arg0437 %scalar_in_vector = insertelement <32 x half> undef, half %scalar, i32 0438 %val = shufflevector <32 x half> %scalar_in_vector, <32 x half> undef, <32 x i32> zeroinitializer439 %res = call <32 x i16> @llvm.x86.avx512fp16.mask.vcvttph2w.512(<32 x half> %val, <32 x i16> %arg1, i32 %mask, i32 4)440 ret <32 x i16> %res441}442 443define <32 x i16> @test_int_x86_avx512fp16_mask_cvttph2w_512_sae(<32 x half> %arg0, <32 x i16> %arg1, i32 %mask) {444; CHECK-LABEL: test_int_x86_avx512fp16_mask_cvttph2w_512_sae:445; CHECK: # %bb.0:446; CHECK-NEXT: kmovd %edi, %k1447; CHECK-NEXT: vcvttph2w {sae}, %zmm0, %zmm1 {%k1}448; CHECK-NEXT: vmovaps %zmm1, %zmm0449; CHECK-NEXT: retq450 %res = call <32 x i16> @llvm.x86.avx512fp16.mask.vcvttph2w.512(<32 x half> %arg0, <32 x i16> %arg1, i32 %mask, i32 8)451 ret <32 x i16> %res452}453 454define <32 x i16> @test_int_x86_avx512fp16_mask_cvttph2w_512_nomask(<32 x half> %arg0, <32 x i16> %arg1) {455; CHECK-LABEL: test_int_x86_avx512fp16_mask_cvttph2w_512_nomask:456; CHECK: # %bb.0:457; CHECK-NEXT: vcvttph2w %zmm0, %zmm0458; CHECK-NEXT: retq459 %res = call <32 x i16> @llvm.x86.avx512fp16.mask.vcvttph2w.512(<32 x half> %arg0, <32 x i16> %arg1, i32 -1, i32 4)460 ret <32 x i16> %res461}462 463define <32 x i16> @test_int_x86_avx512fp16_mask_cvttph2w_512_z(<32 x half> %arg0, i32 %mask) {464; CHECK-LABEL: test_int_x86_avx512fp16_mask_cvttph2w_512_z:465; CHECK: # %bb.0:466; CHECK-NEXT: kmovd %edi, %k1467; CHECK-NEXT: vcvttph2w %zmm0, %zmm0 {%k1} {z}468; CHECK-NEXT: retq469 %res = call <32 x i16> @llvm.x86.avx512fp16.mask.vcvttph2w.512(<32 x half> %arg0, <32 x i16> zeroinitializer, i32 %mask, i32 4)470 ret <32 x i16> %res471}472 473define <32 x i16> @test_int_x86_avx512fp16_mask_cvttph2w_512_load(ptr %arg0, <32 x i16> %arg1, i32 %mask) {474; CHECK-LABEL: test_int_x86_avx512fp16_mask_cvttph2w_512_load:475; CHECK: # %bb.0:476; CHECK-NEXT: kmovd %esi, %k1477; CHECK-NEXT: vcvttph2w (%rdi), %zmm0 {%k1}478; CHECK-NEXT: retq479 %val = load <32 x half>, ptr %arg0480 %res = call <32 x i16> @llvm.x86.avx512fp16.mask.vcvttph2w.512(<32 x half> %val, <32 x i16> %arg1, i32 %mask, i32 4)481 ret <32 x i16> %res482}483 484declare <32 x i16> @llvm.x86.avx512fp16.mask.vcvttph2uw.512(<32 x half>, <32 x i16>, i32, i32)485 486define <32 x i16> @test_int_x86_avx512fp16_mask_cvttph2uw_512(<32 x half> %arg0, <32 x i16> %arg1, i32 %mask) {487; CHECK-LABEL: test_int_x86_avx512fp16_mask_cvttph2uw_512:488; CHECK: # %bb.0:489; CHECK-NEXT: kmovd %edi, %k1490; CHECK-NEXT: vcvttph2uw %zmm0, %zmm1 {%k1}491; CHECK-NEXT: vmovaps %zmm1, %zmm0492; CHECK-NEXT: retq493 %res = call <32 x i16> @llvm.x86.avx512fp16.mask.vcvttph2uw.512(<32 x half> %arg0, <32 x i16> %arg1, i32 %mask, i32 4)494 ret <32 x i16> %res495}496 497define <32 x i16> @test_int_x86_avx512fp16_mask_cvttph2uw_512_b(ptr %arg0, <32 x i16> %arg1, i32 %mask) {498; CHECK-LABEL: test_int_x86_avx512fp16_mask_cvttph2uw_512_b:499; CHECK: # %bb.0:500; CHECK-NEXT: kmovd %esi, %k1501; CHECK-NEXT: vcvttph2uw (%rdi){1to32}, %zmm0 {%k1}502; CHECK-NEXT: retq503 %scalar = load half, ptr %arg0504 %scalar_in_vector = insertelement <32 x half> undef, half %scalar, i32 0505 %val = shufflevector <32 x half> %scalar_in_vector, <32 x half> undef, <32 x i32> zeroinitializer506 %res = call <32 x i16> @llvm.x86.avx512fp16.mask.vcvttph2uw.512(<32 x half> %val, <32 x i16> %arg1, i32 %mask, i32 4)507 ret <32 x i16> %res508}509 510define <32 x i16> @test_int_x86_avx512fp16_mask_cvttph2uw_512_sae(<32 x half> %arg0, <32 x i16> %arg1, i32 %mask) {511; CHECK-LABEL: test_int_x86_avx512fp16_mask_cvttph2uw_512_sae:512; CHECK: # %bb.0:513; CHECK-NEXT: kmovd %edi, %k1514; CHECK-NEXT: vcvttph2uw {sae}, %zmm0, %zmm1 {%k1}515; CHECK-NEXT: vmovaps %zmm1, %zmm0516; CHECK-NEXT: retq517 %res = call <32 x i16> @llvm.x86.avx512fp16.mask.vcvttph2uw.512(<32 x half> %arg0, <32 x i16> %arg1, i32 %mask, i32 8)518 ret <32 x i16> %res519}520 521define <32 x i16> @test_int_x86_avx512fp16_mask_cvttph2uw_512_nomask(<32 x half> %arg0, <32 x i16> %arg1) {522; CHECK-LABEL: test_int_x86_avx512fp16_mask_cvttph2uw_512_nomask:523; CHECK: # %bb.0:524; CHECK-NEXT: vcvttph2uw %zmm0, %zmm0525; CHECK-NEXT: retq526 %res = call <32 x i16> @llvm.x86.avx512fp16.mask.vcvttph2uw.512(<32 x half> %arg0, <32 x i16> %arg1, i32 -1, i32 4)527 ret <32 x i16> %res528}529 530define <32 x i16> @test_int_x86_avx512fp16_mask_cvttph2uw_512_z(<32 x half> %arg0, i32 %mask) {531; CHECK-LABEL: test_int_x86_avx512fp16_mask_cvttph2uw_512_z:532; CHECK: # %bb.0:533; CHECK-NEXT: kmovd %edi, %k1534; CHECK-NEXT: vcvttph2uw %zmm0, %zmm0 {%k1} {z}535; CHECK-NEXT: retq536 %res = call <32 x i16> @llvm.x86.avx512fp16.mask.vcvttph2uw.512(<32 x half> %arg0, <32 x i16> zeroinitializer, i32 %mask, i32 4)537 ret <32 x i16> %res538}539 540define <32 x i16> @test_int_x86_avx512fp16_mask_cvttph2uw_512_load(ptr %arg0, <32 x i16> %arg1, i32 %mask) {541; CHECK-LABEL: test_int_x86_avx512fp16_mask_cvttph2uw_512_load:542; CHECK: # %bb.0:543; CHECK-NEXT: kmovd %esi, %k1544; CHECK-NEXT: vcvttph2uw (%rdi), %zmm0 {%k1}545; CHECK-NEXT: retq546 %val = load <32 x half>, ptr %arg0547 %res = call <32 x i16> @llvm.x86.avx512fp16.mask.vcvttph2uw.512(<32 x half> %val, <32 x i16> %arg1, i32 %mask, i32 4)548 ret <32 x i16> %res549}550