Index: lib/Target/X86/X86ScheduleBtVer2.td =================================================================== --- lib/Target/X86/X86ScheduleBtVer2.td +++ lib/Target/X86/X86ScheduleBtVer2.td @@ -569,6 +569,18 @@ } def : InstRW<[WriteVMULYPSLd, ReadAfterLd], (instregex "VMULPSYrm", "VRCPPSYm", "VRSQRTPSYm")>; +def WriteVMULPD: SchedWriteRes<[JFPU1]> { + let Latency = 4; + let ResourceCycles = [2]; +} +def : InstRW<[WriteVMULPD], (instregex "VMULPDrr", "VMULSDrr")>; + +def WriteVMULPDLd: SchedWriteRes<[JLAGU, JFPU1]> { + let Latency = 9; + let ResourceCycles = [1, 2]; +} +def : InstRW<[WriteVMULPDLd], (instregex "VMULPDrm", "VMULSDrm")>; + def WriteVCVTY: SchedWriteRes<[JSTC]> { let Latency = 3; let ResourceCycles = [2]; @@ -587,12 +599,39 @@ def : InstRW<[WriteVCVTYLd, ReadAfterLd], (instregex "VCVTPS2DQYrm")>; def : InstRW<[WriteVCVTYLd, ReadAfterLd], (instregex "VCVTTPS2DQYrm")>; -def WriteVMONTPSt: SchedWriteRes<[JSTC, JLAGU]> { +def WriteVMOVTDQSt: SchedWriteRes<[JSTC, JSAGU]> { + let Latency = 2; +} +def : InstRW<[WriteVMOVTDQSt], (instregex "VMOVNTDQmr")>; + +def WriteMOVNTSt: SchedWriteRes<[JSTC, JSAGU]> { + let Latency = 3; +} +def : InstRW<[WriteMOVNTSt], (instregex "VMOVNTP(S|D)mr")>; +def : InstRW<[WriteMOVNTSt], (instregex "MOVNTS(S|D)")>; + +def WriteVMONTPYSt: SchedWriteRes<[JSTC, JSAGU]> { let Latency = 3; let ResourceCycles = [2,1]; } -def : InstRW<[WriteVMONTPSt], (instregex "VMOVNTP(S|D)Ymr")>; -def : InstRW<[WriteVMONTPSt], (instregex "VMOVNTDQYmr")>; +def : InstRW<[WriteVMONTPYSt], (instregex "VMOVNTP(S|D)Ymr")>; +def : InstRW<[WriteVMONTPYSt], (instregex "VMOVNTDQYmr")>; + +def WriteFCmp: SchedWriteRes<[JFPU0]> { + let Latency = 2; +} + +def : InstRW<[WriteFCmp], (instregex "VMAXP(D|S)rr", "VMAXS(D|S)rr")>; +def : InstRW<[WriteFCmp], (instregex "VMINP(D|S)rr", "VMINS(D|S)rr")>; +def : InstRW<[WriteFCmp], (instregex "VCMPP(S|D)rri", "VCMPS(S|D)rri")>; + +def WriteFCmpLd: SchedWriteRes<[JLAGU, JFPU0]> { + let Latency = 7; +} + +def : InstRW<[WriteFCmpLd], (instregex "VMAXP(D|S)rm", "VMAXS(D|S)rm")>; +def : InstRW<[WriteFCmpLd], (instregex "VMINP(D|S)rm", "VMINS(D|S)rm")>; +def : InstRW<[WriteFCmpLd], (instregex "VCMPP(S|D)rmi", "VCMPS(S|D)rmi")>; def WriteVCVTPDY: SchedWriteRes<[JSTC, JFPU01]> { let Latency = 6; Index: test/CodeGen/X86/sse-schedule.ll =================================================================== --- test/CodeGen/X86/sse-schedule.ll +++ test/CodeGen/X86/sse-schedule.ll @@ -353,8 +353,8 @@ ; ; BTVER2-LABEL: test_cmpps: ; BTVER2: # %bb.0: -; BTVER2-NEXT: vcmpeqps %xmm1, %xmm0, %xmm1 # sched: [3:1.00] -; BTVER2-NEXT: vcmpeqps (%rdi), %xmm0, %xmm0 # sched: [8:1.00] +; BTVER2-NEXT: vcmpeqps %xmm1, %xmm0, %xmm1 # sched: [2:1.00] +; BTVER2-NEXT: vcmpeqps (%rdi), %xmm0, %xmm0 # sched: [7:1.00] ; BTVER2-NEXT: vorps %xmm0, %xmm1, %xmm0 # sched: [1:0.50] ; BTVER2-NEXT: retq # sched: [4:1.00] ; @@ -1311,8 +1311,8 @@ ; ; BTVER2-LABEL: test_maxps: ; BTVER2: # %bb.0: -; BTVER2-NEXT: vmaxps %xmm1, %xmm0, %xmm0 # sched: [3:1.00] -; BTVER2-NEXT: vmaxps (%rdi), %xmm0, %xmm0 # sched: [8:1.00] +; BTVER2-NEXT: vmaxps %xmm1, %xmm0, %xmm0 # sched: [2:1.00] +; BTVER2-NEXT: vmaxps (%rdi), %xmm0, %xmm0 # sched: [7:1.00] ; BTVER2-NEXT: retq # sched: [4:1.00] ; ; ZNVER1-LABEL: test_maxps: @@ -1378,8 +1378,8 @@ ; ; BTVER2-LABEL: test_maxss: ; BTVER2: # %bb.0: -; BTVER2-NEXT: vmaxss %xmm1, %xmm0, %xmm0 # sched: [3:1.00] -; BTVER2-NEXT: vmaxss (%rdi), %xmm0, %xmm0 # sched: [8:1.00] +; BTVER2-NEXT: vmaxss %xmm1, %xmm0, %xmm0 # sched: [2:1.00] +; BTVER2-NEXT: vmaxss (%rdi), %xmm0, %xmm0 # sched: [7:1.00] ; BTVER2-NEXT: retq # sched: [4:1.00] ; ; ZNVER1-LABEL: test_maxss: @@ -1445,8 +1445,8 @@ ; ; BTVER2-LABEL: test_minps: ; BTVER2: # %bb.0: -; BTVER2-NEXT: vminps %xmm1, %xmm0, %xmm0 # sched: [3:1.00] -; BTVER2-NEXT: vminps (%rdi), %xmm0, %xmm0 # sched: [8:1.00] +; BTVER2-NEXT: vminps %xmm1, %xmm0, %xmm0 # sched: [2:1.00] +; BTVER2-NEXT: vminps (%rdi), %xmm0, %xmm0 # sched: [7:1.00] ; BTVER2-NEXT: retq # sched: [4:1.00] ; ; ZNVER1-LABEL: test_minps: @@ -1512,8 +1512,8 @@ ; ; BTVER2-LABEL: test_minss: ; BTVER2: # %bb.0: -; BTVER2-NEXT: vminss %xmm1, %xmm0, %xmm0 # sched: [3:1.00] -; BTVER2-NEXT: vminss (%rdi), %xmm0, %xmm0 # sched: [8:1.00] +; BTVER2-NEXT: vminss %xmm1, %xmm0, %xmm0 # sched: [2:1.00] +; BTVER2-NEXT: vminss (%rdi), %xmm0, %xmm0 # sched: [7:1.00] ; BTVER2-NEXT: retq # sched: [4:1.00] ; ; ZNVER1-LABEL: test_minss: @@ -2003,7 +2003,7 @@ ; ; BTVER2-LABEL: test_movntps: ; BTVER2: # %bb.0: -; BTVER2-NEXT: vmovntps %xmm0, (%rdi) # sched: [1:1.00] +; BTVER2-NEXT: vmovntps %xmm0, (%rdi) # sched: [3:1.00] ; BTVER2-NEXT: retq # sched: [4:1.00] ; ; ZNVER1-LABEL: test_movntps: Index: test/CodeGen/X86/sse2-schedule.ll =================================================================== --- test/CodeGen/X86/sse2-schedule.ll +++ test/CodeGen/X86/sse2-schedule.ll @@ -428,8 +428,8 @@ ; ; BTVER2-LABEL: test_cmppd: ; BTVER2: # %bb.0: -; BTVER2-NEXT: vcmpeqpd %xmm1, %xmm0, %xmm1 # sched: [3:1.00] -; BTVER2-NEXT: vcmpeqpd (%rdi), %xmm0, %xmm0 # sched: [8:1.00] +; BTVER2-NEXT: vcmpeqpd %xmm1, %xmm0, %xmm1 # sched: [2:1.00] +; BTVER2-NEXT: vcmpeqpd (%rdi), %xmm0, %xmm0 # sched: [7:1.00] ; BTVER2-NEXT: vorpd %xmm0, %xmm1, %xmm0 # sched: [1:0.50] ; BTVER2-NEXT: retq # sched: [4:1.00] ; @@ -2309,8 +2309,8 @@ ; ; BTVER2-LABEL: test_maxpd: ; BTVER2: # %bb.0: -; BTVER2-NEXT: vmaxpd %xmm1, %xmm0, %xmm0 # sched: [3:1.00] -; BTVER2-NEXT: vmaxpd (%rdi), %xmm0, %xmm0 # sched: [8:1.00] +; BTVER2-NEXT: vmaxpd %xmm1, %xmm0, %xmm0 # sched: [2:1.00] +; BTVER2-NEXT: vmaxpd (%rdi), %xmm0, %xmm0 # sched: [7:1.00] ; BTVER2-NEXT: retq # sched: [4:1.00] ; ; ZNVER1-LABEL: test_maxpd: @@ -2376,8 +2376,8 @@ ; ; BTVER2-LABEL: test_maxsd: ; BTVER2: # %bb.0: -; BTVER2-NEXT: vmaxsd %xmm1, %xmm0, %xmm0 # sched: [3:1.00] -; BTVER2-NEXT: vmaxsd (%rdi), %xmm0, %xmm0 # sched: [8:1.00] +; BTVER2-NEXT: vmaxsd %xmm1, %xmm0, %xmm0 # sched: [2:1.00] +; BTVER2-NEXT: vmaxsd (%rdi), %xmm0, %xmm0 # sched: [7:1.00] ; BTVER2-NEXT: retq # sched: [4:1.00] ; ; ZNVER1-LABEL: test_maxsd: @@ -2443,8 +2443,8 @@ ; ; BTVER2-LABEL: test_minpd: ; BTVER2: # %bb.0: -; BTVER2-NEXT: vminpd %xmm1, %xmm0, %xmm0 # sched: [3:1.00] -; BTVER2-NEXT: vminpd (%rdi), %xmm0, %xmm0 # sched: [8:1.00] +; BTVER2-NEXT: vminpd %xmm1, %xmm0, %xmm0 # sched: [2:1.00] +; BTVER2-NEXT: vminpd (%rdi), %xmm0, %xmm0 # sched: [7:1.00] ; BTVER2-NEXT: retq # sched: [4:1.00] ; ; ZNVER1-LABEL: test_minpd: @@ -2510,8 +2510,8 @@ ; ; BTVER2-LABEL: test_minsd: ; BTVER2: # %bb.0: -; BTVER2-NEXT: vminsd %xmm1, %xmm0, %xmm0 # sched: [3:1.00] -; BTVER2-NEXT: vminsd (%rdi), %xmm0, %xmm0 # sched: [8:1.00] +; BTVER2-NEXT: vminsd %xmm1, %xmm0, %xmm0 # sched: [2:1.00] +; BTVER2-NEXT: vminsd (%rdi), %xmm0, %xmm0 # sched: [7:1.00] ; BTVER2-NEXT: retq # sched: [4:1.00] ; ; ZNVER1-LABEL: test_minsd: @@ -3245,7 +3245,7 @@ ; BTVER2-LABEL: test_movntdqa: ; BTVER2: # %bb.0: ; BTVER2-NEXT: vpaddq %xmm0, %xmm0, %xmm0 # sched: [1:0.50] -; BTVER2-NEXT: vmovntdq %xmm0, (%rdi) # sched: [1:1.00] +; BTVER2-NEXT: vmovntdq %xmm0, (%rdi) # sched: [2:1.00] ; BTVER2-NEXT: retq # sched: [4:1.00] ; ; ZNVER1-LABEL: test_movntdqa: @@ -3310,7 +3310,7 @@ ; BTVER2-LABEL: test_movntpd: ; BTVER2: # %bb.0: ; BTVER2-NEXT: vaddpd %xmm0, %xmm0, %xmm0 # sched: [3:1.00] -; BTVER2-NEXT: vmovntpd %xmm0, (%rdi) # sched: [1:1.00] +; BTVER2-NEXT: vmovntpd %xmm0, (%rdi) # sched: [3:1.00] ; BTVER2-NEXT: retq # sched: [4:1.00] ; ; ZNVER1-LABEL: test_movntpd: @@ -3732,8 +3732,8 @@ ; ; BTVER2-LABEL: test_mulpd: ; BTVER2: # %bb.0: -; BTVER2-NEXT: vmulpd %xmm1, %xmm0, %xmm0 # sched: [2:1.00] -; BTVER2-NEXT: vmulpd (%rdi), %xmm0, %xmm0 # sched: [7:1.00] +; BTVER2-NEXT: vmulpd %xmm1, %xmm0, %xmm0 # sched: [4:2.00] +; BTVER2-NEXT: vmulpd (%rdi), %xmm0, %xmm0 # sched: [9:2.00] ; BTVER2-NEXT: retq # sched: [4:1.00] ; ; ZNVER1-LABEL: test_mulpd: @@ -3798,8 +3798,8 @@ ; ; BTVER2-LABEL: test_mulsd: ; BTVER2: # %bb.0: -; BTVER2-NEXT: vmulsd %xmm1, %xmm0, %xmm0 # sched: [2:1.00] -; BTVER2-NEXT: vmulsd (%rdi), %xmm0, %xmm0 # sched: [7:1.00] +; BTVER2-NEXT: vmulsd %xmm1, %xmm0, %xmm0 # sched: [4:2.00] +; BTVER2-NEXT: vmulsd (%rdi), %xmm0, %xmm0 # sched: [9:2.00] ; BTVER2-NEXT: retq # sched: [4:1.00] ; ; ZNVER1-LABEL: test_mulsd: Index: test/CodeGen/X86/sse4a-schedule.ll =================================================================== --- test/CodeGen/X86/sse4a-schedule.ll +++ test/CodeGen/X86/sse4a-schedule.ll @@ -91,7 +91,7 @@ ; ; BTVER2-LABEL: test_movntsd: ; BTVER2: # %bb.0: -; BTVER2-NEXT: movntsd %xmm0, (%rdi) # sched: [1:1.00] +; BTVER2-NEXT: movntsd %xmm0, (%rdi) # sched: [3:1.00] ; BTVER2-NEXT: retq # sched: [4:1.00] ; ; ZNVER1-LABEL: test_movntsd: @@ -111,7 +111,7 @@ ; ; BTVER2-LABEL: test_movntss: ; BTVER2: # %bb.0: -; BTVER2-NEXT: movntss %xmm0, (%rdi) # sched: [1:1.00] +; BTVER2-NEXT: movntss %xmm0, (%rdi) # sched: [3:1.00] ; BTVER2-NEXT: retq # sched: [4:1.00] ; ; ZNVER1-LABEL: test_movntss: