mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-25 04:02:41 +01:00
[X86] Add RDMSR/WRMSR, RDPMC + RDTSC/RDTSCP schedule tests
Add missing RDTSCP itinerary llvm-svn: 320581
This commit is contained in:
parent
1c84790957
commit
25f8f6268c
@ -19,7 +19,8 @@ let Defs = [RAX, RDX] in
|
||||
TB;
|
||||
|
||||
let Defs = [RAX, RCX, RDX] in
|
||||
def RDTSCP : I<0x01, MRM_F9, (outs), (ins), "rdtscp", [(X86rdtscp)]>, TB;
|
||||
def RDTSCP : I<0x01, MRM_F9, (outs), (ins), "rdtscp", [(X86rdtscp)],
|
||||
IIC_RDTSCP>, TB;
|
||||
|
||||
// CPU flow control instructions
|
||||
|
||||
|
@ -508,6 +508,7 @@ def IIC_RDPID : InstrItinClass;
|
||||
def IIC_RDRAND : InstrItinClass;
|
||||
def IIC_RDSEED : InstrItinClass;
|
||||
def IIC_RDTSC : InstrItinClass;
|
||||
def IIC_RDTSCP : InstrItinClass;
|
||||
def IIC_RSM : InstrItinClass;
|
||||
def IIC_SIDT : InstrItinClass;
|
||||
def IIC_SGDT : InstrItinClass;
|
||||
|
@ -409,6 +409,7 @@ def AtomItineraries : ProcessorItineraries<
|
||||
InstrItinData<IIC_LXS, [InstrStage<10, [Port0, Port1]>] >,
|
||||
InstrItinData<IIC_LTR, [InstrStage<83, [Port0, Port1]>] >,
|
||||
InstrItinData<IIC_RDTSC, [InstrStage<30, [Port0, Port1]>] >,
|
||||
InstrItinData<IIC_RDTSCP, [InstrStage<30, [Port0, Port1]>] >,
|
||||
InstrItinData<IIC_RSM, [InstrStage<741, [Port0, Port1]>] >,
|
||||
InstrItinData<IIC_SIDT, [InstrStage<4, [Port0, Port1]>] >,
|
||||
InstrItinData<IIC_SGDT, [InstrStage<4, [Port0, Port1]>] >,
|
||||
|
@ -9102,6 +9102,248 @@ define void @test_rcl_rcr_64(i64 %a0, i64 %a1, i64 *%a2) optsize {
|
||||
ret void
|
||||
}
|
||||
|
||||
define void @test_rdmsr_wrmsr() optsize {
|
||||
; GENERIC-LABEL: test_rdmsr_wrmsr:
|
||||
; GENERIC: # %bb.0:
|
||||
; GENERIC-NEXT: #APP
|
||||
; GENERIC-NEXT: rdmsr # sched: [100:0.33]
|
||||
; GENERIC-NEXT: wrmsr # sched: [100:0.33]
|
||||
; GENERIC-NEXT: #NO_APP
|
||||
; GENERIC-NEXT: retq # sched: [1:1.00]
|
||||
;
|
||||
; ATOM-LABEL: test_rdmsr_wrmsr:
|
||||
; ATOM: # %bb.0:
|
||||
; ATOM-NEXT: #APP
|
||||
; ATOM-NEXT: rdmsr # sched: [78:39.00]
|
||||
; ATOM-NEXT: wrmsr # sched: [202:101.00]
|
||||
; ATOM-NEXT: #NO_APP
|
||||
; ATOM-NEXT: retq # sched: [79:39.50]
|
||||
;
|
||||
; SLM-LABEL: test_rdmsr_wrmsr:
|
||||
; SLM: # %bb.0:
|
||||
; SLM-NEXT: #APP
|
||||
; SLM-NEXT: rdmsr # sched: [100:1.00]
|
||||
; SLM-NEXT: wrmsr # sched: [100:1.00]
|
||||
; SLM-NEXT: #NO_APP
|
||||
; SLM-NEXT: retq # sched: [4:1.00]
|
||||
;
|
||||
; SANDY-LABEL: test_rdmsr_wrmsr:
|
||||
; SANDY: # %bb.0:
|
||||
; SANDY-NEXT: #APP
|
||||
; SANDY-NEXT: rdmsr # sched: [100:0.33]
|
||||
; SANDY-NEXT: wrmsr # sched: [100:0.33]
|
||||
; SANDY-NEXT: #NO_APP
|
||||
; SANDY-NEXT: retq # sched: [1:1.00]
|
||||
;
|
||||
; HASWELL-LABEL: test_rdmsr_wrmsr:
|
||||
; HASWELL: # %bb.0:
|
||||
; HASWELL-NEXT: #APP
|
||||
; HASWELL-NEXT: rdmsr # sched: [100:0.25]
|
||||
; HASWELL-NEXT: wrmsr # sched: [100:0.25]
|
||||
; HASWELL-NEXT: #NO_APP
|
||||
; HASWELL-NEXT: retq # sched: [7:1.00]
|
||||
;
|
||||
; BROADWELL-LABEL: test_rdmsr_wrmsr:
|
||||
; BROADWELL: # %bb.0:
|
||||
; BROADWELL-NEXT: #APP
|
||||
; BROADWELL-NEXT: rdmsr # sched: [100:0.25]
|
||||
; BROADWELL-NEXT: wrmsr # sched: [100:0.25]
|
||||
; BROADWELL-NEXT: #NO_APP
|
||||
; BROADWELL-NEXT: retq # sched: [7:1.00]
|
||||
;
|
||||
; SKYLAKE-LABEL: test_rdmsr_wrmsr:
|
||||
; SKYLAKE: # %bb.0:
|
||||
; SKYLAKE-NEXT: #APP
|
||||
; SKYLAKE-NEXT: rdmsr # sched: [100:0.25]
|
||||
; SKYLAKE-NEXT: wrmsr # sched: [100:0.25]
|
||||
; SKYLAKE-NEXT: #NO_APP
|
||||
; SKYLAKE-NEXT: retq # sched: [7:1.00]
|
||||
;
|
||||
; SKX-LABEL: test_rdmsr_wrmsr:
|
||||
; SKX: # %bb.0:
|
||||
; SKX-NEXT: #APP
|
||||
; SKX-NEXT: rdmsr # sched: [100:0.25]
|
||||
; SKX-NEXT: wrmsr # sched: [100:0.25]
|
||||
; SKX-NEXT: #NO_APP
|
||||
; SKX-NEXT: retq # sched: [7:1.00]
|
||||
;
|
||||
; BTVER2-LABEL: test_rdmsr_wrmsr:
|
||||
; BTVER2: # %bb.0:
|
||||
; BTVER2-NEXT: #APP
|
||||
; BTVER2-NEXT: rdmsr # sched: [100:0.17]
|
||||
; BTVER2-NEXT: wrmsr # sched: [100:0.17]
|
||||
; BTVER2-NEXT: #NO_APP
|
||||
; BTVER2-NEXT: retq # sched: [4:1.00]
|
||||
;
|
||||
; ZNVER1-LABEL: test_rdmsr_wrmsr:
|
||||
; ZNVER1: # %bb.0:
|
||||
; ZNVER1-NEXT: #APP
|
||||
; ZNVER1-NEXT: rdmsr # sched: [100:?]
|
||||
; ZNVER1-NEXT: wrmsr # sched: [100:?]
|
||||
; ZNVER1-NEXT: #NO_APP
|
||||
; ZNVER1-NEXT: retq # sched: [1:0.50]
|
||||
call void asm sideeffect "rdmsr \0A\09 wrmsr", ""()
|
||||
ret void
|
||||
}
|
||||
|
||||
define void @test_rdpmc() optsize {
|
||||
; GENERIC-LABEL: test_rdpmc:
|
||||
; GENERIC: # %bb.0:
|
||||
; GENERIC-NEXT: #APP
|
||||
; GENERIC-NEXT: rdpmc # sched: [100:0.33]
|
||||
; GENERIC-NEXT: #NO_APP
|
||||
; GENERIC-NEXT: retq # sched: [1:1.00]
|
||||
;
|
||||
; ATOM-LABEL: test_rdpmc:
|
||||
; ATOM: # %bb.0:
|
||||
; ATOM-NEXT: #APP
|
||||
; ATOM-NEXT: rdpmc # sched: [46:23.00]
|
||||
; ATOM-NEXT: #NO_APP
|
||||
; ATOM-NEXT: retq # sched: [79:39.50]
|
||||
;
|
||||
; SLM-LABEL: test_rdpmc:
|
||||
; SLM: # %bb.0:
|
||||
; SLM-NEXT: #APP
|
||||
; SLM-NEXT: rdpmc # sched: [100:1.00]
|
||||
; SLM-NEXT: #NO_APP
|
||||
; SLM-NEXT: retq # sched: [4:1.00]
|
||||
;
|
||||
; SANDY-LABEL: test_rdpmc:
|
||||
; SANDY: # %bb.0:
|
||||
; SANDY-NEXT: #APP
|
||||
; SANDY-NEXT: rdpmc # sched: [100:0.33]
|
||||
; SANDY-NEXT: #NO_APP
|
||||
; SANDY-NEXT: retq # sched: [1:1.00]
|
||||
;
|
||||
; HASWELL-LABEL: test_rdpmc:
|
||||
; HASWELL: # %bb.0:
|
||||
; HASWELL-NEXT: #APP
|
||||
; HASWELL-NEXT: rdpmc # sched: [1:?]
|
||||
; HASWELL-NEXT: #NO_APP
|
||||
; HASWELL-NEXT: retq # sched: [7:1.00]
|
||||
;
|
||||
; BROADWELL-LABEL: test_rdpmc:
|
||||
; BROADWELL: # %bb.0:
|
||||
; BROADWELL-NEXT: #APP
|
||||
; BROADWELL-NEXT: rdpmc # sched: [100:0.25]
|
||||
; BROADWELL-NEXT: #NO_APP
|
||||
; BROADWELL-NEXT: retq # sched: [7:1.00]
|
||||
;
|
||||
; SKYLAKE-LABEL: test_rdpmc:
|
||||
; SKYLAKE: # %bb.0:
|
||||
; SKYLAKE-NEXT: #APP
|
||||
; SKYLAKE-NEXT: rdpmc # sched: [100:0.25]
|
||||
; SKYLAKE-NEXT: #NO_APP
|
||||
; SKYLAKE-NEXT: retq # sched: [7:1.00]
|
||||
;
|
||||
; SKX-LABEL: test_rdpmc:
|
||||
; SKX: # %bb.0:
|
||||
; SKX-NEXT: #APP
|
||||
; SKX-NEXT: rdpmc # sched: [100:0.25]
|
||||
; SKX-NEXT: #NO_APP
|
||||
; SKX-NEXT: retq # sched: [7:1.00]
|
||||
;
|
||||
; BTVER2-LABEL: test_rdpmc:
|
||||
; BTVER2: # %bb.0:
|
||||
; BTVER2-NEXT: #APP
|
||||
; BTVER2-NEXT: rdpmc # sched: [100:0.17]
|
||||
; BTVER2-NEXT: #NO_APP
|
||||
; BTVER2-NEXT: retq # sched: [4:1.00]
|
||||
;
|
||||
; ZNVER1-LABEL: test_rdpmc:
|
||||
; ZNVER1: # %bb.0:
|
||||
; ZNVER1-NEXT: #APP
|
||||
; ZNVER1-NEXT: rdpmc # sched: [100:?]
|
||||
; ZNVER1-NEXT: #NO_APP
|
||||
; ZNVER1-NEXT: retq # sched: [1:0.50]
|
||||
call void asm sideeffect "rdpmc", ""()
|
||||
ret void
|
||||
}
|
||||
|
||||
define void @test_rdtsc_rdtscp() optsize {
|
||||
; GENERIC-LABEL: test_rdtsc_rdtscp:
|
||||
; GENERIC: # %bb.0:
|
||||
; GENERIC-NEXT: #APP
|
||||
; GENERIC-NEXT: rdtsc # sched: [100:0.33]
|
||||
; GENERIC-NEXT: rdtscp # sched: [100:0.33]
|
||||
; GENERIC-NEXT: #NO_APP
|
||||
; GENERIC-NEXT: retq # sched: [1:1.00]
|
||||
;
|
||||
; ATOM-LABEL: test_rdtsc_rdtscp:
|
||||
; ATOM: # %bb.0:
|
||||
; ATOM-NEXT: #APP
|
||||
; ATOM-NEXT: rdtsc # sched: [30:15.00]
|
||||
; ATOM-NEXT: rdtscp # sched: [30:15.00]
|
||||
; ATOM-NEXT: #NO_APP
|
||||
; ATOM-NEXT: retq # sched: [79:39.50]
|
||||
;
|
||||
; SLM-LABEL: test_rdtsc_rdtscp:
|
||||
; SLM: # %bb.0:
|
||||
; SLM-NEXT: #APP
|
||||
; SLM-NEXT: rdtsc # sched: [100:1.00]
|
||||
; SLM-NEXT: rdtscp # sched: [100:1.00]
|
||||
; SLM-NEXT: #NO_APP
|
||||
; SLM-NEXT: retq # sched: [4:1.00]
|
||||
;
|
||||
; SANDY-LABEL: test_rdtsc_rdtscp:
|
||||
; SANDY: # %bb.0:
|
||||
; SANDY-NEXT: #APP
|
||||
; SANDY-NEXT: rdtsc # sched: [100:0.33]
|
||||
; SANDY-NEXT: rdtscp # sched: [100:0.33]
|
||||
; SANDY-NEXT: #NO_APP
|
||||
; SANDY-NEXT: retq # sched: [1:1.00]
|
||||
;
|
||||
; HASWELL-LABEL: test_rdtsc_rdtscp:
|
||||
; HASWELL: # %bb.0:
|
||||
; HASWELL-NEXT: #APP
|
||||
; HASWELL-NEXT: rdtsc # sched: [18:2.00]
|
||||
; HASWELL-NEXT: rdtscp # sched: [18:2.00]
|
||||
; HASWELL-NEXT: #NO_APP
|
||||
; HASWELL-NEXT: retq # sched: [7:1.00]
|
||||
;
|
||||
; BROADWELL-LABEL: test_rdtsc_rdtscp:
|
||||
; BROADWELL: # %bb.0:
|
||||
; BROADWELL-NEXT: #APP
|
||||
; BROADWELL-NEXT: rdtsc # sched: [18:2.00]
|
||||
; BROADWELL-NEXT: rdtscp # sched: [18:2.00]
|
||||
; BROADWELL-NEXT: #NO_APP
|
||||
; BROADWELL-NEXT: retq # sched: [7:1.00]
|
||||
;
|
||||
; SKYLAKE-LABEL: test_rdtsc_rdtscp:
|
||||
; SKYLAKE: # %bb.0:
|
||||
; SKYLAKE-NEXT: #APP
|
||||
; SKYLAKE-NEXT: rdtsc # sched: [18:2.00]
|
||||
; SKYLAKE-NEXT: rdtscp # sched: [18:2.00]
|
||||
; SKYLAKE-NEXT: #NO_APP
|
||||
; SKYLAKE-NEXT: retq # sched: [7:1.00]
|
||||
;
|
||||
; SKX-LABEL: test_rdtsc_rdtscp:
|
||||
; SKX: # %bb.0:
|
||||
; SKX-NEXT: #APP
|
||||
; SKX-NEXT: rdtsc # sched: [18:2.00]
|
||||
; SKX-NEXT: rdtscp # sched: [18:2.00]
|
||||
; SKX-NEXT: #NO_APP
|
||||
; SKX-NEXT: retq # sched: [7:1.00]
|
||||
;
|
||||
; BTVER2-LABEL: test_rdtsc_rdtscp:
|
||||
; BTVER2: # %bb.0:
|
||||
; BTVER2-NEXT: #APP
|
||||
; BTVER2-NEXT: rdtsc # sched: [100:0.17]
|
||||
; BTVER2-NEXT: rdtscp # sched: [100:0.17]
|
||||
; BTVER2-NEXT: #NO_APP
|
||||
; BTVER2-NEXT: retq # sched: [4:1.00]
|
||||
;
|
||||
; ZNVER1-LABEL: test_rdtsc_rdtscp:
|
||||
; ZNVER1: # %bb.0:
|
||||
; ZNVER1-NEXT: #APP
|
||||
; ZNVER1-NEXT: rdtsc # sched: [100:?]
|
||||
; ZNVER1-NEXT: rdtscp # sched: [100:?]
|
||||
; ZNVER1-NEXT: #NO_APP
|
||||
; ZNVER1-NEXT: retq # sched: [1:0.50]
|
||||
call void asm sideeffect "rdtsc \0A\09 rdtscp", ""()
|
||||
ret void
|
||||
}
|
||||
|
||||
; TODO - test_ret
|
||||
|
||||
define void @test_rol_ror_8(i8 %a0, i8 %a1, i8 *%a2) optsize {
|
||||
|
Loading…
Reference in New Issue
Block a user