• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2; RUN: llc < %s -mtriple=x86_64-unknown-unknown -print-schedule -mcpu=x86-64 -mattr=+avx512vpopcntdq | FileCheck %s --check-prefix=GENERIC
3; RUN: llc < %s -mtriple=x86_64-unknown-unknown -print-schedule -mcpu=icelake-client | FileCheck %s --check-prefix=ICELAKE
4; RUN: llc < %s -mtriple=x86_64-unknown-unknown -print-schedule -mcpu=icelake-server | FileCheck %s --check-prefix=ICELAKE
5
6define void @test_vpopcntd(<16 x i32> %a0, <16 x i32> %a1, <16 x i32> *%a2, i16 %a3) {
7; GENERIC-LABEL: test_vpopcntd:
8; GENERIC:       # %bb.0:
9; GENERIC-NEXT:    kmovw %esi, %k1 # sched: [1:0.33]
10; GENERIC-NEXT:    #APP
11; GENERIC-NEXT:    vpopcntd %zmm1, %zmm0 # sched: [1:0.50]
12; GENERIC-NEXT:    vpopcntd %zmm1, %zmm0 {%k1} # sched: [1:0.50]
13; GENERIC-NEXT:    vpopcntd %zmm1, %zmm0 {%k1} {z} # sched: [1:0.50]
14; GENERIC-NEXT:    vpopcntd (%rdi), %zmm0 # sched: [8:0.50]
15; GENERIC-NEXT:    vpopcntd (%rdi), %zmm0 {%k1} # sched: [8:0.50]
16; GENERIC-NEXT:    vpopcntd (%rdi), %zmm0 {%k1} {z} # sched: [8:0.50]
17; GENERIC-NEXT:    vpopcntd (%rdi){1to16}, %zmm0 # sched: [8:0.50]
18; GENERIC-NEXT:    vpopcntd (%rdi){1to16}, %zmm0 {%k1} # sched: [8:0.50]
19; GENERIC-NEXT:    vpopcntd (%rdi){1to16}, %zmm0 {%k1} {z} # sched: [8:0.50]
20; GENERIC-NEXT:    #NO_APP
21; GENERIC-NEXT:    vzeroupper # sched: [100:0.33]
22; GENERIC-NEXT:    retq # sched: [1:1.00]
23;
24; ICELAKE-LABEL: test_vpopcntd:
25; ICELAKE:       # %bb.0:
26; ICELAKE-NEXT:    kmovd %esi, %k1 # sched: [1:1.00]
27; ICELAKE-NEXT:    #APP
28; ICELAKE-NEXT:    vpopcntd %zmm1, %zmm0 # sched: [1:1.00]
29; ICELAKE-NEXT:    vpopcntd %zmm1, %zmm0 {%k1} # sched: [1:1.00]
30; ICELAKE-NEXT:    vpopcntd %zmm1, %zmm0 {%k1} {z} # sched: [1:1.00]
31; ICELAKE-NEXT:    vpopcntd (%rdi), %zmm0 # sched: [8:1.00]
32; ICELAKE-NEXT:    vpopcntd (%rdi), %zmm0 {%k1} # sched: [8:1.00]
33; ICELAKE-NEXT:    vpopcntd (%rdi), %zmm0 {%k1} {z} # sched: [8:1.00]
34; ICELAKE-NEXT:    vpopcntd (%rdi){1to16}, %zmm0 # sched: [8:1.00]
35; ICELAKE-NEXT:    vpopcntd (%rdi){1to16}, %zmm0 {%k1} # sched: [8:1.00]
36; ICELAKE-NEXT:    vpopcntd (%rdi){1to16}, %zmm0 {%k1} {z} # sched: [8:1.00]
37; ICELAKE-NEXT:    #NO_APP
38; ICELAKE-NEXT:    vzeroupper # sched: [4:1.00]
39; ICELAKE-NEXT:    retq # sched: [7:1.00]
40  tail call void asm "vpopcntd $1, $0 \0A\09 vpopcntd $1, $0 {$3} \0A\09 vpopcntd $1, $0 {$3} {z} \0A\09 vpopcntd $2, $0 \0A\09 vpopcntd $2, $0 {$3} \0A\09 vpopcntd $2, $0 {$3} {z} \0A\09 vpopcntd $2{1to16}, $0 \0A\09 vpopcntd $2{1to16}, $0 {$3} \0A\09 vpopcntd $2{1to16}, $0 {$3} {z}", "v,v,*m,^Yk"(<16 x i32> %a0, <16 x i32> %a1, <16 x i32> *%a2, i16 %a3) nounwind
41  ret void
42}
43
44define void @test_vpopcntq(<8 x i64> %a0, <8 x i64> %a1, <8 x i64> *%a2, i8 %a3) {
45; GENERIC-LABEL: test_vpopcntq:
46; GENERIC:       # %bb.0:
47; GENERIC-NEXT:    kmovw %esi, %k1 # sched: [1:0.33]
48; GENERIC-NEXT:    #APP
49; GENERIC-NEXT:    vpopcntq %zmm1, %zmm0 # sched: [1:0.50]
50; GENERIC-NEXT:    vpopcntq %zmm1, %zmm0 {%k1} # sched: [1:0.50]
51; GENERIC-NEXT:    vpopcntq %zmm1, %zmm0 {%k1} {z} # sched: [1:0.50]
52; GENERIC-NEXT:    vpopcntq (%rdi), %zmm0 # sched: [8:0.50]
53; GENERIC-NEXT:    vpopcntq (%rdi), %zmm0 {%k1} # sched: [8:0.50]
54; GENERIC-NEXT:    vpopcntq (%rdi), %zmm0 {%k1} {z} # sched: [8:0.50]
55; GENERIC-NEXT:    vpopcntq (%rdi){1to8}, %zmm0 # sched: [8:0.50]
56; GENERIC-NEXT:    vpopcntq (%rdi){1to8}, %zmm0 {%k1} # sched: [8:0.50]
57; GENERIC-NEXT:    vpopcntq (%rdi){1to8}, %zmm0 {%k1} {z} # sched: [8:0.50]
58; GENERIC-NEXT:    #NO_APP
59; GENERIC-NEXT:    vzeroupper # sched: [100:0.33]
60; GENERIC-NEXT:    retq # sched: [1:1.00]
61;
62; ICELAKE-LABEL: test_vpopcntq:
63; ICELAKE:       # %bb.0:
64; ICELAKE-NEXT:    kmovd %esi, %k1 # sched: [1:1.00]
65; ICELAKE-NEXT:    #APP
66; ICELAKE-NEXT:    vpopcntq %zmm1, %zmm0 # sched: [1:1.00]
67; ICELAKE-NEXT:    vpopcntq %zmm1, %zmm0 {%k1} # sched: [1:1.00]
68; ICELAKE-NEXT:    vpopcntq %zmm1, %zmm0 {%k1} {z} # sched: [1:1.00]
69; ICELAKE-NEXT:    vpopcntq (%rdi), %zmm0 # sched: [8:1.00]
70; ICELAKE-NEXT:    vpopcntq (%rdi), %zmm0 {%k1} # sched: [8:1.00]
71; ICELAKE-NEXT:    vpopcntq (%rdi), %zmm0 {%k1} {z} # sched: [8:1.00]
72; ICELAKE-NEXT:    vpopcntq (%rdi){1to8}, %zmm0 # sched: [8:1.00]
73; ICELAKE-NEXT:    vpopcntq (%rdi){1to8}, %zmm0 {%k1} # sched: [8:1.00]
74; ICELAKE-NEXT:    vpopcntq (%rdi){1to8}, %zmm0 {%k1} {z} # sched: [8:1.00]
75; ICELAKE-NEXT:    #NO_APP
76; ICELAKE-NEXT:    vzeroupper # sched: [4:1.00]
77; ICELAKE-NEXT:    retq # sched: [7:1.00]
78  tail call void asm "vpopcntq $1, $0 \0A\09 vpopcntq $1, $0 {$3} \0A\09 vpopcntq $1, $0 {$3} {z} \0A\09 vpopcntq $2, $0 \0A\09 vpopcntq $2, $0 {$3} \0A\09 vpopcntq $2, $0 {$3} {z} \0A\09 vpopcntq $2{1to8}, $0 \0A\09 vpopcntq $2{1to8}, $0 {$3} \0A\09 vpopcntq $2{1to8}, $0 {$3} {z}", "v,v,*m,^Yk"(<8 x i64> %a0, <8 x i64> %a1, <8 x i64> *%a2, i8 %a3) nounwind
79  ret void
80}
81