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

[X86][Btver2] Add (V)SQRTPD/(V)SQRTSD costs

The xmm sd/pd versions were using the WriteFSQRT default which is modelled on sqrtss/sqrtps

llvm-svn: 328497
This commit is contained in:
Simon Pilgrim 2018-03-26 14:03:40 +00:00
parent daa24c364a
commit 726b2ad8ca
4 changed files with 32 additions and 16 deletions

View File

@ -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];

View File

@ -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]
;

View File

@ -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)

View File

@ -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