Skip to content

Commit

Permalink
[llvm-mca][x86] Add test coverage for evex variant of vextractps
Browse files Browse the repository at this point in the history
(cherry picked from commit 3276ee3)
  • Loading branch information
RKSimon authored and tru committed Aug 26, 2024
1 parent 3ff9d92 commit 83aa83a
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 5 deletions.
9 changes: 8 additions & 1 deletion llvm/test/tools/llvm-mca/X86/Generic/resources-avx512.s
Original file line number Diff line number Diff line change
Expand Up @@ -298,6 +298,9 @@ vdivps %zmm16, %zmm17, %zmm19 {z}{k1}
vdivps (%rax), %zmm17, %zmm19 {z}{k1}
vdivps (%rax){1to16}, %zmm17, %zmm19 {z}{k1}

{evex} vextractps $1, %xmm0, %rcx
{evex} vextractps $1, %xmm0, (%rax)

vfmadd132pd %zmm16, %zmm17, %zmm19
vfmadd132pd (%rax), %zmm17, %zmm19
vfmadd132pd (%rax){1to8}, %zmm17, %zmm19
Expand Down Expand Up @@ -1334,6 +1337,8 @@ vunpcklps (%rax){1to16}, %zmm17, %zmm19 {z}{k1}
# CHECK-NEXT: 3 29 28.00 vdivps %zmm16, %zmm17, %zmm19 {%k1} {z}
# CHECK-NEXT: 4 36 28.00 * vdivps (%rax), %zmm17, %zmm19 {%k1} {z}
# CHECK-NEXT: 4 36 28.00 * vdivps (%rax){1to16}, %zmm17, %zmm19 {%k1} {z}
# CHECK-NEXT: 2 3 1.00 {evex} vextractps $1, %xmm0, %ecx
# CHECK-NEXT: 3 5 1.00 * {evex} vextractps $1, %xmm0, (%rax)
# CHECK-NEXT: 1 5 0.50 vfmadd132pd %zmm16, %zmm17, %zmm19
# CHECK-NEXT: 2 10 0.50 * vfmadd132pd (%rax), %zmm17, %zmm19
# CHECK-NEXT: 2 10 0.50 * vfmadd132pd (%rax){1to8}, %zmm17, %zmm19
Expand Down Expand Up @@ -2027,7 +2032,7 @@ vunpcklps (%rax){1to16}, %zmm17, %zmm19 {z}{k1}

# CHECK: Resource pressure per iteration:
# CHECK-NEXT: [0] [1] [2] [3] [4] [5] [6.0] [6.1]
# CHECK-NEXT: - 1506.00 197.00 334.00 16.00 522.00 299.50 299.50
# CHECK-NEXT: - 1506.00 198.00 335.00 17.00 523.00 300.00 300.00

# CHECK: Resource pressure by instruction:
# CHECK-NEXT: [0] [1] [2] [3] [4] [5] [6.0] [6.1] Instructions:
Expand Down Expand Up @@ -2290,6 +2295,8 @@ vunpcklps (%rax){1to16}, %zmm17, %zmm19 {z}{k1}
# CHECK-NEXT: - 28.00 2.50 - - 0.50 - - vdivps %zmm16, %zmm17, %zmm19 {%k1} {z}
# CHECK-NEXT: - 28.00 2.50 - - 0.50 0.50 0.50 vdivps (%rax), %zmm17, %zmm19 {%k1} {z}
# CHECK-NEXT: - 28.00 2.50 - - 0.50 0.50 0.50 vdivps (%rax){1to16}, %zmm17, %zmm19 {%k1} {z}
# CHECK-NEXT: - - 1.00 0.50 - 0.50 - - {evex} vextractps $1, %xmm0, %ecx
# CHECK-NEXT: - - - 0.50 1.00 0.50 0.50 0.50 {evex} vextractps $1, %xmm0, (%rax)
# CHECK-NEXT: - - 0.50 0.50 - - - - vfmadd132pd %zmm16, %zmm17, %zmm19
# CHECK-NEXT: - - 0.50 0.50 - - 0.50 0.50 vfmadd132pd (%rax), %zmm17, %zmm19
# CHECK-NEXT: - - 0.50 0.50 - - 0.50 0.50 vfmadd132pd (%rax){1to8}, %zmm17, %zmm19
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -298,6 +298,9 @@ vdivps %zmm16, %zmm17, %zmm19 {z}{k1}
vdivps (%rax), %zmm17, %zmm19 {z}{k1}
vdivps (%rax){1to16}, %zmm17, %zmm19 {z}{k1}

{evex} vextractps $1, %xmm0, %rcx
{evex} vextractps $1, %xmm0, (%rax)

vfmadd132pd %zmm16, %zmm17, %zmm19
vfmadd132pd (%rax), %zmm17, %zmm19
vfmadd132pd (%rax){1to8}, %zmm17, %zmm19
Expand Down Expand Up @@ -1334,6 +1337,8 @@ vunpcklps (%rax){1to16}, %zmm17, %zmm19 {z}{k1}
# CHECK-NEXT: 3 18 10.00 vdivps %zmm16, %zmm17, %zmm19 {%k1} {z}
# CHECK-NEXT: 4 25 10.00 * vdivps (%rax), %zmm17, %zmm19 {%k1} {z}
# CHECK-NEXT: 4 25 10.00 * vdivps (%rax){1to16}, %zmm17, %zmm19 {%k1} {z}
# CHECK-NEXT: 2 3 1.00 {evex} vextractps $1, %xmm0, %ecx
# CHECK-NEXT: 3 2 1.00 * {evex} vextractps $1, %xmm0, (%rax)
# CHECK-NEXT: 1 4 1.00 vfmadd132pd %zmm16, %zmm17, %zmm19
# CHECK-NEXT: 2 11 1.00 * vfmadd132pd (%rax), %zmm17, %zmm19
# CHECK-NEXT: 2 11 1.00 * vfmadd132pd (%rax){1to8}, %zmm17, %zmm19
Expand Down Expand Up @@ -2031,7 +2036,7 @@ vunpcklps (%rax){1to16}, %zmm17, %zmm19 {z}{k1}

# CHECK: Resource pressure per iteration:
# CHECK-NEXT: [0] [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11]
# CHECK-NEXT: - 612.00 398.17 99.67 327.50 327.50 8.00 585.17 2.00 8.00 8.00 8.00
# CHECK-NEXT: - 612.00 399.17 99.67 327.50 327.50 8.50 587.17 2.00 8.50 8.50 8.50

# CHECK: Resource pressure by instruction:
# CHECK-NEXT: [0] [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] Instructions:
Expand Down Expand Up @@ -2294,6 +2299,8 @@ vunpcklps (%rax){1to16}, %zmm17, %zmm19 {z}{k1}
# CHECK-NEXT: - 10.00 2.00 - - - - 1.00 - - - - vdivps %zmm16, %zmm17, %zmm19 {%k1} {z}
# CHECK-NEXT: - 10.00 2.00 - 0.50 0.50 - 1.00 - - - - vdivps (%rax), %zmm17, %zmm19 {%k1} {z}
# CHECK-NEXT: - 10.00 2.00 - 0.50 0.50 - 1.00 - - - - vdivps (%rax){1to16}, %zmm17, %zmm19 {%k1} {z}
# CHECK-NEXT: - - 1.00 - - - - 1.00 - - - - {evex} vextractps $1, %xmm0, %ecx
# CHECK-NEXT: - - - - - - 0.50 1.00 - 0.50 0.50 0.50 {evex} vextractps $1, %xmm0, (%rax)
# CHECK-NEXT: - - 1.00 - - - - - - - - - vfmadd132pd %zmm16, %zmm17, %zmm19
# CHECK-NEXT: - - 1.00 - 0.50 0.50 - - - - - - vfmadd132pd (%rax), %zmm17, %zmm19
# CHECK-NEXT: - - 1.00 - 0.50 0.50 - - - - - - vfmadd132pd (%rax){1to8}, %zmm17, %zmm19
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -298,6 +298,9 @@ vdivps %zmm16, %zmm17, %zmm19 {z}{k1}
vdivps (%rax), %zmm17, %zmm19 {z}{k1}
vdivps (%rax){1to16}, %zmm17, %zmm19 {z}{k1}

{evex} vextractps $1, %xmm0, %rcx
{evex} vextractps $1, %xmm0, (%rax)

vfmadd132pd %zmm16, %zmm17, %zmm19
vfmadd132pd (%rax), %zmm17, %zmm19
vfmadd132pd (%rax){1to8}, %zmm17, %zmm19
Expand Down Expand Up @@ -1334,6 +1337,8 @@ vunpcklps (%rax){1to16}, %zmm17, %zmm19 {z}{k1}
# CHECK-NEXT: 3 18 2.00 vdivps %zmm16, %zmm17, %zmm19 {%k1} {z}
# CHECK-NEXT: 4 25 2.00 * vdivps (%rax), %zmm17, %zmm19 {%k1} {z}
# CHECK-NEXT: 4 25 2.00 * vdivps (%rax){1to16}, %zmm17, %zmm19 {%k1} {z}
# CHECK-NEXT: 2 4 1.00 {evex} vextractps $1, %xmm0, %ecx
# CHECK-NEXT: 3 12 1.00 * {evex} vextractps $1, %xmm0, (%rax)
# CHECK-NEXT: 1 4 1.00 vfmadd132pd %zmm16, %zmm17, %zmm19
# CHECK-NEXT: 2 12 1.00 * vfmadd132pd (%rax), %zmm17, %zmm19
# CHECK-NEXT: 2 12 1.00 * vfmadd132pd (%rax){1to8}, %zmm17, %zmm19
Expand Down Expand Up @@ -2032,7 +2037,7 @@ vunpcklps (%rax){1to16}, %zmm17, %zmm19 {z}{k1}

# CHECK: Resource pressure per iteration:
# CHECK-NEXT: [0] [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12]
# CHECK-NEXT: 490.00 12.00 218.33 218.33 8.00 575.00 - 8.00 8.00 8.00 - 218.33 -
# CHECK-NEXT: 491.00 12.00 218.33 218.33 8.50 577.00 - 8.50 8.50 8.50 - 218.33 -

# CHECK: Resource pressure by instruction:
# CHECK-NEXT: [0] [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] Instructions:
Expand Down Expand Up @@ -2295,6 +2300,8 @@ vunpcklps (%rax){1to16}, %zmm17, %zmm19 {z}{k1}
# CHECK-NEXT: 2.50 - - - - 0.50 - - - - - - - vdivps %zmm16, %zmm17, %zmm19 {%k1} {z}
# CHECK-NEXT: 2.50 - 0.33 0.33 - 0.50 - - - - - 0.33 - vdivps (%rax), %zmm17, %zmm19 {%k1} {z}
# CHECK-NEXT: 2.50 - 0.33 0.33 - 0.50 - - - - - 0.33 - vdivps (%rax){1to16}, %zmm17, %zmm19 {%k1} {z}
# CHECK-NEXT: 1.00 - - - - 1.00 - - - - - - - {evex} vextractps $1, %xmm0, %ecx
# CHECK-NEXT: - - - - 0.50 1.00 - 0.50 0.50 0.50 - - - {evex} vextractps $1, %xmm0, (%rax)
# CHECK-NEXT: 1.00 - - - - - - - - - - - - vfmadd132pd %zmm16, %zmm17, %zmm19
# CHECK-NEXT: 1.00 - 0.33 0.33 - - - - - - - 0.33 - vfmadd132pd (%rax), %zmm17, %zmm19
# CHECK-NEXT: 1.00 - 0.33 0.33 - - - - - - - 0.33 - vfmadd132pd (%rax){1to8}, %zmm17, %zmm19
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -298,6 +298,9 @@ vdivps %zmm16, %zmm17, %zmm19 {z}{k1}
vdivps (%rax), %zmm17, %zmm19 {z}{k1}
vdivps (%rax){1to16}, %zmm17, %zmm19 {z}{k1}

{evex} vextractps $1, %xmm0, %rcx
{evex} vextractps $1, %xmm0, (%rax)

vfmadd132pd %zmm16, %zmm17, %zmm19
vfmadd132pd (%rax), %zmm17, %zmm19
vfmadd132pd (%rax){1to8}, %zmm17, %zmm19
Expand Down Expand Up @@ -1334,6 +1337,8 @@ vunpcklps (%rax){1to16}, %zmm17, %zmm19 {z}{k1}
# CHECK-NEXT: 3 18 10.00 vdivps %zmm16, %zmm17, %zmm19 {%k1} {z}
# CHECK-NEXT: 4 25 10.00 * vdivps (%rax), %zmm17, %zmm19 {%k1} {z}
# CHECK-NEXT: 4 25 10.00 * vdivps (%rax){1to16}, %zmm17, %zmm19 {%k1} {z}
# CHECK-NEXT: 2 3 1.00 {evex} vextractps $1, %xmm0, %ecx
# CHECK-NEXT: 3 2 1.00 * {evex} vextractps $1, %xmm0, (%rax)
# CHECK-NEXT: 1 4 0.50 vfmadd132pd %zmm16, %zmm17, %zmm19
# CHECK-NEXT: 2 11 0.50 * vfmadd132pd (%rax), %zmm17, %zmm19
# CHECK-NEXT: 2 11 0.50 * vfmadd132pd (%rax){1to8}, %zmm17, %zmm19
Expand Down Expand Up @@ -2029,7 +2034,7 @@ vunpcklps (%rax){1to16}, %zmm17, %zmm19 {z}{k1}

# CHECK: Resource pressure per iteration:
# CHECK-NEXT: [0] [1] [2] [3] [4] [5] [6] [7] [8] [9]
# CHECK-NEXT: - 612.00 339.67 99.67 332.83 332.83 16.00 643.67 2.00 5.33
# CHECK-NEXT: - 612.00 340.67 99.67 333.17 333.17 17.00 645.67 2.00 5.67

# CHECK: Resource pressure by instruction:
# CHECK-NEXT: [0] [1] [2] [3] [4] [5] [6] [7] [8] [9] Instructions:
Expand Down Expand Up @@ -2292,6 +2297,8 @@ vunpcklps (%rax){1to16}, %zmm17, %zmm19 {z}{k1}
# CHECK-NEXT: - 10.00 2.00 - - - - 1.00 - - vdivps %zmm16, %zmm17, %zmm19 {%k1} {z}
# CHECK-NEXT: - 10.00 2.00 - 0.50 0.50 - 1.00 - - vdivps (%rax), %zmm17, %zmm19 {%k1} {z}
# CHECK-NEXT: - 10.00 2.00 - 0.50 0.50 - 1.00 - - vdivps (%rax){1to16}, %zmm17, %zmm19 {%k1} {z}
# CHECK-NEXT: - - 1.00 - - - - 1.00 - - {evex} vextractps $1, %xmm0, %ecx
# CHECK-NEXT: - - - - 0.33 0.33 1.00 1.00 - 0.33 {evex} vextractps $1, %xmm0, (%rax)
# CHECK-NEXT: - - 0.50 - - - - 0.50 - - vfmadd132pd %zmm16, %zmm17, %zmm19
# CHECK-NEXT: - - 0.50 - 0.50 0.50 - 0.50 - - vfmadd132pd (%rax), %zmm17, %zmm19
# CHECK-NEXT: - - 0.50 - 0.50 0.50 - 0.50 - - vfmadd132pd (%rax){1to8}, %zmm17, %zmm19
Expand Down
9 changes: 8 additions & 1 deletion llvm/test/tools/llvm-mca/X86/Znver4/resources-avx512.s
Original file line number Diff line number Diff line change
Expand Up @@ -298,6 +298,9 @@ vdivps %zmm16, %zmm17, %zmm19 {z}{k1}
vdivps (%rax), %zmm17, %zmm19 {z}{k1}
vdivps (%rax){1to16}, %zmm17, %zmm19 {z}{k1}

{evex} vextractps $1, %xmm0, %rcx
{evex} vextractps $1, %xmm0, (%rax)

vfmadd132pd %zmm16, %zmm17, %zmm19
vfmadd132pd (%rax), %zmm17, %zmm19
vfmadd132pd (%rax){1to8}, %zmm17, %zmm19
Expand Down Expand Up @@ -1334,6 +1337,8 @@ vunpcklps (%rax){1to16}, %zmm17, %zmm19 {z}{k1}
# CHECK-NEXT: 1 11 6.00 vdivps %zmm16, %zmm17, %zmm19 {%k1} {z}
# CHECK-NEXT: 1 18 6.00 * vdivps (%rax), %zmm17, %zmm19 {%k1} {z}
# CHECK-NEXT: 1 18 6.00 * vdivps (%rax){1to16}, %zmm17, %zmm19 {%k1} {z}
# CHECK-NEXT: 2 1 1.00 {evex} vextractps $1, %xmm0, %ecx
# CHECK-NEXT: 2 2 1.00 * {evex} vextractps $1, %xmm0, (%rax)
# CHECK-NEXT: 1 4 1.00 vfmadd132pd %zmm16, %zmm17, %zmm19
# CHECK-NEXT: 1 11 1.00 * vfmadd132pd (%rax), %zmm17, %zmm19
# CHECK-NEXT: 1 11 1.00 * vfmadd132pd (%rax){1to8}, %zmm17, %zmm19
Expand Down Expand Up @@ -2042,7 +2047,7 @@ vunpcklps (%rax){1to16}, %zmm17, %zmm19 {z}{k1}

# CHECK: Resource pressure per iteration:
# CHECK-NEXT: [0] [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12.0] [12.1] [13] [14.0] [14.1] [14.2] [15.0] [15.1] [15.2] [16.0] [16.1]
# CHECK-NEXT: 2.67 2.67 2.67 - - - - - 221.00 1060.50 618.00 352.50 295.50 295.50 16.00 199.67 199.67 199.67 194.33 194.33 194.33 8.00 8.00
# CHECK-NEXT: 2.67 2.67 2.67 - - - - - 221.00 1060.50 618.00 352.50 297.00 297.00 17.00 200.00 200.00 200.00 194.33 194.33 194.33 8.50 8.50

# CHECK: Resource pressure by instruction:
# CHECK-NEXT: [0] [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12.0] [12.1] [13] [14.0] [14.1] [14.2] [15.0] [15.1] [15.2] [16.0] [16.1] Instructions:
Expand Down Expand Up @@ -2305,6 +2310,8 @@ vunpcklps (%rax){1to16}, %zmm17, %zmm19 {z}{k1}
# CHECK-NEXT: - - - - - - - - - 6.00 - - - - - - - - - - - - - vdivps %zmm16, %zmm17, %zmm19 {%k1} {z}
# CHECK-NEXT: - - - - - - - - - 6.00 - - 0.50 0.50 - 0.33 0.33 0.33 0.33 0.33 0.33 - - vdivps (%rax), %zmm17, %zmm19 {%k1} {z}
# CHECK-NEXT: - - - - - - - - - 6.00 - - 0.50 0.50 - 0.33 0.33 0.33 0.33 0.33 0.33 - - vdivps (%rax){1to16}, %zmm17, %zmm19 {%k1} {z}
# CHECK-NEXT: - - - - - - - - - - - - 1.00 1.00 - - - - - - - - - {evex} vextractps $1, %xmm0, %ecx
# CHECK-NEXT: - - - - - - - - - - - - 0.50 0.50 1.00 0.33 0.33 0.33 - - - 0.50 0.50 {evex} vextractps $1, %xmm0, (%rax)
# CHECK-NEXT: - - - - - - - - 1.00 1.00 - - - - - - - - - - - - - vfmadd132pd %zmm16, %zmm17, %zmm19
# CHECK-NEXT: - - - - - - - - 1.00 1.00 - - 0.50 0.50 - 0.33 0.33 0.33 0.33 0.33 0.33 - - vfmadd132pd (%rax), %zmm17, %zmm19
# CHECK-NEXT: - - - - - - - - 1.00 1.00 - - 0.50 0.50 - 0.33 0.33 0.33 0.33 0.33 0.33 - - vfmadd132pd (%rax){1to8}, %zmm17, %zmm19
Expand Down

0 comments on commit 83aa83a

Please sign in to comment.