From 13fd7373b6a95f014fa8ccb277be79656c248d14 Mon Sep 17 00:00:00 2001 From: Simon Pilgrim Date: Sat, 19 Nov 2022 18:53:02 +0000 Subject: [PATCH] [X86] znver2 - (V)EXTRACTPSrr takes 2 uops D138359 was reporting that the EXTRACTPSrr override was unnecessary, however the AMD SoG and Agner both confirm that both the rr and rm versions take 2uops (matching znver1) --- llvm/lib/Target/X86/X86ScheduleZnver2.td | 1 + llvm/test/tools/llvm-mca/X86/Znver2/resources-avx1.s | 2 +- llvm/test/tools/llvm-mca/X86/Znver2/resources-sse41.s | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/llvm/lib/Target/X86/X86ScheduleZnver2.td b/llvm/lib/Target/X86/X86ScheduleZnver2.td index 550ec78..0428656 100644 --- a/llvm/lib/Target/X86/X86ScheduleZnver2.td +++ b/llvm/lib/Target/X86/X86ScheduleZnver2.td @@ -1115,6 +1115,7 @@ def : InstRW<[Zn2WriteBROADCAST], (instrs VBROADCASTF128)>; // r32,x,i. def Zn2WriteEXTRACTPSr : SchedWriteRes<[Zn2FPU12, Zn2FPU2]> { let Latency = 2; + let NumMicroOps = 2; let ResourceCycles = [1, 2]; } def : InstRW<[Zn2WriteEXTRACTPSr], (instregex "(V?)EXTRACTPSrr")>; diff --git a/llvm/test/tools/llvm-mca/X86/Znver2/resources-avx1.s b/llvm/test/tools/llvm-mca/X86/Znver2/resources-avx1.s index dac2f1f..736ed2f 100644 --- a/llvm/test/tools/llvm-mca/X86/Znver2/resources-avx1.s +++ b/llvm/test/tools/llvm-mca/X86/Znver2/resources-avx1.s @@ -1194,7 +1194,7 @@ vzeroupper # CHECK-NEXT: 1 100 0.25 * vdpps $22, (%rax), %ymm1, %ymm2 # CHECK-NEXT: 1 1 0.33 vextractf128 $1, %ymm0, %xmm2 # CHECK-NEXT: 2 8 0.33 * vextractf128 $1, %ymm0, (%rax) -# CHECK-NEXT: 1 2 2.00 vextractps $1, %xmm0, %ecx +# CHECK-NEXT: 2 2 2.00 vextractps $1, %xmm0, %ecx # CHECK-NEXT: 2 5 2.00 * vextractps $1, %xmm0, (%rax) # CHECK-NEXT: 1 7 0.25 vhaddpd %xmm0, %xmm1, %xmm2 # CHECK-NEXT: 1 14 0.33 * vhaddpd (%rax), %xmm1, %xmm2 diff --git a/llvm/test/tools/llvm-mca/X86/Znver2/resources-sse41.s b/llvm/test/tools/llvm-mca/X86/Znver2/resources-sse41.s index 23eeeb5..5b84a17 100644 --- a/llvm/test/tools/llvm-mca/X86/Znver2/resources-sse41.s +++ b/llvm/test/tools/llvm-mca/X86/Znver2/resources-sse41.s @@ -167,7 +167,7 @@ roundss $1, (%rax), %xmm2 # CHECK-NEXT: 1 100 0.25 * dppd $22, (%rax), %xmm2 # CHECK-NEXT: 1 15 0.25 dpps $22, %xmm0, %xmm2 # CHECK-NEXT: 2 19 0.33 * dpps $22, (%rax), %xmm2 -# CHECK-NEXT: 1 2 2.00 extractps $1, %xmm0, %ecx +# CHECK-NEXT: 2 2 2.00 extractps $1, %xmm0, %ecx # CHECK-NEXT: 2 5 2.00 * extractps $1, %xmm0, (%rax) # CHECK-NEXT: 1 1 0.50 insertps $1, %xmm0, %xmm2 # CHECK-NEXT: 1 8 0.50 * insertps $1, (%rax), %xmm2 -- 2.7.4