diff --git a/lib/Target/X86/X86ScheduleBtVer2.td b/lib/Target/X86/X86ScheduleBtVer2.td index bee7b5b5d23..baf1b868131 100644 --- a/lib/Target/X86/X86ScheduleBtVer2.td +++ b/lib/Target/X86/X86ScheduleBtVer2.td @@ -789,6 +789,22 @@ def JWriteVTESTLd: SchedWriteRes<[JLAGU, JFPU0, JFPA]> { } def : InstRW<[JWriteVTESTLd], (instrs PTESTrm, VPTESTrm, VTESTPDrm, VTESTPSrm)>; +def JWriteVSQRTPD: SchedWriteRes<[JFPU1, JFPM]> { + let Latency = 27; + let ResourceCycles = [1, 27]; +} +def : InstRW<[JWriteVSQRTPD], (instrs SQRTPDr, VSQRTPDr, + SQRTSDr, VSQRTSDr, + SQRTSDr_Int, VSQRTSDr_Int)>; + +def JWriteVSQRTPDLd: SchedWriteRes<[JLAGU, JFPU1, JFPM]> { + let Latency = 32; + let ResourceCycles = [1, 1, 27]; +} +def : InstRW<[JWriteVSQRTPDLd], (instrs SQRTPDm, VSQRTPDm, + SQRTSDm, VSQRTSDm, + SQRTSDm_Int, VSQRTSDm_Int)>; + def JWriteVSQRTYPD: SchedWriteRes<[JFPU1, JFPM]> { let Latency = 54; let ResourceCycles = [2, 54]; diff --git a/test/CodeGen/X86/sse2-schedule.ll b/test/CodeGen/X86/sse2-schedule.ll index 2aa37db3be6..07d64e4ac9c 100644 --- a/test/CodeGen/X86/sse2-schedule.ll +++ b/test/CodeGen/X86/sse2-schedule.ll @@ -14234,15 +14234,15 @@ define <2 x double> @test_sqrtpd(<2 x double> %a0, <2 x double> *%a1) { ; ; BTVER2-SSE-LABEL: test_sqrtpd: ; BTVER2-SSE: # %bb.0: -; BTVER2-SSE-NEXT: sqrtpd %xmm0, %xmm1 # sched: [21:21.00] -; BTVER2-SSE-NEXT: sqrtpd (%rdi), %xmm0 # sched: [26:21.00] +; BTVER2-SSE-NEXT: sqrtpd %xmm0, %xmm1 # sched: [27:27.00] +; BTVER2-SSE-NEXT: sqrtpd (%rdi), %xmm0 # sched: [32:27.00] ; BTVER2-SSE-NEXT: addpd %xmm1, %xmm0 # sched: [3:1.00] ; BTVER2-SSE-NEXT: retq # sched: [4:1.00] ; ; BTVER2-LABEL: test_sqrtpd: ; BTVER2: # %bb.0: -; BTVER2-NEXT: vsqrtpd (%rdi), %xmm1 # sched: [26:21.00] -; BTVER2-NEXT: vsqrtpd %xmm0, %xmm0 # sched: [21:21.00] +; BTVER2-NEXT: vsqrtpd (%rdi), %xmm1 # sched: [32:27.00] +; BTVER2-NEXT: vsqrtpd %xmm0, %xmm0 # sched: [27:27.00] ; BTVER2-NEXT: vaddpd %xmm1, %xmm0, %xmm0 # sched: [3:1.00] ; BTVER2-NEXT: retq # sched: [4:1.00] ; @@ -14377,16 +14377,16 @@ define <2 x double> @test_sqrtsd(<2 x double> %a0, <2 x double> *%a1) { ; BTVER2-SSE-LABEL: test_sqrtsd: ; BTVER2-SSE: # %bb.0: ; BTVER2-SSE-NEXT: movapd (%rdi), %xmm1 # sched: [5:1.00] -; BTVER2-SSE-NEXT: sqrtsd %xmm0, %xmm0 # sched: [21:21.00] -; BTVER2-SSE-NEXT: sqrtsd %xmm1, %xmm1 # sched: [21:21.00] +; BTVER2-SSE-NEXT: sqrtsd %xmm0, %xmm0 # sched: [27:27.00] +; BTVER2-SSE-NEXT: sqrtsd %xmm1, %xmm1 # sched: [27:27.00] ; BTVER2-SSE-NEXT: addpd %xmm1, %xmm0 # sched: [3:1.00] ; BTVER2-SSE-NEXT: retq # sched: [4:1.00] ; ; BTVER2-LABEL: test_sqrtsd: ; BTVER2: # %bb.0: ; BTVER2-NEXT: vmovapd (%rdi), %xmm1 # sched: [5:1.00] -; BTVER2-NEXT: vsqrtsd %xmm0, %xmm0, %xmm0 # sched: [21:21.00] -; BTVER2-NEXT: vsqrtsd %xmm1, %xmm1, %xmm1 # sched: [21:21.00] +; BTVER2-NEXT: vsqrtsd %xmm0, %xmm0, %xmm0 # sched: [27:27.00] +; BTVER2-NEXT: vsqrtsd %xmm1, %xmm1, %xmm1 # sched: [27:27.00] ; BTVER2-NEXT: vaddpd %xmm1, %xmm0, %xmm0 # sched: [3:1.00] ; BTVER2-NEXT: retq # sched: [4:1.00] ; diff --git a/test/tools/llvm-mca/X86/BtVer2/resources-avx1.s b/test/tools/llvm-mca/X86/BtVer2/resources-avx1.s index c9b43a5a8e1..e6522950308 100644 --- a/test/tools/llvm-mca/X86/BtVer2/resources-avx1.s +++ b/test/tools/llvm-mca/X86/BtVer2/resources-avx1.s @@ -1637,16 +1637,16 @@ vzeroupper # CHECK-NEXT: - - - 0.50 0.50 0.50 0.50 1.00 - - - - - - vshufps $1, (%rax), %xmm1, %xmm2 # CHECK-NEXT: - - - 1.00 1.00 1.00 1.00 - - - - - - - vshufps $1, %ymm0, %ymm1, %ymm2 # CHECK-NEXT: - - - 1.00 1.00 1.00 1.00 2.00 - - - - - - vshufps $1, (%rax), %ymm1, %ymm2 -# CHECK-NEXT: - - - - 21.00 - 1.00 - - - - - - - vsqrtpd %xmm0, %xmm2 -# CHECK-NEXT: - - - - 21.00 - 1.00 1.00 - - - - - - vsqrtpd (%rax), %xmm2 +# CHECK-NEXT: - - - - 27.00 - 1.00 - - - - - - - vsqrtpd %xmm0, %xmm2 +# CHECK-NEXT: - - - - 27.00 - 1.00 1.00 - - - - - - vsqrtpd (%rax), %xmm2 # CHECK-NEXT: - - - - 54.00 - 2.00 - - - - - - - vsqrtpd %ymm0, %ymm2 # CHECK-NEXT: - - - - 54.00 - 2.00 2.00 - - - - - - vsqrtpd (%rax), %ymm2 # CHECK-NEXT: - - - - 21.00 - 1.00 - - - - - - - vsqrtps %xmm0, %xmm2 # CHECK-NEXT: - - - - 21.00 - 1.00 1.00 - - - - - - vsqrtps (%rax), %xmm2 # CHECK-NEXT: - - - - 42.00 - 2.00 - - - - - - - vsqrtps %ymm0, %ymm2 # CHECK-NEXT: - - - - 42.00 - 2.00 2.00 - - - - - - vsqrtps (%rax), %ymm2 -# CHECK-NEXT: - - - - 21.00 - 1.00 - - - - - - - vsqrtsd %xmm0, %xmm1, %xmm2 -# CHECK-NEXT: - - - - 21.00 - 1.00 1.00 - - - - - - vsqrtsd (%rax), %xmm1, %xmm2 +# CHECK-NEXT: - - - - 27.00 - 1.00 - - - - - - - vsqrtsd %xmm0, %xmm1, %xmm2 +# CHECK-NEXT: - - - - 27.00 - 1.00 1.00 - - - - - - vsqrtsd (%rax), %xmm1, %xmm2 # CHECK-NEXT: - - - - 21.00 - 1.00 - - - - - - - vsqrtss %xmm0, %xmm1, %xmm2 # CHECK-NEXT: - - - - 21.00 - 1.00 1.00 - - - - - - vsqrtss (%rax), %xmm1, %xmm2 # CHECK-NEXT: - - - - - - - - - 1.00 - - - - vstmxcsr (%rax) diff --git a/test/tools/llvm-mca/X86/BtVer2/resources-sse2.s b/test/tools/llvm-mca/X86/BtVer2/resources-sse2.s index 45b63431791..e8b0f17319f 100644 --- a/test/tools/llvm-mca/X86/BtVer2/resources-sse2.s +++ b/test/tools/llvm-mca/X86/BtVer2/resources-sse2.s @@ -632,10 +632,10 @@ xorpd (%rax), %xmm2 # CHECK-NEXT: - - - - - 0.50 0.50 1.00 - - - 0.50 0.50 - pxor (%rax), %xmm2 # CHECK-NEXT: - - - 0.50 0.50 0.50 0.50 - - - - - - - shufpd $1, %xmm0, %xmm2 # CHECK-NEXT: - - - 0.50 0.50 0.50 0.50 1.00 - - - - - - shufpd $1, (%rax), %xmm2 -# CHECK-NEXT: - - - - 21.00 - 1.00 - - - - - - - sqrtpd %xmm0, %xmm2 -# CHECK-NEXT: - - - - 21.00 - 1.00 1.00 - - - - - - sqrtpd (%rax), %xmm2 -# CHECK-NEXT: - - - - 21.00 - 1.00 - - - - - - - sqrtsd %xmm0, %xmm2 -# CHECK-NEXT: - - - - 21.00 - 1.00 1.00 - - - - - - sqrtsd (%rax), %xmm2 +# CHECK-NEXT: - - - - 27.00 - 1.00 - - - - - - - sqrtpd %xmm0, %xmm2 +# CHECK-NEXT: - - - - 27.00 - 1.00 1.00 - - - - - - sqrtpd (%rax), %xmm2 +# CHECK-NEXT: - - - - 27.00 - 1.00 - - - - - - - sqrtsd %xmm0, %xmm2 +# CHECK-NEXT: - - - - 27.00 - 1.00 1.00 - - - - - - sqrtsd (%rax), %xmm2 # CHECK-NEXT: - - - 1.00 - 1.00 - - - - - - - - subpd %xmm0, %xmm2 # CHECK-NEXT: - - - 1.00 - 1.00 - 1.00 - - - - - - subpd (%rax), %xmm2 # CHECK-NEXT: - - - 1.00 - 1.00 - - - - - - - - subsd %xmm0, %xmm2