593 lines · plain
1; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py2; RUN: llc < %s -mtriple=i686-unknown-unknown -mattr=+avx512fp16 --show-mc-encoding | FileCheck %s --check-prefixes=CHECK,X863; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=+avx512fp16 --show-mc-encoding | FileCheck %s --check-prefixes=CHECK,X644 5 6declare <32 x half> @llvm.x86.avx512fp16.vfmadd.ph.512(<32 x half>, <32 x half>, <32 x half>, i32)7 8define <32 x half> @test_x86_vfnmadd_ph_z(<32 x half> %a0, <32 x half> %a1, <32 x half> %a2) {9; CHECK-LABEL: test_x86_vfnmadd_ph_z:10; CHECK: # %bb.0:11; CHECK-NEXT: vfnmadd213ph %zmm2, %zmm1, %zmm0 # encoding: [0x62,0xf6,0x75,0x48,0xac,0xc2]12; CHECK-NEXT: ret{{[l|q]}} # encoding: [0xc3]13 %1 = fsub <32 x half> <half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00>, %a114 %2 = call <32 x half> @llvm.fma.v32f16(<32 x half> %a0, <32 x half> %1, <32 x half> %a2)15 ret <32 x half> %216}17 18define <32 x half> @test_mask_vfnmadd_ph(<32 x half> %a0, <32 x half> %a1, <32 x half> %a2, i32 %mask) {19; X86-LABEL: test_mask_vfnmadd_ph:20; X86: # %bb.0:21; X86-NEXT: kmovd {{[0-9]+}}(%esp), %k1 # encoding: [0xc4,0xe1,0xf9,0x90,0x4c,0x24,0x04]22; X86-NEXT: vfnmadd132ph %zmm1, %zmm2, %zmm0 {%k1} # encoding: [0x62,0xf6,0x6d,0x49,0x9c,0xc1]23; X86-NEXT: retl # encoding: [0xc3]24;25; X64-LABEL: test_mask_vfnmadd_ph:26; X64: # %bb.0:27; X64-NEXT: kmovd %edi, %k1 # encoding: [0xc5,0xfb,0x92,0xcf]28; X64-NEXT: vfnmadd132ph %zmm1, %zmm2, %zmm0 {%k1} # encoding: [0x62,0xf6,0x6d,0x49,0x9c,0xc1]29; X64-NEXT: retq # encoding: [0xc3]30 %1 = fsub <32 x half> <half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00>, %a131 %2 = call <32 x half> @llvm.fma.v32f16(<32 x half> %a0, <32 x half> %1, <32 x half> %a2)32 %3 = bitcast i32 %mask to <32 x i1>33 %4 = select <32 x i1> %3, <32 x half> %2, <32 x half> %a034 ret <32 x half> %435}36 37define <32 x half> @test_x86_vfnmsubph_z(<32 x half> %a0, <32 x half> %a1, <32 x half> %a2) {38; CHECK-LABEL: test_x86_vfnmsubph_z:39; CHECK: # %bb.0:40; CHECK-NEXT: vfnmsub213ph %zmm2, %zmm1, %zmm0 # encoding: [0x62,0xf6,0x75,0x48,0xae,0xc2]41; CHECK-NEXT: ret{{[l|q]}} # encoding: [0xc3]42 %1 = fsub <32 x half> <half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00>, %a143 %2 = fsub <32 x half> <half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00>, %a244 %3 = call <32 x half> @llvm.fma.v32f16(<32 x half> %a0, <32 x half> %1, <32 x half> %2)45 ret <32 x half> %346}47 48define <32 x half> @test_mask_vfnmsub_ph(<32 x half> %a0, <32 x half> %a1, <32 x half> %a2, i32 %mask) {49; X86-LABEL: test_mask_vfnmsub_ph:50; X86: # %bb.0:51; X86-NEXT: kmovd {{[0-9]+}}(%esp), %k1 # encoding: [0xc4,0xe1,0xf9,0x90,0x4c,0x24,0x04]52; X86-NEXT: vfnmsub132ph %zmm1, %zmm2, %zmm0 {%k1} # encoding: [0x62,0xf6,0x6d,0x49,0x9e,0xc1]53; X86-NEXT: retl # encoding: [0xc3]54;55; X64-LABEL: test_mask_vfnmsub_ph:56; X64: # %bb.0:57; X64-NEXT: kmovd %edi, %k1 # encoding: [0xc5,0xfb,0x92,0xcf]58; X64-NEXT: vfnmsub132ph %zmm1, %zmm2, %zmm0 {%k1} # encoding: [0x62,0xf6,0x6d,0x49,0x9e,0xc1]59; X64-NEXT: retq # encoding: [0xc3]60 %1 = fsub <32 x half> <half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00>, %a161 %2 = fsub <32 x half> <half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00>, %a262 %3 = call <32 x half> @llvm.fma.v32f16(<32 x half> %a0, <32 x half> %1, <32 x half> %2)63 %4 = bitcast i32 %mask to <32 x i1>64 %5 = select <32 x i1> %4, <32 x half> %3, <32 x half> %a065 ret <32 x half> %566}67 68define <32 x half> @test_x86_vfmaddsubph_z(<32 x half> %a0, <32 x half> %a1, <32 x half> %a2) {69; CHECK-LABEL: test_x86_vfmaddsubph_z:70; CHECK: # %bb.0:71; CHECK-NEXT: vfmaddsub213ph %zmm2, %zmm1, %zmm0 # encoding: [0x62,0xf6,0x75,0x48,0xa6,0xc2]72; CHECK-NEXT: ret{{[l|q]}} # encoding: [0xc3]73 %res = call <32 x half> @llvm.x86.avx512fp16.vfmaddsub.ph.512(<32 x half> %a0, <32 x half> %a1, <32 x half> %a2, i32 4) #274 ret <32 x half> %res75}76 77define <32 x half> @test_mask_fmaddsub_ph(<32 x half> %a, <32 x half> %b, <32 x half> %c, i32 %mask) {78; X86-LABEL: test_mask_fmaddsub_ph:79; X86: # %bb.0:80; X86-NEXT: kmovd {{[0-9]+}}(%esp), %k1 # encoding: [0xc4,0xe1,0xf9,0x90,0x4c,0x24,0x04]81; X86-NEXT: vfmaddsub132ph %zmm1, %zmm2, %zmm0 {%k1} # encoding: [0x62,0xf6,0x6d,0x49,0x96,0xc1]82; X86-NEXT: retl # encoding: [0xc3]83;84; X64-LABEL: test_mask_fmaddsub_ph:85; X64: # %bb.0:86; X64-NEXT: kmovd %edi, %k1 # encoding: [0xc5,0xfb,0x92,0xcf]87; X64-NEXT: vfmaddsub132ph %zmm1, %zmm2, %zmm0 {%k1} # encoding: [0x62,0xf6,0x6d,0x49,0x96,0xc1]88; X64-NEXT: retq # encoding: [0xc3]89 %res = call <32 x half> @llvm.x86.avx512fp16.vfmaddsub.ph.512(<32 x half> %a, <32 x half> %b, <32 x half> %c, i32 4)90 %bc = bitcast i32 %mask to <32 x i1>91 %sel = select <32 x i1> %bc, <32 x half> %res, <32 x half> %a92 ret <32 x half> %sel93}94 95declare <32 x half> @llvm.x86.avx512fp16.vfmaddsub.ph.512(<32 x half>, <32 x half>, <32 x half>, i32) nounwind readnone96 97define <32 x half>@test_int_x86_avx512_mask_vfmaddsub_ph_512(<32 x half> %x0, <32 x half> %x1, <32 x half> %x2, i32 %x3){98; X86-LABEL: test_int_x86_avx512_mask_vfmaddsub_ph_512:99; X86: # %bb.0:100; X86-NEXT: kmovd {{[0-9]+}}(%esp), %k1 # encoding: [0xc4,0xe1,0xf9,0x90,0x4c,0x24,0x04]101; X86-NEXT: vfmaddsub132ph %zmm1, %zmm2, %zmm0 {%k1} # encoding: [0x62,0xf6,0x6d,0x49,0x96,0xc1]102; X86-NEXT: retl # encoding: [0xc3]103;104; X64-LABEL: test_int_x86_avx512_mask_vfmaddsub_ph_512:105; X64: # %bb.0:106; X64-NEXT: kmovd %edi, %k1 # encoding: [0xc5,0xfb,0x92,0xcf]107; X64-NEXT: vfmaddsub132ph %zmm1, %zmm2, %zmm0 {%k1} # encoding: [0x62,0xf6,0x6d,0x49,0x96,0xc1]108; X64-NEXT: retq # encoding: [0xc3]109 %res = call <32 x half> @llvm.x86.avx512fp16.vfmaddsub.ph.512(<32 x half> %x0, <32 x half> %x1, <32 x half> %x2, i32 4)110 %bc = bitcast i32 %x3 to <32 x i1>111 %sel = select <32 x i1> %bc, <32 x half> %res, <32 x half> %x0112 ret <32 x half> %sel113}114 115define <32 x half>@test_int_x86_avx512_mask3_vfmaddsub_ph_512(<32 x half> %x0, <32 x half> %x1, <32 x half> %x2, i32 %x3){116; X86-LABEL: test_int_x86_avx512_mask3_vfmaddsub_ph_512:117; X86: # %bb.0:118; X86-NEXT: kmovd {{[0-9]+}}(%esp), %k1 # encoding: [0xc4,0xe1,0xf9,0x90,0x4c,0x24,0x04]119; X86-NEXT: vfmaddsub231ph %zmm1, %zmm0, %zmm2 {%k1} # encoding: [0x62,0xf6,0x7d,0x49,0xb6,0xd1]120; X86-NEXT: vmovaps %zmm2, %zmm0 # encoding: [0x62,0xf1,0x7c,0x48,0x28,0xc2]121; X86-NEXT: retl # encoding: [0xc3]122;123; X64-LABEL: test_int_x86_avx512_mask3_vfmaddsub_ph_512:124; X64: # %bb.0:125; X64-NEXT: kmovd %edi, %k1 # encoding: [0xc5,0xfb,0x92,0xcf]126; X64-NEXT: vfmaddsub231ph %zmm1, %zmm0, %zmm2 {%k1} # encoding: [0x62,0xf6,0x7d,0x49,0xb6,0xd1]127; X64-NEXT: vmovaps %zmm2, %zmm0 # encoding: [0x62,0xf1,0x7c,0x48,0x28,0xc2]128; X64-NEXT: retq # encoding: [0xc3]129 %res = call <32 x half> @llvm.x86.avx512fp16.vfmaddsub.ph.512(<32 x half> %x0, <32 x half> %x1, <32 x half> %x2, i32 4)130 %bc = bitcast i32 %x3 to <32 x i1>131 %sel = select <32 x i1> %bc, <32 x half> %res, <32 x half> %x2132 ret <32 x half> %sel133}134 135define <32 x half>@test_int_x86_avx512_maskz_vfmaddsub_ph_512(<32 x half> %x0, <32 x half> %x1, <32 x half> %x2, i32 %x3){136; X86-LABEL: test_int_x86_avx512_maskz_vfmaddsub_ph_512:137; X86: # %bb.0:138; X86-NEXT: kmovd {{[0-9]+}}(%esp), %k1 # encoding: [0xc4,0xe1,0xf9,0x90,0x4c,0x24,0x04]139; X86-NEXT: vfmaddsub213ph %zmm2, %zmm1, %zmm0 {%k1} {z} # encoding: [0x62,0xf6,0x75,0xc9,0xa6,0xc2]140; X86-NEXT: retl # encoding: [0xc3]141;142; X64-LABEL: test_int_x86_avx512_maskz_vfmaddsub_ph_512:143; X64: # %bb.0:144; X64-NEXT: kmovd %edi, %k1 # encoding: [0xc5,0xfb,0x92,0xcf]145; X64-NEXT: vfmaddsub213ph %zmm2, %zmm1, %zmm0 {%k1} {z} # encoding: [0x62,0xf6,0x75,0xc9,0xa6,0xc2]146; X64-NEXT: retq # encoding: [0xc3]147 %res = call <32 x half> @llvm.x86.avx512fp16.vfmaddsub.ph.512(<32 x half> %x0, <32 x half> %x1, <32 x half> %x2, i32 4)148 %bc = bitcast i32 %x3 to <32 x i1>149 %sel = select <32 x i1> %bc, <32 x half> %res, <32 x half> zeroinitializer150 ret <32 x half> %sel151}152 153define <32 x half>@test_int_x86_avx512_mask3_vfmsubadd_ph_512(<32 x half> %x0, <32 x half> %x1, <32 x half> %x2, i32 %x3){154; X86-LABEL: test_int_x86_avx512_mask3_vfmsubadd_ph_512:155; X86: # %bb.0:156; X86-NEXT: kmovd {{[0-9]+}}(%esp), %k1 # encoding: [0xc4,0xe1,0xf9,0x90,0x4c,0x24,0x04]157; X86-NEXT: vfmsubadd231ph %zmm1, %zmm0, %zmm2 {%k1} # encoding: [0x62,0xf6,0x7d,0x49,0xb7,0xd1]158; X86-NEXT: vmovaps %zmm2, %zmm0 # encoding: [0x62,0xf1,0x7c,0x48,0x28,0xc2]159; X86-NEXT: retl # encoding: [0xc3]160;161; X64-LABEL: test_int_x86_avx512_mask3_vfmsubadd_ph_512:162; X64: # %bb.0:163; X64-NEXT: kmovd %edi, %k1 # encoding: [0xc5,0xfb,0x92,0xcf]164; X64-NEXT: vfmsubadd231ph %zmm1, %zmm0, %zmm2 {%k1} # encoding: [0x62,0xf6,0x7d,0x49,0xb7,0xd1]165; X64-NEXT: vmovaps %zmm2, %zmm0 # encoding: [0x62,0xf1,0x7c,0x48,0x28,0xc2]166; X64-NEXT: retq # encoding: [0xc3]167 %neg = fneg <32 x half> %x2168 %res = call <32 x half> @llvm.x86.avx512fp16.vfmaddsub.ph.512(<32 x half> %x0, <32 x half> %x1, <32 x half> %neg, i32 4)169 %bc = bitcast i32 %x3 to <32 x i1>170 %sel = select <32 x i1> %bc, <32 x half> %res, <32 x half> %x2171 ret <32 x half> %sel172}173 174define <32 x half> @test_mask_round_vfmadd512_ph_rrb_rne(<32 x half> %a0, <32 x half> %a1, <32 x half> %a2, i32 %mask) {175; X86-LABEL: test_mask_round_vfmadd512_ph_rrb_rne:176; X86: # %bb.0:177; X86-NEXT: kmovd {{[0-9]+}}(%esp), %k1 # encoding: [0xc4,0xe1,0xf9,0x90,0x4c,0x24,0x04]178; X86-NEXT: vfmadd132ph {rn-sae}, %zmm1, %zmm2, %zmm0 {%k1} # encoding: [0x62,0xf6,0x6d,0x19,0x98,0xc1]179; X86-NEXT: retl # encoding: [0xc3]180;181; X64-LABEL: test_mask_round_vfmadd512_ph_rrb_rne:182; X64: # %bb.0:183; X64-NEXT: kmovd %edi, %k1 # encoding: [0xc5,0xfb,0x92,0xcf]184; X64-NEXT: vfmadd132ph {rn-sae}, %zmm1, %zmm2, %zmm0 {%k1} # encoding: [0x62,0xf6,0x6d,0x19,0x98,0xc1]185; X64-NEXT: retq # encoding: [0xc3]186 %res = call <32 x half> @llvm.x86.avx512fp16.vfmadd.ph.512(<32 x half> %a0, <32 x half> %a1, <32 x half> %a2, i32 8) nounwind187 %bc = bitcast i32 %mask to <32 x i1>188 %sel = select <32 x i1> %bc, <32 x half> %res, <32 x half> %a0189 ret <32 x half> %sel190}191 192define <32 x half> @test_mask_round_vfmadd512_ph_rrb_rtn(<32 x half> %a0, <32 x half> %a1, <32 x half> %a2, i32 %mask) {193; X86-LABEL: test_mask_round_vfmadd512_ph_rrb_rtn:194; X86: # %bb.0:195; X86-NEXT: kmovd {{[0-9]+}}(%esp), %k1 # encoding: [0xc4,0xe1,0xf9,0x90,0x4c,0x24,0x04]196; X86-NEXT: vfmadd132ph {rd-sae}, %zmm1, %zmm2, %zmm0 {%k1} # encoding: [0x62,0xf6,0x6d,0x39,0x98,0xc1]197; X86-NEXT: retl # encoding: [0xc3]198;199; X64-LABEL: test_mask_round_vfmadd512_ph_rrb_rtn:200; X64: # %bb.0:201; X64-NEXT: kmovd %edi, %k1 # encoding: [0xc5,0xfb,0x92,0xcf]202; X64-NEXT: vfmadd132ph {rd-sae}, %zmm1, %zmm2, %zmm0 {%k1} # encoding: [0x62,0xf6,0x6d,0x39,0x98,0xc1]203; X64-NEXT: retq # encoding: [0xc3]204 %res = call <32 x half> @llvm.x86.avx512fp16.vfmadd.ph.512(<32 x half> %a0, <32 x half> %a1, <32 x half> %a2, i32 9) nounwind205 %bc = bitcast i32 %mask to <32 x i1>206 %sel = select <32 x i1> %bc, <32 x half> %res, <32 x half> %a0207 ret <32 x half> %sel208}209 210define <32 x half> @test_mask_round_vfmadd512_ph_rrb_rtp(<32 x half> %a0, <32 x half> %a1, <32 x half> %a2, i32 %mask) {211; X86-LABEL: test_mask_round_vfmadd512_ph_rrb_rtp:212; X86: # %bb.0:213; X86-NEXT: kmovd {{[0-9]+}}(%esp), %k1 # encoding: [0xc4,0xe1,0xf9,0x90,0x4c,0x24,0x04]214; X86-NEXT: vfmadd132ph {ru-sae}, %zmm1, %zmm2, %zmm0 {%k1} # encoding: [0x62,0xf6,0x6d,0x59,0x98,0xc1]215; X86-NEXT: retl # encoding: [0xc3]216;217; X64-LABEL: test_mask_round_vfmadd512_ph_rrb_rtp:218; X64: # %bb.0:219; X64-NEXT: kmovd %edi, %k1 # encoding: [0xc5,0xfb,0x92,0xcf]220; X64-NEXT: vfmadd132ph {ru-sae}, %zmm1, %zmm2, %zmm0 {%k1} # encoding: [0x62,0xf6,0x6d,0x59,0x98,0xc1]221; X64-NEXT: retq # encoding: [0xc3]222 %res = call <32 x half> @llvm.x86.avx512fp16.vfmadd.ph.512(<32 x half> %a0, <32 x half> %a1, <32 x half> %a2, i32 10) nounwind223 %bc = bitcast i32 %mask to <32 x i1>224 %sel = select <32 x i1> %bc, <32 x half> %res, <32 x half> %a0225 ret <32 x half> %sel226}227 228define <32 x half> @test_mask_round_vfmadd512_ph_rrb_rtz(<32 x half> %a0, <32 x half> %a1, <32 x half> %a2, i32 %mask) {229; X86-LABEL: test_mask_round_vfmadd512_ph_rrb_rtz:230; X86: # %bb.0:231; X86-NEXT: kmovd {{[0-9]+}}(%esp), %k1 # encoding: [0xc4,0xe1,0xf9,0x90,0x4c,0x24,0x04]232; X86-NEXT: vfmadd132ph {rz-sae}, %zmm1, %zmm2, %zmm0 {%k1} # encoding: [0x62,0xf6,0x6d,0x79,0x98,0xc1]233; X86-NEXT: retl # encoding: [0xc3]234;235; X64-LABEL: test_mask_round_vfmadd512_ph_rrb_rtz:236; X64: # %bb.0:237; X64-NEXT: kmovd %edi, %k1 # encoding: [0xc5,0xfb,0x92,0xcf]238; X64-NEXT: vfmadd132ph {rz-sae}, %zmm1, %zmm2, %zmm0 {%k1} # encoding: [0x62,0xf6,0x6d,0x79,0x98,0xc1]239; X64-NEXT: retq # encoding: [0xc3]240 %res = call <32 x half> @llvm.x86.avx512fp16.vfmadd.ph.512(<32 x half> %a0, <32 x half> %a1, <32 x half> %a2, i32 11) nounwind241 %bc = bitcast i32 %mask to <32 x i1>242 %sel = select <32 x i1> %bc, <32 x half> %res, <32 x half> %a0243 ret <32 x half> %sel244}245 246define <32 x half> @test_mask_round_vfmadd512_ph_rrb_current(<32 x half> %a0, <32 x half> %a1, <32 x half> %a2, i32 %mask) {247; X86-LABEL: test_mask_round_vfmadd512_ph_rrb_current:248; X86: # %bb.0:249; X86-NEXT: kmovd {{[0-9]+}}(%esp), %k1 # encoding: [0xc4,0xe1,0xf9,0x90,0x4c,0x24,0x04]250; X86-NEXT: vfmadd132ph %zmm1, %zmm2, %zmm0 {%k1} # encoding: [0x62,0xf6,0x6d,0x49,0x98,0xc1]251; X86-NEXT: retl # encoding: [0xc3]252;253; X64-LABEL: test_mask_round_vfmadd512_ph_rrb_current:254; X64: # %bb.0:255; X64-NEXT: kmovd %edi, %k1 # encoding: [0xc5,0xfb,0x92,0xcf]256; X64-NEXT: vfmadd132ph %zmm1, %zmm2, %zmm0 {%k1} # encoding: [0x62,0xf6,0x6d,0x49,0x98,0xc1]257; X64-NEXT: retq # encoding: [0xc3]258 %res = call <32 x half> @llvm.x86.avx512fp16.vfmadd.ph.512(<32 x half> %a0, <32 x half> %a1, <32 x half> %a2, i32 4) nounwind259 %bc = bitcast i32 %mask to <32 x i1>260 %sel = select <32 x i1> %bc, <32 x half> %res, <32 x half> %a0261 ret <32 x half> %sel262}263 264define <32 x half> @test_mask_round_vfmadd512_ph_rrbz_rne(<32 x half> %a0, <32 x half> %a1, <32 x half> %a2) {265; CHECK-LABEL: test_mask_round_vfmadd512_ph_rrbz_rne:266; CHECK: # %bb.0:267; CHECK-NEXT: vfmadd213ph {rn-sae}, %zmm2, %zmm1, %zmm0 # encoding: [0x62,0xf6,0x75,0x18,0xa8,0xc2]268; CHECK-NEXT: ret{{[l|q]}} # encoding: [0xc3]269 %res = call <32 x half> @llvm.x86.avx512fp16.vfmadd.ph.512(<32 x half> %a0, <32 x half> %a1, <32 x half> %a2, i32 8) nounwind270 ret <32 x half> %res271}272 273define <32 x half> @test_mask_round_vfmadd512_ph_rrbz_rtn(<32 x half> %a0, <32 x half> %a1, <32 x half> %a2) {274; CHECK-LABEL: test_mask_round_vfmadd512_ph_rrbz_rtn:275; CHECK: # %bb.0:276; CHECK-NEXT: vfmadd213ph {rd-sae}, %zmm2, %zmm1, %zmm0 # encoding: [0x62,0xf6,0x75,0x38,0xa8,0xc2]277; CHECK-NEXT: ret{{[l|q]}} # encoding: [0xc3]278 %res = call <32 x half> @llvm.x86.avx512fp16.vfmadd.ph.512(<32 x half> %a0, <32 x half> %a1, <32 x half> %a2, i32 9) nounwind279 ret <32 x half> %res280}281 282define <32 x half> @test_mask_round_vfmadd512_ph_rrbz_rtp(<32 x half> %a0, <32 x half> %a1, <32 x half> %a2) {283; CHECK-LABEL: test_mask_round_vfmadd512_ph_rrbz_rtp:284; CHECK: # %bb.0:285; CHECK-NEXT: vfmadd213ph {ru-sae}, %zmm2, %zmm1, %zmm0 # encoding: [0x62,0xf6,0x75,0x58,0xa8,0xc2]286; CHECK-NEXT: ret{{[l|q]}} # encoding: [0xc3]287 %res = call <32 x half> @llvm.x86.avx512fp16.vfmadd.ph.512(<32 x half> %a0, <32 x half> %a1, <32 x half> %a2, i32 10) nounwind288 ret <32 x half> %res289}290 291define <32 x half> @test_mask_round_vfmadd512_ph_rrbz_rtz(<32 x half> %a0, <32 x half> %a1, <32 x half> %a2) {292; CHECK-LABEL: test_mask_round_vfmadd512_ph_rrbz_rtz:293; CHECK: # %bb.0:294; CHECK-NEXT: vfmadd213ph {rz-sae}, %zmm2, %zmm1, %zmm0 # encoding: [0x62,0xf6,0x75,0x78,0xa8,0xc2]295; CHECK-NEXT: ret{{[l|q]}} # encoding: [0xc3]296 %res = call <32 x half> @llvm.x86.avx512fp16.vfmadd.ph.512(<32 x half> %a0, <32 x half> %a1, <32 x half> %a2, i32 11) nounwind297 ret <32 x half> %res298}299 300define <32 x half> @test_mask_round_vfmadd512_ph_rrbz_current(<32 x half> %a0, <32 x half> %a1, <32 x half> %a2) {301; CHECK-LABEL: test_mask_round_vfmadd512_ph_rrbz_current:302; CHECK: # %bb.0:303; CHECK-NEXT: vfmadd213ph %zmm2, %zmm1, %zmm0 # encoding: [0x62,0xf6,0x75,0x48,0xa8,0xc2]304; CHECK-NEXT: ret{{[l|q]}} # encoding: [0xc3]305 %res = call <32 x half> @llvm.x86.avx512fp16.vfmadd.ph.512(<32 x half> %a0, <32 x half> %a1, <32 x half> %a2, i32 4) nounwind306 ret <32 x half> %res307}308 309define <32 x half>@test_int_x86_avx512_mask3_vfmsub_ph_512(<32 x half> %x0, <32 x half> %x1, <32 x half> %x2, i32 %x3){310; X86-LABEL: test_int_x86_avx512_mask3_vfmsub_ph_512:311; X86: # %bb.0:312; X86-NEXT: kmovd {{[0-9]+}}(%esp), %k1 # encoding: [0xc4,0xe1,0xf9,0x90,0x4c,0x24,0x04]313; X86-NEXT: vfmsub231ph %zmm1, %zmm0, %zmm2 {%k1} # encoding: [0x62,0xf6,0x7d,0x49,0xba,0xd1]314; X86-NEXT: vmovaps %zmm2, %zmm0 # encoding: [0x62,0xf1,0x7c,0x48,0x28,0xc2]315; X86-NEXT: retl # encoding: [0xc3]316;317; X64-LABEL: test_int_x86_avx512_mask3_vfmsub_ph_512:318; X64: # %bb.0:319; X64-NEXT: kmovd %edi, %k1 # encoding: [0xc5,0xfb,0x92,0xcf]320; X64-NEXT: vfmsub231ph %zmm1, %zmm0, %zmm2 {%k1} # encoding: [0x62,0xf6,0x7d,0x49,0xba,0xd1]321; X64-NEXT: vmovaps %zmm2, %zmm0 # encoding: [0x62,0xf1,0x7c,0x48,0x28,0xc2]322; X64-NEXT: retq # encoding: [0xc3]323 %1 = fsub <32 x half> <half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00>, %x2324 %2 = call <32 x half> @llvm.fma.v32f16(<32 x half> %x0, <32 x half> %x1, <32 x half> %1)325 %3 = bitcast i32 %x3 to <32 x i1>326 %4 = select <32 x i1> %3, <32 x half> %2, <32 x half> %x2327 ret <32 x half> %4328}329 330define <32 x half>@test_int_x86_avx512_mask_vfmadd_ph_512(<32 x half> %x0, <32 x half> %x1, <32 x half> %x2, i32 %x3){331; X86-LABEL: test_int_x86_avx512_mask_vfmadd_ph_512:332; X86: # %bb.0:333; X86-NEXT: kmovd {{[0-9]+}}(%esp), %k1 # encoding: [0xc4,0xe1,0xf9,0x90,0x4c,0x24,0x04]334; X86-NEXT: vfmadd132ph %zmm1, %zmm2, %zmm0 {%k1} # encoding: [0x62,0xf6,0x6d,0x49,0x98,0xc1]335; X86-NEXT: retl # encoding: [0xc3]336;337; X64-LABEL: test_int_x86_avx512_mask_vfmadd_ph_512:338; X64: # %bb.0:339; X64-NEXT: kmovd %edi, %k1 # encoding: [0xc5,0xfb,0x92,0xcf]340; X64-NEXT: vfmadd132ph %zmm1, %zmm2, %zmm0 {%k1} # encoding: [0x62,0xf6,0x6d,0x49,0x98,0xc1]341; X64-NEXT: retq # encoding: [0xc3]342 %res = call <32 x half> @llvm.x86.avx512fp16.vfmadd.ph.512(<32 x half> %x0, <32 x half> %x1, <32 x half> %x2, i32 4)343 %bc = bitcast i32 %x3 to <32 x i1>344 %sel = select <32 x i1> %bc, <32 x half> %res, <32 x half> %x0345 ret <32 x half> %sel346}347 348define <32 x half>@test_int_x86_avx512_mask3_vfmadd_ph_512(<32 x half> %x0, <32 x half> %x1, <32 x half> %x2, i32 %x3){349; X86-LABEL: test_int_x86_avx512_mask3_vfmadd_ph_512:350; X86: # %bb.0:351; X86-NEXT: kmovd {{[0-9]+}}(%esp), %k1 # encoding: [0xc4,0xe1,0xf9,0x90,0x4c,0x24,0x04]352; X86-NEXT: vfmadd231ph %zmm1, %zmm0, %zmm2 {%k1} # encoding: [0x62,0xf6,0x7d,0x49,0xb8,0xd1]353; X86-NEXT: vmovaps %zmm2, %zmm0 # encoding: [0x62,0xf1,0x7c,0x48,0x28,0xc2]354; X86-NEXT: retl # encoding: [0xc3]355;356; X64-LABEL: test_int_x86_avx512_mask3_vfmadd_ph_512:357; X64: # %bb.0:358; X64-NEXT: kmovd %edi, %k1 # encoding: [0xc5,0xfb,0x92,0xcf]359; X64-NEXT: vfmadd231ph %zmm1, %zmm0, %zmm2 {%k1} # encoding: [0x62,0xf6,0x7d,0x49,0xb8,0xd1]360; X64-NEXT: vmovaps %zmm2, %zmm0 # encoding: [0x62,0xf1,0x7c,0x48,0x28,0xc2]361; X64-NEXT: retq # encoding: [0xc3]362 %1 = call <32 x half> @llvm.fma.v32f16(<32 x half> %x0, <32 x half> %x1, <32 x half> %x2)363 %2 = bitcast i32 %x3 to <32 x i1>364 %3 = select <32 x i1> %2, <32 x half> %1, <32 x half> %x2365 ret <32 x half> %3366}367 368define <32 x half> @test_int_x86_avx512_maskz_vfmadd_ph_512(<32 x half> %x0, <32 x half> %x1, <32 x half> %x2, i32 %x3) {369; X86-LABEL: test_int_x86_avx512_maskz_vfmadd_ph_512:370; X86: # %bb.0:371; X86-NEXT: kmovd {{[0-9]+}}(%esp), %k1 # encoding: [0xc4,0xe1,0xf9,0x90,0x4c,0x24,0x04]372; X86-NEXT: vfmadd213ph %zmm2, %zmm1, %zmm0 {%k1} {z} # encoding: [0x62,0xf6,0x75,0xc9,0xa8,0xc2]373; X86-NEXT: retl # encoding: [0xc3]374;375; X64-LABEL: test_int_x86_avx512_maskz_vfmadd_ph_512:376; X64: # %bb.0:377; X64-NEXT: kmovd %edi, %k1 # encoding: [0xc5,0xfb,0x92,0xcf]378; X64-NEXT: vfmadd213ph %zmm2, %zmm1, %zmm0 {%k1} {z} # encoding: [0x62,0xf6,0x75,0xc9,0xa8,0xc2]379; X64-NEXT: retq # encoding: [0xc3]380 %1 = call <32 x half> @llvm.fma.v32f16(<32 x half> %x0, <32 x half> %x1, <32 x half> %x2)381 %2 = bitcast i32 %x3 to <32 x i1>382 %3 = select <32 x i1> %2, <32 x half> %1, <32 x half> zeroinitializer383 ret <32 x half> %3384}385 386define <32 x half>@test_int_x86_avx512_mask_vfnmsub_ph_512(<32 x half> %x0, <32 x half> %x1, <32 x half> %x2, i32 %x3){387; X86-LABEL: test_int_x86_avx512_mask_vfnmsub_ph_512:388; X86: # %bb.0:389; X86-NEXT: kmovd {{[0-9]+}}(%esp), %k1 # encoding: [0xc4,0xe1,0xf9,0x90,0x4c,0x24,0x04]390; X86-NEXT: vfnmsub132ph %zmm1, %zmm2, %zmm0 {%k1} # encoding: [0x62,0xf6,0x6d,0x49,0x9e,0xc1]391; X86-NEXT: retl # encoding: [0xc3]392;393; X64-LABEL: test_int_x86_avx512_mask_vfnmsub_ph_512:394; X64: # %bb.0:395; X64-NEXT: kmovd %edi, %k1 # encoding: [0xc5,0xfb,0x92,0xcf]396; X64-NEXT: vfnmsub132ph %zmm1, %zmm2, %zmm0 {%k1} # encoding: [0x62,0xf6,0x6d,0x49,0x9e,0xc1]397; X64-NEXT: retq # encoding: [0xc3]398 %1 = fsub <32 x half> <half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00>, %x1399 %2 = fsub <32 x half> <half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00>, %x2400 %3 = call <32 x half> @llvm.fma.v32f16(<32 x half> %x0, <32 x half> %1, <32 x half> %2)401 %4 = bitcast i32 %x3 to <32 x i1>402 %5 = select <32 x i1> %4, <32 x half> %3, <32 x half> %x0403 ret <32 x half> %5404}405 406define <32 x half>@test_int_x86_avx512_mask3_vfnmsub_ph_512(<32 x half> %x0, <32 x half> %x1, <32 x half> %x2, i32 %x3){407; X86-LABEL: test_int_x86_avx512_mask3_vfnmsub_ph_512:408; X86: # %bb.0:409; X86-NEXT: kmovd {{[0-9]+}}(%esp), %k1 # encoding: [0xc4,0xe1,0xf9,0x90,0x4c,0x24,0x04]410; X86-NEXT: vfnmsub231ph %zmm1, %zmm0, %zmm2 {%k1} # encoding: [0x62,0xf6,0x7d,0x49,0xbe,0xd1]411; X86-NEXT: vmovaps %zmm2, %zmm0 # encoding: [0x62,0xf1,0x7c,0x48,0x28,0xc2]412; X86-NEXT: retl # encoding: [0xc3]413;414; X64-LABEL: test_int_x86_avx512_mask3_vfnmsub_ph_512:415; X64: # %bb.0:416; X64-NEXT: kmovd %edi, %k1 # encoding: [0xc5,0xfb,0x92,0xcf]417; X64-NEXT: vfnmsub231ph %zmm1, %zmm0, %zmm2 {%k1} # encoding: [0x62,0xf6,0x7d,0x49,0xbe,0xd1]418; X64-NEXT: vmovaps %zmm2, %zmm0 # encoding: [0x62,0xf1,0x7c,0x48,0x28,0xc2]419; X64-NEXT: retq # encoding: [0xc3]420 %1 = fsub <32 x half> <half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00>, %x0421 %2 = fsub <32 x half> <half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00>, %x2422 %3 = call <32 x half> @llvm.fma.v32f16(<32 x half> %1, <32 x half> %x1, <32 x half> %2)423 %4 = bitcast i32 %x3 to <32 x i1>424 %5 = select <32 x i1> %4, <32 x half> %3, <32 x half> %x2425 ret <32 x half> %5426}427 428define <32 x half>@test_int_x86_avx512_mask_vfnmadd_ph_512(<32 x half> %x0, <32 x half> %x1, <32 x half> %x2, i32 %x3){429; X86-LABEL: test_int_x86_avx512_mask_vfnmadd_ph_512:430; X86: # %bb.0:431; X86-NEXT: kmovd {{[0-9]+}}(%esp), %k1 # encoding: [0xc4,0xe1,0xf9,0x90,0x4c,0x24,0x04]432; X86-NEXT: vfnmadd132ph %zmm1, %zmm2, %zmm0 {%k1} # encoding: [0x62,0xf6,0x6d,0x49,0x9c,0xc1]433; X86-NEXT: retl # encoding: [0xc3]434;435; X64-LABEL: test_int_x86_avx512_mask_vfnmadd_ph_512:436; X64: # %bb.0:437; X64-NEXT: kmovd %edi, %k1 # encoding: [0xc5,0xfb,0x92,0xcf]438; X64-NEXT: vfnmadd132ph %zmm1, %zmm2, %zmm0 {%k1} # encoding: [0x62,0xf6,0x6d,0x49,0x9c,0xc1]439; X64-NEXT: retq # encoding: [0xc3]440 %1 = fsub <32 x half> <half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00>, %x1441 %2 = call <32 x half> @llvm.fma.v32f16(<32 x half> %x0, <32 x half> %1, <32 x half> %x2)442 %3 = bitcast i32 %x3 to <32 x i1>443 %4 = select <32 x i1> %3, <32 x half> %2, <32 x half> %x0444 ret <32 x half> %4445}446 447define <32 x half> @test_x86_fma_vfnmadd_ph_512(<32 x half> %a0, <32 x half> %a1, <32 x half> %a2) #0 {448; CHECK-LABEL: test_x86_fma_vfnmadd_ph_512:449; CHECK: # %bb.0:450; CHECK-NEXT: vfnmadd213ph %zmm2, %zmm1, %zmm0 # encoding: [0x62,0xf6,0x75,0x48,0xac,0xc2]451; CHECK-NEXT: ret{{[l|q]}} # encoding: [0xc3]452 %1 = fsub <32 x half> <half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00>, %a0453 %2 = call <32 x half> @llvm.fma.v32f16(<32 x half> %1, <32 x half> %a1, <32 x half> %a2)454 ret <32 x half> %2455}456 457define <32 x half> @test_x86_fma_vfnmsub_ph_512(<32 x half> %a0, <32 x half> %a1, <32 x half> %a2) #0 {458; CHECK-LABEL: test_x86_fma_vfnmsub_ph_512:459; CHECK: # %bb.0:460; CHECK-NEXT: vfnmsub213ph %zmm0, %zmm1, %zmm0 # encoding: [0x62,0xf6,0x75,0x48,0xae,0xc0]461; CHECK-NEXT: ret{{[l|q]}} # encoding: [0xc3]462 %1 = fsub <32 x half> <half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00>, %a0463 %2 = fsub <32 x half> <half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00, half -0.000000e+00>, %a0464 %3 = call <32 x half> @llvm.fma.v32f16(<32 x half> %1, <32 x half> %a1, <32 x half> %2)465 ret <32 x half> %3466}467 468define <8 x half>@test_int_x86_avx512_mask3_vfmadd_sh(<8 x half> %x0, <8 x half> %x1, ptr%ptr_b, i8 %x3, i32 %x4) {469; X86-LABEL: test_int_x86_avx512_mask3_vfmadd_sh:470; X86: # %bb.0:471; X86-NEXT: movl {{[0-9]+}}(%esp), %eax # encoding: [0x8b,0x44,0x24,0x04]472; X86-NEXT: movzbl {{[0-9]+}}(%esp), %ecx # encoding: [0x0f,0xb6,0x4c,0x24,0x08]473; X86-NEXT: kmovd %ecx, %k1 # encoding: [0xc5,0xfb,0x92,0xc9]474; X86-NEXT: vfmadd231sh (%eax), %xmm0, %xmm1 {%k1} # encoding: [0x62,0xf6,0x7d,0x09,0xb9,0x08]475; X86-NEXT: vmovaps %xmm1, %xmm0 # encoding: [0xc5,0xf8,0x28,0xc1]476; X86-NEXT: retl # encoding: [0xc3]477;478; X64-LABEL: test_int_x86_avx512_mask3_vfmadd_sh:479; X64: # %bb.0:480; X64-NEXT: kmovd %esi, %k1 # encoding: [0xc5,0xfb,0x92,0xce]481; X64-NEXT: vfmadd231sh (%rdi), %xmm0, %xmm1 {%k1} # encoding: [0x62,0xf6,0x7d,0x09,0xb9,0x0f]482; X64-NEXT: vmovaps %xmm1, %xmm0 # encoding: [0xc5,0xf8,0x28,0xc1]483; X64-NEXT: retq # encoding: [0xc3]484 %q = load half, ptr %ptr_b485 %vecinit.i = insertelement <8 x half> undef, half %q, i32 0486 %1 = extractelement <8 x half> %x0, i64 0487 %2 = extractelement <8 x half> %vecinit.i, i64 0488 %3 = extractelement <8 x half> %x1, i64 0489 %4 = call half @llvm.fma.f16(half %1, half %2, half %3)490 %5 = bitcast i8 %x3 to <8 x i1>491 %6 = extractelement <8 x i1> %5, i64 0492 %7 = select i1 %6, half %4, half %3493 %8 = insertelement <8 x half> %x1, half %7, i64 0494 ret <8 x half> %8495}496 497define <8 x half>@test_int_x86_avx512_maskz_vfmadd_sh(<8 x half> %x0, <8 x half> %x1, <8 x half> %x2, i8 %x3, i32 %x4 ){498; X86-LABEL: test_int_x86_avx512_maskz_vfmadd_sh:499; X86: # %bb.0:500; X86-NEXT: movzbl {{[0-9]+}}(%esp), %eax # encoding: [0x0f,0xb6,0x44,0x24,0x04]501; X86-NEXT: kmovd %eax, %k1 # encoding: [0xc5,0xfb,0x92,0xc8]502; X86-NEXT: vfmadd213sh %xmm2, %xmm1, %xmm0 {%k1} {z} # encoding: [0x62,0xf6,0x75,0x89,0xa9,0xc2]503; X86-NEXT: retl # encoding: [0xc3]504;505; X64-LABEL: test_int_x86_avx512_maskz_vfmadd_sh:506; X64: # %bb.0:507; X64-NEXT: kmovd %edi, %k1 # encoding: [0xc5,0xfb,0x92,0xcf]508; X64-NEXT: vfmadd213sh %xmm2, %xmm1, %xmm0 {%k1} {z} # encoding: [0x62,0xf6,0x75,0x89,0xa9,0xc2]509; X64-NEXT: retq # encoding: [0xc3]510 %1 = extractelement <8 x half> %x0, i64 0511 %2 = extractelement <8 x half> %x1, i64 0512 %3 = extractelement <8 x half> %x2, i64 0513 %4 = call half @llvm.fma.f16(half %1, half %2, half %3)514 %5 = bitcast i8 %x3 to <8 x i1>515 %6 = extractelement <8 x i1> %5, i64 0516 %7 = select i1 %6, half %4, half 0.000000e+00517 %8 = insertelement <8 x half> %x0, half %7, i64 0518 %9 = extractelement <8 x half> %x0, i64 0519 %10 = extractelement <8 x half> %x1, i64 0520 %11 = extractelement <8 x half> %x2, i64 0521 %12 = call half @llvm.x86.avx512fp16.vfmadd.f16(half %9, half %10, half %11, i32 3)522 %13 = bitcast i8 %x3 to <8 x i1>523 %14 = extractelement <8 x i1> %13, i64 0524 %15 = select i1 %14, half %12, half 0.000000e+00525 %16 = insertelement <8 x half> %x0, half %15, i64 0526 %res2 = fadd <8 x half> %8, %16527 ret <8 x half> %8528}529 530define void @fmadd_sh_mask_memfold(ptr %a, ptr %b, i8 %c) {531; X86-LABEL: fmadd_sh_mask_memfold:532; X86: # %bb.0:533; X86-NEXT: movzbl {{[0-9]+}}(%esp), %eax # encoding: [0x0f,0xb6,0x44,0x24,0x0c]534; X86-NEXT: movl {{[0-9]+}}(%esp), %ecx # encoding: [0x8b,0x4c,0x24,0x08]535; X86-NEXT: movl {{[0-9]+}}(%esp), %edx # encoding: [0x8b,0x54,0x24,0x04]536; X86-NEXT: vmovsh {{.*#+}} xmm0 = mem[0],zero,zero,zero,zero,zero,zero,zero537; X86-NEXT: # encoding: [0x62,0xf5,0x7e,0x08,0x10,0x02]538; X86-NEXT: vmovsh {{.*#+}} xmm1 = mem[0],zero,zero,zero,zero,zero,zero,zero539; X86-NEXT: # encoding: [0x62,0xf5,0x7e,0x08,0x10,0x09]540; X86-NEXT: vfmadd213sh %xmm0, %xmm0, %xmm1 # encoding: [0x62,0xf6,0x7d,0x08,0xa9,0xc8]541; X86-NEXT: kmovd %eax, %k1 # encoding: [0xc5,0xfb,0x92,0xc8]542; X86-NEXT: vmovsh %xmm1, %xmm0, %xmm0 {%k1} # encoding: [0x62,0xf5,0x7e,0x09,0x10,0xc1]543; X86-NEXT: vmovsh %xmm0, (%edx) # encoding: [0x62,0xf5,0x7e,0x08,0x11,0x02]544; X86-NEXT: retl # encoding: [0xc3]545;546; X64-LABEL: fmadd_sh_mask_memfold:547; X64: # %bb.0:548; X64-NEXT: vmovsh {{.*#+}} xmm0 = mem[0],zero,zero,zero,zero,zero,zero,zero549; X64-NEXT: # encoding: [0x62,0xf5,0x7e,0x08,0x10,0x07]550; X64-NEXT: vmovsh {{.*#+}} xmm1 = mem[0],zero,zero,zero,zero,zero,zero,zero551; X64-NEXT: # encoding: [0x62,0xf5,0x7e,0x08,0x10,0x0e]552; X64-NEXT: vfmadd213sh %xmm0, %xmm0, %xmm1 # encoding: [0x62,0xf6,0x7d,0x08,0xa9,0xc8]553; X64-NEXT: kmovd %edx, %k1 # encoding: [0xc5,0xfb,0x92,0xca]554; X64-NEXT: vmovsh %xmm1, %xmm0, %xmm0 {%k1} # encoding: [0x62,0xf5,0x7e,0x09,0x10,0xc1]555; X64-NEXT: vmovsh %xmm0, (%rdi) # encoding: [0x62,0xf5,0x7e,0x08,0x11,0x07]556; X64-NEXT: retq # encoding: [0xc3]557 %a.val = load half, ptr %a558 %av0 = insertelement <8 x half> undef, half %a.val, i32 0559 %av1 = insertelement <8 x half> %av0, half 0.000000e+00, i32 1560 %av2 = insertelement <8 x half> %av1, half 0.000000e+00, i32 2561 %av3 = insertelement <8 x half> %av2, half 0.000000e+00, i32 3562 %av4 = insertelement <8 x half> %av3, half 0.000000e+00, i32 4563 %av5 = insertelement <8 x half> %av4, half 0.000000e+00, i32 5564 %av6 = insertelement <8 x half> %av5, half 0.000000e+00, i32 6565 %av = insertelement <8 x half> %av6, half 0.000000e+00, i32 7566 567 %b.val = load half, ptr %b568 %bv0 = insertelement <8 x half> undef, half %b.val, i32 0569 %bv1 = insertelement <8 x half> %bv0, half 0.000000e+00, i32 1570 %bv2 = insertelement <8 x half> %bv1, half 0.000000e+00, i32 2571 %bv3 = insertelement <8 x half> %bv2, half 0.000000e+00, i32 3572 %bv4 = insertelement <8 x half> %bv3, half 0.000000e+00, i32 4573 %bv5 = insertelement <8 x half> %bv4, half 0.000000e+00, i32 5574 %bv6 = insertelement <8 x half> %bv5, half 0.000000e+00, i32 6575 %bv = insertelement <8 x half> %bv6, half 0.000000e+00, i32 7576 %1 = extractelement <8 x half> %av, i64 0577 %2 = extractelement <8 x half> %bv, i64 0578 %3 = extractelement <8 x half> %av, i64 0579 %4 = call half @llvm.fma.f16(half %1, half %2, half %3)580 %5 = bitcast i8 %c to <8 x i1>581 %6 = extractelement <8 x i1> %5, i64 0582 %7 = select i1 %6, half %4, half %1583 %8 = insertelement <8 x half> %av, half %7, i64 0584 %sr = extractelement <8 x half> %8, i32 0585 store half %sr, ptr %a586 ret void587}588 589declare half @llvm.fma.f16(half, half, half)590declare half @llvm.x86.avx512fp16.vfmadd.f16(half, half, half, i32)591 592declare <32 x half> @llvm.fma.v32f16(<32 x half>, <32 x half>, <32 x half>)593