xref: /aosp_15_r20/external/llvm/test/CodeGen/X86/avx512-scalarIntrinsics.ll (revision 9880d6810fe72a1726cb53787c6711e909410d58)
1*9880d681SAndroid Build Coastguard Worker; RUN: llc < %s -mtriple=x86_64-apple-darwin -mcpu=skx | FileCheck %s
2*9880d681SAndroid Build Coastguard Worker; RUN: llc < %s -mtriple=x86_64-apple-darwin -mcpu=knl | FileCheck %s
3*9880d681SAndroid Build Coastguard Worker
4*9880d681SAndroid Build Coastguard Worker
5*9880d681SAndroid Build Coastguard Workerdefine <4 x float> @test_rsqrt14_ss(<4 x float> %a0) {
6*9880d681SAndroid Build Coastguard Worker  ; CHECK-LABEL: test_rsqrt14_ss:
7*9880d681SAndroid Build Coastguard Worker  ; CHECK:       ## BB#0:
8*9880d681SAndroid Build Coastguard Worker  ; CHECK-NEXT:    vrsqrt14ss %xmm0, %xmm0, %xmm0
9*9880d681SAndroid Build Coastguard Worker  ; CHECK-NEXT:    retq
10*9880d681SAndroid Build Coastguard Worker    %res = call <4 x float> @llvm.x86.avx512.rsqrt14.ss(<4 x float> %a0, <4 x float> %a0, <4 x float> zeroinitializer, i8 -1) ;
11*9880d681SAndroid Build Coastguard Worker    ret <4 x float> %res
12*9880d681SAndroid Build Coastguard Worker}
13*9880d681SAndroid Build Coastguard Workerdeclare <4 x float> @llvm.x86.avx512.rsqrt14.ss(<4 x float>, <4 x float>, <4 x float>, i8) nounwind readnone
14*9880d681SAndroid Build Coastguard Worker
15*9880d681SAndroid Build Coastguard Workerdefine <4 x float> @test_rcp14_ss(<4 x float> %a0) {
16*9880d681SAndroid Build Coastguard Worker  ; CHECK-LABEL: test_rcp14_ss:
17*9880d681SAndroid Build Coastguard Worker  ; CHECK:       ## BB#0:
18*9880d681SAndroid Build Coastguard Worker  ; CHECK-NEXT:    vrcp14ss %xmm0, %xmm0, %xmm0
19*9880d681SAndroid Build Coastguard Worker  ; CHECK-NEXT:    retq
20*9880d681SAndroid Build Coastguard Worker    %res = call <4 x float> @llvm.x86.avx512.rcp14.ss(<4 x float> %a0, <4 x float> %a0, <4 x float> zeroinitializer, i8 -1) ;
21*9880d681SAndroid Build Coastguard Worker    ret <4 x float> %res
22*9880d681SAndroid Build Coastguard Worker}
23*9880d681SAndroid Build Coastguard Workerdeclare <4 x float> @llvm.x86.avx512.rcp14.ss(<4 x float>, <4 x float>, <4 x float>, i8) nounwind readnone
24*9880d681SAndroid Build Coastguard Worker
25*9880d681SAndroid Build Coastguard Workerdefine <2 x double> @test_rsqrt14_sd(<2 x double> %a0) {
26*9880d681SAndroid Build Coastguard Worker  ; CHECK-LABEL: test_rsqrt14_sd:
27*9880d681SAndroid Build Coastguard Worker  ; CHECK:       ## BB#0:
28*9880d681SAndroid Build Coastguard Worker  ; CHECK-NEXT:    vrsqrt14sd %xmm0, %xmm0, %xmm0
29*9880d681SAndroid Build Coastguard Worker  ; CHECK-NEXT:    retq
30*9880d681SAndroid Build Coastguard Worker    %res = call <2 x double> @llvm.x86.avx512.rsqrt14.sd(<2 x double> %a0, <2 x double> %a0, <2 x double> zeroinitializer, i8 -1) ;
31*9880d681SAndroid Build Coastguard Worker    ret <2 x double> %res
32*9880d681SAndroid Build Coastguard Worker}
33*9880d681SAndroid Build Coastguard Workerdeclare <2 x double> @llvm.x86.avx512.rsqrt14.sd(<2 x double>, <2 x double>, <2 x double>, i8) nounwind readnone
34*9880d681SAndroid Build Coastguard Worker
35*9880d681SAndroid Build Coastguard Workerdefine <2 x double> @test_rcp14_sd(<2 x double> %a0) {
36*9880d681SAndroid Build Coastguard Worker  ; CHECK-LABEL: test_rcp14_sd:
37*9880d681SAndroid Build Coastguard Worker  ; CHECK:       ## BB#0:
38*9880d681SAndroid Build Coastguard Worker  ; CHECK-NEXT:    vrcp14sd %xmm0, %xmm0, %xmm0
39*9880d681SAndroid Build Coastguard Worker  ; CHECK-NEXT:    retq
40*9880d681SAndroid Build Coastguard Worker    %res = call <2 x double> @llvm.x86.avx512.rcp14.sd(<2 x double> %a0, <2 x double> %a0, <2 x double> zeroinitializer, i8 -1) ;
41*9880d681SAndroid Build Coastguard Worker    ret <2 x double> %res
42*9880d681SAndroid Build Coastguard Worker
43*9880d681SAndroid Build Coastguard Worker}
44*9880d681SAndroid Build Coastguard Workerdeclare <2 x double> @llvm.x86.avx512.rcp14.sd(<2 x double>, <2 x double>, <2 x double>, i8) nounwind readnone
45*9880d681SAndroid Build Coastguard Worker
46*9880d681SAndroid Build Coastguard Workerdeclare <4 x float> @llvm.x86.avx512.mask.scalef.ss(<4 x float>, <4 x float>,<4 x float>, i8, i32)
47*9880d681SAndroid Build Coastguard Workerdefine <4 x float>@test_int_x86_avx512_mask_scalef_ss(<4 x float> %x0, <4 x float> %x1, <4 x float> %x3, i8 %x4) {
48*9880d681SAndroid Build Coastguard Worker  ; CHECK-LABEL: test_int_x86_avx512_mask_scalef_ss:
49*9880d681SAndroid Build Coastguard Worker  ; CHECK:    vscalefss %xmm1, %xmm0, %xmm2 {%k1}
50*9880d681SAndroid Build Coastguard Worker  ; CHECK:    vscalefss {rn-sae}, %xmm1, %xmm0, %xmm0
51*9880d681SAndroid Build Coastguard Worker    %res = call <4 x float> @llvm.x86.avx512.mask.scalef.ss(<4 x float> %x0, <4 x float> %x1, <4 x float> %x3, i8 %x4, i32 4)
52*9880d681SAndroid Build Coastguard Worker    %res1 = call <4 x float> @llvm.x86.avx512.mask.scalef.ss(<4 x float> %x0, <4 x float> %x1, <4 x float> %x3, i8 -1, i32 8)
53*9880d681SAndroid Build Coastguard Worker    %res2 = fadd <4 x float> %res, %res1
54*9880d681SAndroid Build Coastguard Worker    ret <4 x float> %res2
55*9880d681SAndroid Build Coastguard Worker}
56*9880d681SAndroid Build Coastguard Worker
57*9880d681SAndroid Build Coastguard Workerdeclare <2 x double> @llvm.x86.avx512.mask.scalef.sd(<2 x double>, <2 x double>,<2 x double>, i8, i32)
58*9880d681SAndroid Build Coastguard Workerdefine <2 x double>@test_int_x86_avx512_mask_scalef_sd(<2 x double> %x0, <2 x double> %x1, <2 x double> %x3, i8 %x4) {
59*9880d681SAndroid Build Coastguard Worker  ; CHECK-LABEL: test_int_x86_avx512_mask_scalef_sd:
60*9880d681SAndroid Build Coastguard Worker  ; CHECK:    vscalefsd %xmm1, %xmm0, %xmm2 {%k1}
61*9880d681SAndroid Build Coastguard Worker  ; CHECK:    vscalefsd {rn-sae}, %xmm1, %xmm0, %xmm0
62*9880d681SAndroid Build Coastguard Worker    %res = call <2 x double> @llvm.x86.avx512.mask.scalef.sd(<2 x double> %x0, <2 x double> %x1, <2 x double> %x3, i8 %x4, i32 4)
63*9880d681SAndroid Build Coastguard Worker    %res1 = call <2 x double> @llvm.x86.avx512.mask.scalef.sd(<2 x double> %x0, <2 x double> %x1, <2 x double> %x3, i8 -1, i32 8)
64*9880d681SAndroid Build Coastguard Worker    %res2 = fadd <2 x double> %res, %res1
65*9880d681SAndroid Build Coastguard Worker    ret <2 x double> %res2
66*9880d681SAndroid Build Coastguard Worker}
67