102 lines · plain
1; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py2; RUN: llc < %s -mtriple=x86_64-apple-darwin -mcpu=knl | FileCheck %s3 4declare <4 x float> @llvm.x86.avx512.mask.vfmadd.ss(<4 x float>, <4 x float>, <4 x float>, i8, i32)5declare <4 x float> @llvm.x86.avx512.maskz.vfmadd.ss(<4 x float>, <4 x float>, <4 x float>, i8, i32)6 7define <4 x float>@test_var_mask(<4 x float> %v0, <4 x float> %v1, <4 x float> %v2, i8 %mask) {8; CHECK-LABEL: test_var_mask:9; CHECK: ## %bb.0:10; CHECK-NEXT: kmovw %edi, %k111; CHECK-NEXT: vfmadd213ss {{.*#+}} xmm0 {%k1} = (xmm1 * xmm0) + xmm212; CHECK-NEXT: retq13 %res = call <4 x float> @llvm.x86.avx512.mask.vfmadd.ss(<4 x float> %v0,<4 x float> %v1, <4 x float> %v2, i8 %mask, i32 4)14 ret < 4 x float> %res15}16 17define <4 x float>@test_var_maskz(<4 x float> %v0, <4 x float> %v1, <4 x float> %v2, i8 %mask) {18; CHECK-LABEL: test_var_maskz:19; CHECK: ## %bb.0:20; CHECK-NEXT: kmovw %edi, %k121; CHECK-NEXT: vfmadd213ss {{.*#+}} xmm0 {%k1} {z} = (xmm1 * xmm0) + xmm222; CHECK-NEXT: retq23 %res = call <4 x float> @llvm.x86.avx512.maskz.vfmadd.ss(<4 x float> %v0,<4 x float> %v1, <4 x float> %v2, i8 %mask, i32 4)24 ret < 4 x float> %res25}26 27; just return %xmm0 here.28define <4 x float>@test_const0_mask(<4 x float> %v0, <4 x float> %v1, <4 x float> %v2) {29; CHECK-LABEL: test_const0_mask:30; CHECK: ## %bb.0:31; CHECK-NEXT: retq32 %res = call <4 x float> @llvm.x86.avx512.mask.vfmadd.ss(<4 x float> %v0,<4 x float> %v1, <4 x float> %v2, i8 0, i32 4)33 ret < 4 x float> %res34}35 36; zero the lower element of xmm0 and return it.37define <4 x float>@test_const0_maskz(<4 x float> %v0, <4 x float> %v1, <4 x float> %v2) {38; CHECK-LABEL: test_const0_maskz:39; CHECK: ## %bb.0:40; CHECK-NEXT: vxorps %xmm1, %xmm1, %xmm141; CHECK-NEXT: vblendps {{.*#+}} xmm0 = xmm1[0],xmm0[1,2,3]42; CHECK-NEXT: retq43 %res = call <4 x float> @llvm.x86.avx512.maskz.vfmadd.ss(<4 x float> %v0,<4 x float> %v1, <4 x float> %v2, i8 0, i32 4)44 ret < 4 x float> %res45}46 47; just return %xmm0 here.48define <4 x float>@test_const2_mask(<4 x float> %v0, <4 x float> %v1, <4 x float> %v2) {49; CHECK-LABEL: test_const2_mask:50; CHECK: ## %bb.0:51; CHECK-NEXT: retq52 %res = call <4 x float> @llvm.x86.avx512.mask.vfmadd.ss(<4 x float> %v0,<4 x float> %v1, <4 x float> %v2, i8 2, i32 4)53 ret < 4 x float> %res54}55 56; zero the lower element of xmm0 and return it.57define <4 x float>@test_const2_maskz(<4 x float> %v0, <4 x float> %v1, <4 x float> %v2) {58; CHECK-LABEL: test_const2_maskz:59; CHECK: ## %bb.0:60; CHECK-NEXT: vxorps %xmm1, %xmm1, %xmm161; CHECK-NEXT: vblendps {{.*#+}} xmm0 = xmm1[0],xmm0[1,2,3]62; CHECK-NEXT: retq63 %res = call <4 x float> @llvm.x86.avx512.maskz.vfmadd.ss(<4 x float> %v0,<4 x float> %v1, <4 x float> %v2, i8 2, i32 4)64 ret < 4 x float> %res65}66 67define <4 x float>@test_const_allone_mask(<4 x float> %v0, <4 x float> %v1, <4 x float> %v2) {68; CHECK-LABEL: test_const_allone_mask:69; CHECK: ## %bb.0:70; CHECK-NEXT: vfmadd213ss {{.*#+}} xmm0 = (xmm1 * xmm0) + xmm271; CHECK-NEXT: retq72 %res = call <4 x float> @llvm.x86.avx512.mask.vfmadd.ss(<4 x float> %v0,<4 x float> %v1, <4 x float> %v2, i8 -1, i32 4)73 ret < 4 x float> %res74}75 76define <4 x float>@test_const_allone_maskz(<4 x float> %v0, <4 x float> %v1, <4 x float> %v2) {77; CHECK-LABEL: test_const_allone_maskz:78; CHECK: ## %bb.0:79; CHECK-NEXT: vfmadd213ss {{.*#+}} xmm0 = (xmm1 * xmm0) + xmm280; CHECK-NEXT: retq81 %res = call <4 x float> @llvm.x86.avx512.maskz.vfmadd.ss(<4 x float> %v0,<4 x float> %v1, <4 x float> %v2, i8 -1, i32 4)82 ret < 4 x float> %res83}84 85define <4 x float>@test_const_3_mask(<4 x float> %v0, <4 x float> %v1, <4 x float> %v2) {86; CHECK-LABEL: test_const_3_mask:87; CHECK: ## %bb.0:88; CHECK-NEXT: vfmadd213ss {{.*#+}} xmm0 = (xmm1 * xmm0) + xmm289; CHECK-NEXT: retq90 %res = call <4 x float> @llvm.x86.avx512.mask.vfmadd.ss(<4 x float> %v0,<4 x float> %v1, <4 x float> %v2, i8 3, i32 4)91 ret < 4 x float> %res92}93 94define <4 x float>@test_const_3_maskz(<4 x float> %v0, <4 x float> %v1, <4 x float> %v2) {95; CHECK-LABEL: test_const_3_maskz:96; CHECK: ## %bb.0:97; CHECK-NEXT: vfmadd213ss {{.*#+}} xmm0 = (xmm1 * xmm0) + xmm298; CHECK-NEXT: retq99 %res = call <4 x float> @llvm.x86.avx512.maskz.vfmadd.ss(<4 x float> %v0,<4 x float> %v1, <4 x float> %v2, i8 3, i32 4)100 ret < 4 x float> %res101}102