1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-25 20:23:11 +01:00

[X86] AMD Zen 3: same-reg SSE XMM PSUB{B,W,D,Q} is a 1-cycle(!) dep-breaking zero-idiom

As confirmed by the exegesis measurements, and ref docs.
This commit is contained in:
Roman Lebedev 2021-05-14 17:16:50 +03:00
parent 554780708a
commit 5b956e1952
2 changed files with 70 additions and 69 deletions

View File

@ -1573,7 +1573,8 @@ def : IsZeroIdiomFunction<[
// int variants.
PXORrr,
PANDNrr
PANDNrr,
PSUBBrr, PSUBWrr, PSUBDrr, PSUBQrr
], ZeroIdiomPredicate>,
// AVX XMM Zero-idioms.

View File

@ -601,12 +601,12 @@ psubq %xmm0, %xmm1
# CHECK: Iterations: 10000
# CHECK-NEXT: Instructions: 20000
# CHECK-NEXT: Total Cycles: 20003
# CHECK-NEXT: Total Cycles: 5004
# CHECK-NEXT: Total uOps: 20000
# CHECK: Dispatch Width: 6
# CHECK-NEXT: uOps Per Cycle: 1.00
# CHECK-NEXT: IPC: 1.00
# CHECK-NEXT: uOps Per Cycle: 4.00
# CHECK-NEXT: IPC: 4.00
# CHECK-NEXT: Block RThroughput: 0.5
# CHECK: Instruction Info:
@ -622,13 +622,13 @@ psubq %xmm0, %xmm1
# CHECK-NEXT: 1 1 0.25 psubb %xmm0, %xmm1
# CHECK: Register File statistics:
# CHECK-NEXT: Total number of mappings created: 20000
# CHECK-NEXT: Max number of mappings used: 66
# CHECK-NEXT: Total number of mappings created: 10000
# CHECK-NEXT: Max number of mappings used: 37
# CHECK: * Register File #1 -- Zn3FpPRF:
# CHECK-NEXT: Number of physical registers: 160
# CHECK-NEXT: Total number of mappings created: 20000
# CHECK-NEXT: Max number of mappings used: 66
# CHECK-NEXT: Total number of mappings created: 10000
# CHECK-NEXT: Max number of mappings used: 37
# CHECK: * Register File #2 -- Zn3IntegerPRF:
# CHECK-NEXT: Number of physical registers: 192
@ -666,16 +666,16 @@ psubq %xmm0, %xmm1
# 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:
# CHECK-NEXT: - - - - - - - - - 0.50 - 0.50 - - - - - - - - - - - psubb %xmm1, %xmm1
# CHECK-NEXT: - - - - - - - - 0.50 - 0.50 - - - - - - - - - - - - psubb %xmm0, %xmm1
# CHECK-NEXT: - - - - - - - - - 0.50 0.25 0.25 - - - - - - - - - - - psubb %xmm1, %xmm1
# CHECK-NEXT: - - - - - - - - 0.50 - 0.25 0.25 - - - - - - - - - - - psubb %xmm0, %xmm1
# CHECK: Timeline view:
# CHECK-NEXT: Index 0123456
# CHECK-NEXT: Index 01234
# CHECK: [0,0] DeER .. psubb %xmm1, %xmm1
# CHECK-NEXT: [0,1] D=eER.. psubb %xmm0, %xmm1
# CHECK-NEXT: [1,0] D==eER. psubb %xmm1, %xmm1
# CHECK-NEXT: [1,1] D===eER psubb %xmm0, %xmm1
# CHECK: [0,0] DeER. psubb %xmm1, %xmm1
# CHECK-NEXT: [0,1] D=eER psubb %xmm0, %xmm1
# CHECK-NEXT: [1,0] DeE-R psubb %xmm1, %xmm1
# CHECK-NEXT: [1,1] D=eER psubb %xmm0, %xmm1
# CHECK: Average Wait times (based on the timeline view):
# CHECK-NEXT: [0]: Executions
@ -684,20 +684,20 @@ psubq %xmm0, %xmm1
# CHECK-NEXT: [3]: Average time elapsed from WB until retire stage
# CHECK: [0] [1] [2] [3]
# CHECK-NEXT: 0. 2 2.0 0.5 0.0 psubb %xmm1, %xmm1
# CHECK-NEXT: 1. 2 3.0 0.0 0.0 psubb %xmm0, %xmm1
# CHECK-NEXT: 2 2.5 0.3 0.0 <total>
# CHECK-NEXT: 0. 2 1.0 1.0 0.5 psubb %xmm1, %xmm1
# CHECK-NEXT: 1. 2 2.0 0.0 0.0 psubb %xmm0, %xmm1
# CHECK-NEXT: 2 1.5 0.5 0.3 <total>
# CHECK: [7] Code Region
# CHECK: Iterations: 10000
# CHECK-NEXT: Instructions: 20000
# CHECK-NEXT: Total Cycles: 20003
# CHECK-NEXT: Total Cycles: 5004
# CHECK-NEXT: Total uOps: 20000
# CHECK: Dispatch Width: 6
# CHECK-NEXT: uOps Per Cycle: 1.00
# CHECK-NEXT: IPC: 1.00
# CHECK-NEXT: uOps Per Cycle: 4.00
# CHECK-NEXT: IPC: 4.00
# CHECK-NEXT: Block RThroughput: 0.5
# CHECK: Instruction Info:
@ -713,13 +713,13 @@ psubq %xmm0, %xmm1
# CHECK-NEXT: 1 1 0.25 psubw %xmm0, %xmm1
# CHECK: Register File statistics:
# CHECK-NEXT: Total number of mappings created: 20000
# CHECK-NEXT: Max number of mappings used: 66
# CHECK-NEXT: Total number of mappings created: 10000
# CHECK-NEXT: Max number of mappings used: 37
# CHECK: * Register File #1 -- Zn3FpPRF:
# CHECK-NEXT: Number of physical registers: 160
# CHECK-NEXT: Total number of mappings created: 20000
# CHECK-NEXT: Max number of mappings used: 66
# CHECK-NEXT: Total number of mappings created: 10000
# CHECK-NEXT: Max number of mappings used: 37
# CHECK: * Register File #2 -- Zn3IntegerPRF:
# CHECK-NEXT: Number of physical registers: 192
@ -757,16 +757,16 @@ psubq %xmm0, %xmm1
# 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:
# CHECK-NEXT: - - - - - - - - - 0.50 - 0.50 - - - - - - - - - - - psubw %xmm1, %xmm1
# CHECK-NEXT: - - - - - - - - 0.50 - 0.50 - - - - - - - - - - - - psubw %xmm0, %xmm1
# CHECK-NEXT: - - - - - - - - - 0.50 0.25 0.25 - - - - - - - - - - - psubw %xmm1, %xmm1
# CHECK-NEXT: - - - - - - - - 0.50 - 0.25 0.25 - - - - - - - - - - - psubw %xmm0, %xmm1
# CHECK: Timeline view:
# CHECK-NEXT: Index 0123456
# CHECK-NEXT: Index 01234
# CHECK: [0,0] DeER .. psubw %xmm1, %xmm1
# CHECK-NEXT: [0,1] D=eER.. psubw %xmm0, %xmm1
# CHECK-NEXT: [1,0] D==eER. psubw %xmm1, %xmm1
# CHECK-NEXT: [1,1] D===eER psubw %xmm0, %xmm1
# CHECK: [0,0] DeER. psubw %xmm1, %xmm1
# CHECK-NEXT: [0,1] D=eER psubw %xmm0, %xmm1
# CHECK-NEXT: [1,0] DeE-R psubw %xmm1, %xmm1
# CHECK-NEXT: [1,1] D=eER psubw %xmm0, %xmm1
# CHECK: Average Wait times (based on the timeline view):
# CHECK-NEXT: [0]: Executions
@ -775,20 +775,20 @@ psubq %xmm0, %xmm1
# CHECK-NEXT: [3]: Average time elapsed from WB until retire stage
# CHECK: [0] [1] [2] [3]
# CHECK-NEXT: 0. 2 2.0 0.5 0.0 psubw %xmm1, %xmm1
# CHECK-NEXT: 1. 2 3.0 0.0 0.0 psubw %xmm0, %xmm1
# CHECK-NEXT: 2 2.5 0.3 0.0 <total>
# CHECK-NEXT: 0. 2 1.0 1.0 0.5 psubw %xmm1, %xmm1
# CHECK-NEXT: 1. 2 2.0 0.0 0.0 psubw %xmm0, %xmm1
# CHECK-NEXT: 2 1.5 0.5 0.3 <total>
# CHECK: [8] Code Region
# CHECK: Iterations: 10000
# CHECK-NEXT: Instructions: 20000
# CHECK-NEXT: Total Cycles: 20003
# CHECK-NEXT: Total Cycles: 5004
# CHECK-NEXT: Total uOps: 20000
# CHECK: Dispatch Width: 6
# CHECK-NEXT: uOps Per Cycle: 1.00
# CHECK-NEXT: IPC: 1.00
# CHECK-NEXT: uOps Per Cycle: 4.00
# CHECK-NEXT: IPC: 4.00
# CHECK-NEXT: Block RThroughput: 0.5
# CHECK: Instruction Info:
@ -804,13 +804,13 @@ psubq %xmm0, %xmm1
# CHECK-NEXT: 1 1 0.25 psubd %xmm0, %xmm1
# CHECK: Register File statistics:
# CHECK-NEXT: Total number of mappings created: 20000
# CHECK-NEXT: Max number of mappings used: 66
# CHECK-NEXT: Total number of mappings created: 10000
# CHECK-NEXT: Max number of mappings used: 37
# CHECK: * Register File #1 -- Zn3FpPRF:
# CHECK-NEXT: Number of physical registers: 160
# CHECK-NEXT: Total number of mappings created: 20000
# CHECK-NEXT: Max number of mappings used: 66
# CHECK-NEXT: Total number of mappings created: 10000
# CHECK-NEXT: Max number of mappings used: 37
# CHECK: * Register File #2 -- Zn3IntegerPRF:
# CHECK-NEXT: Number of physical registers: 192
@ -848,16 +848,16 @@ psubq %xmm0, %xmm1
# 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:
# CHECK-NEXT: - - - - - - - - - 0.50 - 0.50 - - - - - - - - - - - psubd %xmm1, %xmm1
# CHECK-NEXT: - - - - - - - - 0.50 - 0.50 - - - - - - - - - - - - psubd %xmm0, %xmm1
# CHECK-NEXT: - - - - - - - - - 0.50 0.25 0.25 - - - - - - - - - - - psubd %xmm1, %xmm1
# CHECK-NEXT: - - - - - - - - 0.50 - 0.25 0.25 - - - - - - - - - - - psubd %xmm0, %xmm1
# CHECK: Timeline view:
# CHECK-NEXT: Index 0123456
# CHECK-NEXT: Index 01234
# CHECK: [0,0] DeER .. psubd %xmm1, %xmm1
# CHECK-NEXT: [0,1] D=eER.. psubd %xmm0, %xmm1
# CHECK-NEXT: [1,0] D==eER. psubd %xmm1, %xmm1
# CHECK-NEXT: [1,1] D===eER psubd %xmm0, %xmm1
# CHECK: [0,0] DeER. psubd %xmm1, %xmm1
# CHECK-NEXT: [0,1] D=eER psubd %xmm0, %xmm1
# CHECK-NEXT: [1,0] DeE-R psubd %xmm1, %xmm1
# CHECK-NEXT: [1,1] D=eER psubd %xmm0, %xmm1
# CHECK: Average Wait times (based on the timeline view):
# CHECK-NEXT: [0]: Executions
@ -866,20 +866,20 @@ psubq %xmm0, %xmm1
# CHECK-NEXT: [3]: Average time elapsed from WB until retire stage
# CHECK: [0] [1] [2] [3]
# CHECK-NEXT: 0. 2 2.0 0.5 0.0 psubd %xmm1, %xmm1
# CHECK-NEXT: 1. 2 3.0 0.0 0.0 psubd %xmm0, %xmm1
# CHECK-NEXT: 2 2.5 0.3 0.0 <total>
# CHECK-NEXT: 0. 2 1.0 1.0 0.5 psubd %xmm1, %xmm1
# CHECK-NEXT: 1. 2 2.0 0.0 0.0 psubd %xmm0, %xmm1
# CHECK-NEXT: 2 1.5 0.5 0.3 <total>
# CHECK: [9] Code Region
# CHECK: Iterations: 10000
# CHECK-NEXT: Instructions: 20000
# CHECK-NEXT: Total Cycles: 20003
# CHECK-NEXT: Total Cycles: 5004
# CHECK-NEXT: Total uOps: 20000
# CHECK: Dispatch Width: 6
# CHECK-NEXT: uOps Per Cycle: 1.00
# CHECK-NEXT: IPC: 1.00
# CHECK-NEXT: uOps Per Cycle: 4.00
# CHECK-NEXT: IPC: 4.00
# CHECK-NEXT: Block RThroughput: 0.5
# CHECK: Instruction Info:
@ -895,13 +895,13 @@ psubq %xmm0, %xmm1
# CHECK-NEXT: 1 1 0.25 psubq %xmm0, %xmm1
# CHECK: Register File statistics:
# CHECK-NEXT: Total number of mappings created: 20000
# CHECK-NEXT: Max number of mappings used: 66
# CHECK-NEXT: Total number of mappings created: 10000
# CHECK-NEXT: Max number of mappings used: 37
# CHECK: * Register File #1 -- Zn3FpPRF:
# CHECK-NEXT: Number of physical registers: 160
# CHECK-NEXT: Total number of mappings created: 20000
# CHECK-NEXT: Max number of mappings used: 66
# CHECK-NEXT: Total number of mappings created: 10000
# CHECK-NEXT: Max number of mappings used: 37
# CHECK: * Register File #2 -- Zn3IntegerPRF:
# CHECK-NEXT: Number of physical registers: 192
@ -939,16 +939,16 @@ psubq %xmm0, %xmm1
# 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:
# CHECK-NEXT: - - - - - - - - - 0.50 - 0.50 - - - - - - - - - - - psubq %xmm1, %xmm1
# CHECK-NEXT: - - - - - - - - 0.50 - 0.50 - - - - - - - - - - - - psubq %xmm0, %xmm1
# CHECK-NEXT: - - - - - - - - - 0.50 0.25 0.25 - - - - - - - - - - - psubq %xmm1, %xmm1
# CHECK-NEXT: - - - - - - - - 0.50 - 0.25 0.25 - - - - - - - - - - - psubq %xmm0, %xmm1
# CHECK: Timeline view:
# CHECK-NEXT: Index 0123456
# CHECK-NEXT: Index 01234
# CHECK: [0,0] DeER .. psubq %xmm1, %xmm1
# CHECK-NEXT: [0,1] D=eER.. psubq %xmm0, %xmm1
# CHECK-NEXT: [1,0] D==eER. psubq %xmm1, %xmm1
# CHECK-NEXT: [1,1] D===eER psubq %xmm0, %xmm1
# CHECK: [0,0] DeER. psubq %xmm1, %xmm1
# CHECK-NEXT: [0,1] D=eER psubq %xmm0, %xmm1
# CHECK-NEXT: [1,0] DeE-R psubq %xmm1, %xmm1
# CHECK-NEXT: [1,1] D=eER psubq %xmm0, %xmm1
# CHECK: Average Wait times (based on the timeline view):
# CHECK-NEXT: [0]: Executions
@ -957,6 +957,6 @@ psubq %xmm0, %xmm1
# CHECK-NEXT: [3]: Average time elapsed from WB until retire stage
# CHECK: [0] [1] [2] [3]
# CHECK-NEXT: 0. 2 2.0 0.5 0.0 psubq %xmm1, %xmm1
# CHECK-NEXT: 1. 2 3.0 0.0 0.0 psubq %xmm0, %xmm1
# CHECK-NEXT: 2 2.5 0.3 0.0 <total>
# CHECK-NEXT: 0. 2 1.0 1.0 0.5 psubq %xmm1, %xmm1
# CHECK-NEXT: 1. 2 2.0 0.0 0.0 psubq %xmm0, %xmm1
# CHECK-NEXT: 2 1.5 0.5 0.3 <total>