1*9880d681SAndroid Build Coastguard Worker; RUN: llc < %s -mtriple=x86_64-pc-linux -mcpu=knl --show-mc-encoding| FileCheck %s 2*9880d681SAndroid Build Coastguard Worker 3*9880d681SAndroid Build Coastguard Workerdefine <16 x float> @test_rsqrt28_ps(<16 x float> %a0) { 4*9880d681SAndroid Build Coastguard Worker ; CHECK: vrsqrt28ps {sae}, %zmm0, %zmm0 # encoding: [0x62,0xf2,0x7d,0x18,0xcc,0xc0] 5*9880d681SAndroid Build Coastguard Worker %res = call <16 x float> @llvm.x86.avx512.rsqrt28.ps(<16 x float> %a0, <16 x float> zeroinitializer, i16 -1, i32 8) 6*9880d681SAndroid Build Coastguard Worker ret <16 x float> %res 7*9880d681SAndroid Build Coastguard Worker} 8*9880d681SAndroid Build Coastguard Worker 9*9880d681SAndroid Build Coastguard Workerdefine <16 x float> @test1_rsqrt28_ps(<16 x float> %a0, <16 x float> %a1) { 10*9880d681SAndroid Build Coastguard Worker ; CHECK: kmovw 11*9880d681SAndroid Build Coastguard Worker ; CHECK: vrsqrt28ps {sae}, %zmm0, %zmm1 {%k1} # encoding: [0x62,0xf2,0x7d,0x19,0xcc,0xc8] 12*9880d681SAndroid Build Coastguard Worker %res = call <16 x float> @llvm.x86.avx512.rsqrt28.ps(<16 x float> %a0, <16 x float> %a1, i16 6, i32 8) 13*9880d681SAndroid Build Coastguard Worker ret <16 x float> %res 14*9880d681SAndroid Build Coastguard Worker} 15*9880d681SAndroid Build Coastguard Worker 16*9880d681SAndroid Build Coastguard Workerdefine <16 x float> @test2_rsqrt28_ps(<16 x float> %a0) { 17*9880d681SAndroid Build Coastguard Worker ; CHECK: vrsqrt28ps %zmm0, %zmm0 {%k1} {z} # encoding: [0x62,0xf2,0x7d,0xc9,0xcc,0xc0] 18*9880d681SAndroid Build Coastguard Worker %res = call <16 x float> @llvm.x86.avx512.rsqrt28.ps(<16 x float> %a0, <16 x float> undef, i16 6, i32 4) 19*9880d681SAndroid Build Coastguard Worker ret <16 x float> %res 20*9880d681SAndroid Build Coastguard Worker} 21*9880d681SAndroid Build Coastguard Worker 22*9880d681SAndroid Build Coastguard Workerdefine <16 x float> @test3_rsqrt28_ps(<16 x float> %a0) { 23*9880d681SAndroid Build Coastguard Worker ; CHECK: kmovw 24*9880d681SAndroid Build Coastguard Worker ; CHECK: vrsqrt28ps %zmm0, %zmm0 {%k1} {z} # encoding: [0x62,0xf2,0x7d,0xc9,0xcc,0xc0] 25*9880d681SAndroid Build Coastguard Worker %res = call <16 x float> @llvm.x86.avx512.rsqrt28.ps(<16 x float> %a0, <16 x float> zeroinitializer, i16 6, i32 4) 26*9880d681SAndroid Build Coastguard Worker ret <16 x float> %res 27*9880d681SAndroid Build Coastguard Worker} 28*9880d681SAndroid Build Coastguard Worker 29*9880d681SAndroid Build Coastguard Workerdefine <16 x float> @test4_rsqrt28_ps(<16 x float> %a0) { 30*9880d681SAndroid Build Coastguard Worker ; CHECK: vrsqrt28ps {sae}, %zmm0, %zmm0 {%k1} {z} # encoding: [0x62,0xf2,0x7d,0x99,0xcc,0xc0] 31*9880d681SAndroid Build Coastguard Worker %res = call <16 x float> @llvm.x86.avx512.rsqrt28.ps(<16 x float> %a0, <16 x float> undef, i16 6, i32 8) 32*9880d681SAndroid Build Coastguard Worker ret <16 x float> %res 33*9880d681SAndroid Build Coastguard Worker} 34*9880d681SAndroid Build Coastguard Worker 35*9880d681SAndroid Build Coastguard Worker 36*9880d681SAndroid Build Coastguard Workerdeclare <16 x float> @llvm.x86.avx512.rsqrt28.ps(<16 x float>, <16 x float>, i16, i32) nounwind readnone 37*9880d681SAndroid Build Coastguard Worker 38*9880d681SAndroid Build Coastguard Workerdefine <16 x float> @test_rcp28_ps_512(<16 x float> %a0) { 39*9880d681SAndroid Build Coastguard Worker ; CHECK: vrcp28ps {sae}, %zmm0, %zmm0 # encoding: [0x62,0xf2,0x7d,0x18,0xca,0xc0] 40*9880d681SAndroid Build Coastguard Worker %res = call <16 x float> @llvm.x86.avx512.rcp28.ps(<16 x float> %a0, <16 x float> zeroinitializer, i16 -1, i32 8) 41*9880d681SAndroid Build Coastguard Worker ret <16 x float> %res 42*9880d681SAndroid Build Coastguard Worker} 43*9880d681SAndroid Build Coastguard Workerdeclare <16 x float> @llvm.x86.avx512.rcp28.ps(<16 x float>, <16 x float>, i16, i32) nounwind readnone 44*9880d681SAndroid Build Coastguard Worker 45*9880d681SAndroid Build Coastguard Workerdefine <8 x double> @test_rcp28_pd_512(<8 x double> %a0) { 46*9880d681SAndroid Build Coastguard Worker ; CHECK: vrcp28pd {sae}, %zmm0, %zmm0 # encoding: [0x62,0xf2,0xfd,0x18,0xca,0xc0] 47*9880d681SAndroid Build Coastguard Worker %res = call <8 x double> @llvm.x86.avx512.rcp28.pd(<8 x double> %a0, <8 x double> zeroinitializer, i8 -1, i32 8) 48*9880d681SAndroid Build Coastguard Worker ret <8 x double> %res 49*9880d681SAndroid Build Coastguard Worker} 50*9880d681SAndroid Build Coastguard Workerdeclare <8 x double> @llvm.x86.avx512.rcp28.pd(<8 x double>, <8 x double>, i8, i32) nounwind readnone 51*9880d681SAndroid Build Coastguard Worker 52*9880d681SAndroid Build Coastguard Workerdefine <16 x float> @test_exp2_ps_512(<16 x float> %a0) { 53*9880d681SAndroid Build Coastguard Worker ; CHECK: vexp2ps {sae}, %zmm0, %zmm0 # encoding: [0x62,0xf2,0x7d,0x18,0xc8,0xc0] 54*9880d681SAndroid Build Coastguard Worker %res = call <16 x float> @llvm.x86.avx512.exp2.ps(<16 x float> %a0, <16 x float> zeroinitializer, i16 -1, i32 8) 55*9880d681SAndroid Build Coastguard Worker ret <16 x float> %res 56*9880d681SAndroid Build Coastguard Worker} 57*9880d681SAndroid Build Coastguard Workerdeclare <16 x float> @llvm.x86.avx512.exp2.ps(<16 x float>, <16 x float>, i16, i32) nounwind readnone 58*9880d681SAndroid Build Coastguard Worker 59*9880d681SAndroid Build Coastguard Workerdefine <8 x double> @test_exp2_pd_512(<8 x double> %a0) { 60*9880d681SAndroid Build Coastguard Worker ; CHECK: vexp2pd {sae}, %zmm0, %zmm0 # encoding: [0x62,0xf2,0xfd,0x18,0xc8,0xc0] 61*9880d681SAndroid Build Coastguard Worker %res = call <8 x double> @llvm.x86.avx512.exp2.pd(<8 x double> %a0, <8 x double> zeroinitializer, i8 -1, i32 8) 62*9880d681SAndroid Build Coastguard Worker ret <8 x double> %res 63*9880d681SAndroid Build Coastguard Worker} 64*9880d681SAndroid Build Coastguard Workerdeclare <8 x double> @llvm.x86.avx512.exp2.pd(<8 x double>, <8 x double>, i8, i32) nounwind readnone 65*9880d681SAndroid Build Coastguard Worker 66*9880d681SAndroid Build Coastguard Workerdefine <4 x float> @test_rsqrt28_ss(<4 x float> %a0) { 67*9880d681SAndroid Build Coastguard Worker ; CHECK: vrsqrt28ss {sae}, %xmm0, %xmm0, %xmm0 # encoding: [0x62,0xf2,0x7d,0x18,0xcd,0xc0] 68*9880d681SAndroid Build Coastguard Worker %res = call <4 x float> @llvm.x86.avx512.rsqrt28.ss(<4 x float> %a0, <4 x float> %a0, <4 x float> zeroinitializer, i8 -1, i32 8) ; <<4 x float>> [#uses=1] 69*9880d681SAndroid Build Coastguard Worker ret <4 x float> %res 70*9880d681SAndroid Build Coastguard Worker} 71*9880d681SAndroid Build Coastguard Workerdeclare <4 x float> @llvm.x86.avx512.rsqrt28.ss(<4 x float>, <4 x float>, <4 x float>, i8, i32) nounwind readnone 72*9880d681SAndroid Build Coastguard Worker 73*9880d681SAndroid Build Coastguard Workerdefine <4 x float> @test_rcp28_ss(<4 x float> %a0) { 74*9880d681SAndroid Build Coastguard Worker ; CHECK: vrcp28ss {sae}, %xmm0, %xmm0, %xmm0 # encoding: [0x62,0xf2,0x7d,0x18,0xcb,0xc0] 75*9880d681SAndroid Build Coastguard Worker %res = call <4 x float> @llvm.x86.avx512.rcp28.ss(<4 x float> %a0, <4 x float> %a0, <4 x float> zeroinitializer, i8 -1, i32 8) ; <<4 x float>> [#uses=1] 76*9880d681SAndroid Build Coastguard Worker ret <4 x float> %res 77*9880d681SAndroid Build Coastguard Worker} 78*9880d681SAndroid Build Coastguard Workerdeclare <4 x float> @llvm.x86.avx512.rcp28.ss(<4 x float>, <4 x float>, <4 x float>, i8, i32) nounwind readnone 79*9880d681SAndroid Build Coastguard Worker 80*9880d681SAndroid Build Coastguard Workerdefine <4 x float> @test_rsqrt28_ss_maskz(<4 x float> %a0) { 81*9880d681SAndroid Build Coastguard Worker ; CHECK: vrsqrt28ss {sae}, %xmm0, %xmm0, %xmm0 {%k1} {z} # encoding: [0x62,0xf2,0x7d,0x99,0xcd,0xc0] 82*9880d681SAndroid Build Coastguard Worker %res = call <4 x float> @llvm.x86.avx512.rsqrt28.ss(<4 x float> %a0, <4 x float> %a0, <4 x float> zeroinitializer, i8 7, i32 8) ; 83*9880d681SAndroid Build Coastguard Worker ret <4 x float> %res 84*9880d681SAndroid Build Coastguard Worker} 85*9880d681SAndroid Build Coastguard Worker 86*9880d681SAndroid Build Coastguard Workerdefine <4 x float> @test_rsqrt28_ss_mask(<4 x float> %a0, <4 x float> %b0, <4 x float> %c0) { 87*9880d681SAndroid Build Coastguard Worker ; CHECK: vrsqrt28ss {sae}, %xmm1, %xmm0, %xmm2 {%k1} # encoding: [0x62,0xf2,0x7d,0x19,0xcd,0xd1] 88*9880d681SAndroid Build Coastguard Worker %res = call <4 x float> @llvm.x86.avx512.rsqrt28.ss(<4 x float> %a0, <4 x float> %b0, <4 x float> %c0, i8 7, i32 8) ; 89*9880d681SAndroid Build Coastguard Worker ret <4 x float> %res 90*9880d681SAndroid Build Coastguard Worker} 91*9880d681SAndroid Build Coastguard Worker 92*9880d681SAndroid Build Coastguard Workerdefine <2 x double> @test_rsqrt28_sd_maskz(<2 x double> %a0) { 93*9880d681SAndroid Build Coastguard Worker ; CHECK: vrsqrt28sd {sae}, %xmm0, %xmm0, %xmm0 {%k1} {z} # encoding: [0x62,0xf2,0xfd,0x99,0xcd,0xc0] 94*9880d681SAndroid Build Coastguard Worker %res = call <2 x double> @llvm.x86.avx512.rsqrt28.sd(<2 x double> %a0, <2 x double> %a0, <2 x double> zeroinitializer, i8 7, i32 8) ; 95*9880d681SAndroid Build Coastguard Worker ret <2 x double> %res 96*9880d681SAndroid Build Coastguard Worker} 97*9880d681SAndroid Build Coastguard Worker 98*9880d681SAndroid Build Coastguard Workerdeclare <2 x double> @llvm.x86.avx512.rsqrt28.sd(<2 x double>, <2 x double>, <2 x double>, i8, i32) nounwind readnone 99*9880d681SAndroid Build Coastguard Worker 100*9880d681SAndroid Build Coastguard Workerdefine <2 x double> @test_rsqrt28_sd_maskz_mem(<2 x double> %a0, double* %ptr ) { 101*9880d681SAndroid Build Coastguard Worker ; CHECK: vrsqrt28sd (%rdi), %xmm0, %xmm0 {%k1} {z} # encoding: [0x62,0xf2,0xfd,0x89,0xcd,0x07] 102*9880d681SAndroid Build Coastguard Worker %mem = load double , double * %ptr, align 8 103*9880d681SAndroid Build Coastguard Worker %mem_v = insertelement <2 x double> undef, double %mem, i32 0 104*9880d681SAndroid Build Coastguard Worker %res = call <2 x double> @llvm.x86.avx512.rsqrt28.sd(<2 x double> %a0, <2 x double> %mem_v, <2 x double> zeroinitializer, i8 7, i32 4) ; 105*9880d681SAndroid Build Coastguard Worker ret <2 x double> %res 106*9880d681SAndroid Build Coastguard Worker} 107*9880d681SAndroid Build Coastguard Worker 108*9880d681SAndroid Build Coastguard Workerdefine <2 x double> @test_rsqrt28_sd_maskz_mem_offset(<2 x double> %a0, double* %ptr ) { 109*9880d681SAndroid Build Coastguard Worker ; CHECK: vrsqrt28sd 144(%rdi), %xmm0, %xmm0 {%k1} {z} # encoding: [0x62,0xf2,0xfd,0x89,0xcd,0x47,0x12] 110*9880d681SAndroid Build Coastguard Worker %ptr1 = getelementptr double, double* %ptr, i32 18 111*9880d681SAndroid Build Coastguard Worker %mem = load double , double * %ptr1, align 8 112*9880d681SAndroid Build Coastguard Worker %mem_v = insertelement <2 x double> undef, double %mem, i32 0 113*9880d681SAndroid Build Coastguard Worker %res = call <2 x double> @llvm.x86.avx512.rsqrt28.sd(<2 x double> %a0, <2 x double> %mem_v, <2 x double> zeroinitializer, i8 7, i32 4) ; 114*9880d681SAndroid Build Coastguard Worker ret <2 x double> %res 115*9880d681SAndroid Build Coastguard Worker} 116*9880d681SAndroid Build Coastguard Worker 117