diff --git a/llvm/lib/Target/X86/X86ScheduleBtVer2.td b/llvm/lib/Target/X86/X86ScheduleBtVer2.td index c9af75ceed08..502c569f3540 100644 --- a/llvm/lib/Target/X86/X86ScheduleBtVer2.td +++ b/llvm/lib/Target/X86/X86ScheduleBtVer2.td @@ -647,6 +647,16 @@ def JWriteVMOVNTPYSt: SchedWriteRes<[JFPU1, JSTC, JSAGU]> { } def : InstRW<[JWriteVMOVNTPYSt], (instrs VMOVNTDQYmr, VMOVNTPDYmr, VMOVNTPSYmr)>; +def JWriteFComi : SchedWriteRes<[JFPU0, JFPA, JALU0]> { + let Latency = 3; +} +def : InstRW<[JWriteFComi], (instregex "(V)?(U)?COMIS(D|S)rr")>; + +def JWriteFComiLd : SchedWriteRes<[JLAGU, JFPU0, JFPA, JALU0]> { + let Latency = 8; +} +def : InstRW<[JWriteFComiLd], (instregex "(V)?(U)?COMIS(D|S)rm")>; + def JWriteFCmp: SchedWriteRes<[JFPU0, JFPA]> { let Latency = 2; } diff --git a/llvm/test/tools/llvm-mca/X86/BtVer2/resources-avx1.s b/llvm/test/tools/llvm-mca/X86/BtVer2/resources-avx1.s index 081db4f4582b..8d79f19a0c0a 100644 --- a/llvm/test/tools/llvm-mca/X86/BtVer2/resources-avx1.s +++ b/llvm/test/tools/llvm-mca/X86/BtVer2/resources-avx1.s @@ -1106,10 +1106,10 @@ vzeroupper # CHECK-NEXT: - - - 1.00 - 1.00 - 1.00 - - - - - - vcmpsd $0, (%rax), %xmm1, %xmm2 # CHECK-NEXT: - - - 1.00 - 1.00 - - - - - - - - vcmpss $0, %xmm0, %xmm1, %xmm2 # CHECK-NEXT: - - - 1.00 - 1.00 - 1.00 - - - - - - vcmpss $0, (%rax), %xmm1, %xmm2 -# CHECK-NEXT: - - - 1.00 - 1.00 - - - - - - - - vcomisd %xmm0, %xmm1 -# CHECK-NEXT: - - - 1.00 - 1.00 - 1.00 - - - - - - vcomisd (%rax), %xmm1 -# CHECK-NEXT: - - - 1.00 - 1.00 - - - - - - - - vcomiss %xmm0, %xmm1 -# CHECK-NEXT: - - - 1.00 - 1.00 - 1.00 - - - - - - vcomiss (%rax), %xmm1 +# CHECK-NEXT: 1.00 - - 1.00 - 1.00 - - - - - - - - vcomisd %xmm0, %xmm1 +# CHECK-NEXT: 1.00 - - 1.00 - 1.00 - 1.00 - - - - - - vcomisd (%rax), %xmm1 +# CHECK-NEXT: 1.00 - - 1.00 - 1.00 - - - - - - - - vcomiss %xmm0, %xmm1 +# CHECK-NEXT: 1.00 - - 1.00 - 1.00 - 1.00 - - - - - - vcomiss (%rax), %xmm1 # CHECK-NEXT: - - - - - - 1.00 - - - 1.00 - - - vcvtdq2pd %xmm0, %xmm2 # CHECK-NEXT: - - - - - - 1.00 1.00 - - 1.00 - - - vcvtdq2pd (%rax), %xmm2 # CHECK-NEXT: - - - - - - 2.00 - - - 2.00 - - - vcvtdq2pd %xmm0, %ymm2 @@ -1679,10 +1679,10 @@ vzeroupper # CHECK-NEXT: 1.00 - - 1.00 - 1.00 - 1.00 - - - - - - vtestps (%rax), %xmm1 # CHECK-NEXT: 1.00 - - 3.00 1.00 1.00 1.00 - - - - - - - vtestps %ymm0, %ymm1 # CHECK-NEXT: 1.00 - - 3.00 1.00 1.00 1.00 2.00 - - - - - - vtestps (%rax), %ymm1 -# CHECK-NEXT: - - - 1.00 - 1.00 - - - - - - - - vucomisd %xmm0, %xmm1 -# CHECK-NEXT: - - - 1.00 - 1.00 - 1.00 - - - - - - vucomisd (%rax), %xmm1 -# CHECK-NEXT: - - - 1.00 - 1.00 - - - - - - - - vucomiss %xmm0, %xmm1 -# CHECK-NEXT: - - - 1.00 - 1.00 - 1.00 - - - - - - vucomiss (%rax), %xmm1 +# CHECK-NEXT: 1.00 - - 1.00 - 1.00 - - - - - - - - vucomisd %xmm0, %xmm1 +# CHECK-NEXT: 1.00 - - 1.00 - 1.00 - 1.00 - - - - - - vucomisd (%rax), %xmm1 +# CHECK-NEXT: 1.00 - - 1.00 - 1.00 - - - - - - - - vucomiss %xmm0, %xmm1 +# CHECK-NEXT: 1.00 - - 1.00 - 1.00 - 1.00 - - - - - - vucomiss (%rax), %xmm1 # CHECK-NEXT: - - - 0.50 0.50 0.50 0.50 - - - - - - - vunpckhpd %xmm0, %xmm1, %xmm2 # CHECK-NEXT: - - - 0.50 0.50 0.50 0.50 1.00 - - - - - - vunpckhpd (%rax), %xmm1, %xmm2 # CHECK-NEXT: - - - 1.00 1.00 1.00 1.00 - - - - - - - vunpckhpd %ymm0, %ymm1, %ymm2 diff --git a/llvm/test/tools/llvm-mca/X86/BtVer2/resources-sse1.s b/llvm/test/tools/llvm-mca/X86/BtVer2/resources-sse1.s index 696371f2f1d7..8740771a60c6 100644 --- a/llvm/test/tools/llvm-mca/X86/BtVer2/resources-sse1.s +++ b/llvm/test/tools/llvm-mca/X86/BtVer2/resources-sse1.s @@ -268,8 +268,8 @@ xorps (%rax), %xmm2 # CHECK-NEXT: - - - 1.00 - 1.00 - 1.00 - - - - - - cmpps $0, (%rax), %xmm2 # CHECK-NEXT: - - - 1.00 - 1.00 - - - - - - - - cmpss $0, %xmm0, %xmm2 # CHECK-NEXT: - - - 1.00 - 1.00 - 1.00 - - - - - - cmpss $0, (%rax), %xmm2 -# CHECK-NEXT: - - - 1.00 - 1.00 - - - - - - - - comiss %xmm0, %xmm1 -# CHECK-NEXT: - - - 1.00 - 1.00 - 1.00 - - - - - - comiss (%rax), %xmm1 +# CHECK-NEXT: 1.00 - - 1.00 - 1.00 - - - - - - - - comiss %xmm0, %xmm1 +# CHECK-NEXT: 1.00 - - 1.00 - 1.00 - 1.00 - - - - - - comiss (%rax), %xmm1 # CHECK-NEXT: - - - - - - 1.00 - - - 1.00 - - - cvtsi2ssl %ecx, %xmm2 # CHECK-NEXT: - - - - - - 1.00 - - - 1.00 - - - cvtsi2ssq %rcx, %xmm2 # CHECK-NEXT: - - - - - - 1.00 1.00 - - 1.00 - - - cvtsi2ssl (%rax), %xmm2 @@ -339,8 +339,8 @@ xorps (%rax), %xmm2 # CHECK-NEXT: - - - 1.00 - 1.00 - 1.00 - - - - - - subps (%rax), %xmm2 # CHECK-NEXT: - - - 1.00 - 1.00 - - - - - - - - subss %xmm0, %xmm2 # CHECK-NEXT: - - - 1.00 - 1.00 - 1.00 - - - - - - subss (%rax), %xmm2 -# CHECK-NEXT: - - - 1.00 - 1.00 - - - - - - - - ucomiss %xmm0, %xmm1 -# CHECK-NEXT: - - - 1.00 - 1.00 - 1.00 - - - - - - ucomiss (%rax), %xmm1 +# CHECK-NEXT: 1.00 - - 1.00 - 1.00 - - - - - - - - ucomiss %xmm0, %xmm1 +# CHECK-NEXT: 1.00 - - 1.00 - 1.00 - 1.00 - - - - - - ucomiss (%rax), %xmm1 # CHECK-NEXT: - - - 0.50 0.50 0.50 0.50 - - - - - - - unpckhps %xmm0, %xmm2 # CHECK-NEXT: - - - 0.50 0.50 0.50 0.50 1.00 - - - - - - unpckhps (%rax), %xmm2 # CHECK-NEXT: - - - 0.50 0.50 0.50 0.50 - - - - - - - unpcklps %xmm0, %xmm2 diff --git a/llvm/test/tools/llvm-mca/X86/BtVer2/resources-sse2.s b/llvm/test/tools/llvm-mca/X86/BtVer2/resources-sse2.s index 88a9b8a24cf1..9888ea49b3e6 100644 --- a/llvm/test/tools/llvm-mca/X86/BtVer2/resources-sse2.s +++ b/llvm/test/tools/llvm-mca/X86/BtVer2/resources-sse2.s @@ -408,8 +408,8 @@ xorpd (%rax), %xmm2 # CHECK-NEXT: - - - 1.00 - 1.00 - 1.00 - - - - - - cmppd $0, (%rax), %xmm2 # CHECK-NEXT: - - - 1.00 - 1.00 - - - - - - - - cmpsd $0, %xmm0, %xmm2 # CHECK-NEXT: - - - 1.00 - 1.00 - 1.00 - - - - - - cmpsd $0, (%rax), %xmm2 -# CHECK-NEXT: - - - 1.00 - 1.00 - - - - - - - - comisd %xmm0, %xmm1 -# CHECK-NEXT: - - - 1.00 - 1.00 - 1.00 - - - - - - comisd (%rax), %xmm1 +# CHECK-NEXT: 1.00 - - 1.00 - 1.00 - - - - - - - - comisd %xmm0, %xmm1 +# CHECK-NEXT: 1.00 - - 1.00 - 1.00 - 1.00 - - - - - - comisd (%rax), %xmm1 # CHECK-NEXT: - - - - - - 1.00 - - - 1.00 - - - cvtdq2pd %xmm0, %xmm2 # CHECK-NEXT: - - - - - - 1.00 1.00 - - 1.00 - - - cvtdq2pd (%rax), %xmm2 # CHECK-NEXT: - - - - - - 1.00 - - - 1.00 - - - cvtdq2ps %xmm0, %xmm2 @@ -640,8 +640,8 @@ xorpd (%rax), %xmm2 # CHECK-NEXT: - - - 1.00 - 1.00 - 1.00 - - - - - - subpd (%rax), %xmm2 # CHECK-NEXT: - - - 1.00 - 1.00 - - - - - - - - subsd %xmm0, %xmm2 # CHECK-NEXT: - - - 1.00 - 1.00 - 1.00 - - - - - - subsd (%rax), %xmm2 -# CHECK-NEXT: - - - 1.00 - 1.00 - - - - - - - - ucomisd %xmm0, %xmm1 -# CHECK-NEXT: - - - 1.00 - 1.00 - 1.00 - - - - - - ucomisd (%rax), %xmm1 +# CHECK-NEXT: 1.00 - - 1.00 - 1.00 - - - - - - - - ucomisd %xmm0, %xmm1 +# CHECK-NEXT: 1.00 - - 1.00 - 1.00 - 1.00 - - - - - - ucomisd (%rax), %xmm1 # CHECK-NEXT: - - - 0.50 0.50 0.50 0.50 - - - - - - - unpckhpd %xmm0, %xmm2 # CHECK-NEXT: - - - 0.50 0.50 0.50 0.50 1.00 - - - - - - unpckhpd (%rax), %xmm2 # CHECK-NEXT: - - - 0.50 0.50 0.50 0.50 - - - - - - - unpcklpd %xmm0, %xmm2