?2? Intel IA-32/Intel 64??? ????? - PowerPoint PPT Presentation

About This Presentation
Title:

?2? Intel IA-32/Intel 64??? ?????

Description:

Title: Subject: Author: Last modified by: yangqs Created Date: 2/6/2002 3:53:16 AM Document presentation format – PowerPoint PPT presentation

Number of Views:124
Avg rating:3.0/5.0
Slides: 73
Provided by: 6649956
Category:

less

Transcript and Presenter's Notes

Title: ?2? Intel IA-32/Intel 64??? ?????


1
?2? Intel IA-32/Intel 64????????
2
2.1 IA-32/Intel 64????????
2.1.1 ????
1. ???
  • ?????????????????,????????????????
  • ??????????????,?????????????????

3
2. CISC?RISC??
????????(CISC) ????????,???????????,?????????,???
??????????????? ??
  • ??????????,????????????,???????????
  • ?????????????????????????????,??????????????
  • ?????????????????
  • ?????????,?????????????,?????????????????????

4
????????(RISC)??????,???????????????,????CPU?????
?
  • ??????,???????????,???????
  • ??????????????,???????,?????????????????
  • ??Load/Store??????????,?????????????????????????,?
    ?,???????????????????RISC???????????????????
  • ?????????,???????????,??????????????

5
3. ???????(Cache)
???????
??
??
Cache????????????????
for(int i ilt100 i) aiii
6
2.1.1.1 ????????
??CPU????????????CPU??????,??????? CPU??
CPU???IPC ???CPU????????????????????
IPC??????????? CPI???????? ???????
??CPU??,????????
7
?????? ??????????????????????????????????????????
???
IA-32??????
?? Pentium P6?? Pentium 4 Core Nehalem
???? 5 12-13 2031 14 16
??MHz 66 200 20003600 2667
??????????,???????
8
??????????????
9
2.1.2 ??????????????
?????????????,?????????????????,?????????????????(
Thread-Level Parallelism, ILP)?
1.???????
(1)???? ??????(??????)????????????????????,???????
??????
??????????,????????????,??????????????,??????????
?,???????
10
1.???????
(2)???? ????????????????????????,???????????
? ?????(RAW,Read After Write) ABC
D3A // ???A????
? ?????(WAR,Write After Read) ABC
BD2 // ???B????
? ?????(WAW,Write After Write) ABC
AD2 // ???A????
??C???? i2 ??????????
11
1.???????
(3)???? ??????????????????RAW?????
??????????????,?????????????????????????????,????
????????,???????????????(????)???????????(????)???
?
12
2.?????
??????????????????,?????????????????????,?????????
???IPC,???????????CPI?????????,?????????????????Pe
ntium?Ivy Bridge????????24?

I1
IF
ID
EX
OF
WB
????????
I2
IF
ID
EX
OF
WB
I3
IF
ID
EX
OF
WB
I4
IF
WB
OF
EX
ID
I5
IF
ID
EX
OF
WB
I6
IF
ID
EX
OF
WB
I7
WB
IF
EX
OF
ID
I8
IF
ID
EX
OF
WB
I9
IF
ID
EX
OF
WB
13
3. ?????????(P6????)
  • ??????
  • ????????????,????????????????????????,????????????
    ???,????????????????????????????????????????????

??????????
???????
??????
RF-7
RF-7
????
????
QD-E
QD-E
PA2
PA2
ABC
ABC
14
3. ?????????(P6????)
  • ????
  • ?????????,???????????????????
  • ??????
  • ?????????????
  • ??????????????????
  • ?????????????????
  • ??????
  • ?????????BTB??????????
  • BTB???????????????????BIA,?????????BTA,????????
  • ???,????L1 Cache?BTB
  • ????????????,??????????
  • ?????????????,?????BTB?????,?????????????

15
3. ?????????(P6????)
  • ????
  • ????????,??????,???????
  • ??????????,?????????????????????????????
  • ??????
  • ???????????????,????????,??????????????????
  • ?????????????????????IA?????IA????????????????????
  • ????????????????????

16
4. ??Cache?????
  • ??-?????L1 Cache,??MESI???
  • ??-?????L1Cache????????????
  • ????
  • ??????????????????
  • ????????????
  • ??????????????????????????
  • ????????????????????
  • ???(Jcc???OF??)????????U???,??Pentium?V?????????
  • ???????????????(FCXH??)

????????????
MOV AX, 200 MOV AX, 412
MOV AX, 200 MOV CX, AX
???
???
17
2.1.3 ??????????????
1.???SIMD??????
for (int i0iltMAXi) ciaibi
??? SIMD??
?? SIMD??
18
4x doubles
8x floats
2x dqword
2x doubles
4x floats
AVX
1x dqword
SSE4
16x bytes
8x words
SSE SSE2 SSE3
4x dwords
2x qwords
8x bytes
4x words
MMX
2x dwords
1x qwords
MMX????64?? x87 ???????MMX???
SSE, SSE2?SSE3?????128??XMM ??????MMX???
SSE4?????128??XMM???,?????MMX???
AVX?????256??YMM ??????XMM???,?????MMX???
19
2.????????GPU
  • GPU?????????????????????????????CPU???
  • ??????12?????EU(????),????????????,???????????????
    ??
  • EU????????????????????????????
  • ?????????????3D???????????????????,??????????,????
    ??????

20
2.1.4 ??????????????
1. ???(Hyper-Threading, HT)??,SMT
  • ?????????????????????????????????????(??)
  • HT?????????2????????????,????????????IA-32????(AS)
  • ????????????IA-32???????????????????????
  • ???????????????????????

21
2. ??(Multi-Core)??,CMP
  • ????????????????????????????????
  • ??????????????AS,??????????,?????L2 Cache ?
  • ??????HT???????HT???????
  • ???????????????????????
  • ??(Many-Core)??
  • ??32??CPU
  • ??????(NoC)????
  • Intel?????????????,61??MIC

22
Intel?????
Core 2 Duo???
23
2.1.5 Intel 64 ?? (EM64T??)
  • ????IA-32???
  • Intel 64?????????64???
  • ?????????IA-32??????????64??????
  • 64??????????
  • 64???????
  • ????40???????
  • ??8????????
  • ??8????SIMD??(SSE, SSE2?SSE3)
  • 64????????????????

24
2.2 Pentium??????
  • 80x86????????
  • ?64?????? 32?????,????4GB?
  • RISC?????? - ??5????????,??8???????
  • ???????????????????
  • ??-?????????,??MESI???
  • ?????????????
  • ???????????????????????
  • ?????????????,????????
  • ??64?????????????
  • ??APIC??????????

25
2.2.2 Pentium?????????????
????? ????? ????? ????? ???R
?
?
?
?
?
26
2.3 Core???????
  • 4 ?14????
  • ??32??64???

2.3.1 Core???
27
2.3.2 Core 2??????????
28
2.3.3 ??2??????
  • ??????(Wide Dynamic Execution)
  • ????????????????,???????????

P6??
Core??
3???? 3???? ????????????3???
4???? 4???? ????????????4???
29
Instruction Queue
  • ??????
  • ???(macrofusion)????????????????????????????(Micro
    -op)

add ecx, 1
mov mem1, ecx
mov eax, mem1
cmp eax, mem2
jge label
for (int i0 ilt100000 i)
dec0
add ecx, 1
mov mem1, ecx
dec1
mov eax, mem1
dec2
cmp eax, mem2
dec3
jge label
dec0
30
Instruction Queue
  • ??????
  • ???(macrofusion)????????????????????????????(Micro
    -op)

add ecx, 1
mov mem1, ecx
mov eax, mem1
cmp eax, mem2
jae label
for (unsigned int i0 ilt100000 i)

add ecx, 1
dec0
mov mem1, ecx
dec1
mov eax, mem1
dec2
cmpjae eax, mem2, label
dec3
31
  • ??????
  • ?????(Micro-op fusion)?????????????????x86????????
    ???????????

u-ops of a Store mov mem1 ,edx
sta mem1
st mem1 , edx
std mem1 ,edx
??????????????
32
  • ??????(Intelligent Power Capability)
  • ?????????????????????????,?????????????,?????????
  • ????????????????????????,????????????????,????????
    ??
  • ????????????????????,???????????

33
  • Intel ??????(Intel Smart Memory Access)

CPU
  • ??
  • WHEN ??????????????????
  • WHERE ?????????CPU??

L1Cache
L2Cache
L3Cache
Memory
34
  • Intel ??????(Intel Smart Memory Access)
  • ??????????(load)???????(store)????????????????????
    ???,???????load???????????store???????(??WHEN???)

Memory
Data W
Data Z
Data Y
?????????Load4????????Store??
???????????
??????????????
???
Data X
35
  • Intel ??????(Intel Smart Memory Access)
  • ??????????????????????????????????(??WHERE??)
  • ????????????????????,????Cache?
  • L1D?3 clk????1 clk????? L2?14?2 clk
  • Cache????
  • L1 ????? L2 10 cycles
  • L2 ??, ????? 300 cycles (server/FBD)
  • L2 ??, ????? 165 cycles (Desk/DDR2)
  • Cache ??
  • Cache?? 8.5 bytes/cycle
  • ????
  • ???? 6 GB/sec/socket (linux)
  • ??? 3.5 GB/sec/socket

36
  • Intel????Cache (Intel Advanced Smart Cache)
    -?????????
  • ?????L2 Cache?????
  • ????????????L2 Cache???

AS
AS
????
????
Local APIC
Local APIC
Cache Line
L2 Cache
L2 Cache
Cache Line
????
????
????
37
2.4 SandyBridge???????
2.4.1 SandyBridge???
38
2.4.2 SandyBridge???????
  • SandyBridge????????,?????????????????IA???????????
  • ?????? ?????(GT)?????Cache
  • ?????????????
  • ???(DT)????(QT)????(RSP)????(SNP)
  • SandyBridge?Graphics???????
  • ??????(Command Streamers)??????(Media Processing)?
    ????????(Multi-Foumat Codec)?????(EU)?????????(Arr
    ay of Unified Execution Units)??????(Media
    Sampler)??????(Texture Sampler)????????

39
2.5 IA-32?????????
2.5.1 IA-32????????
  • ????? -???????- ?8086/8088??,?????32???-
    1MB????,????,??????0 (??)?- MS-DOS???????,PC?????
    ???? ????- ????????????????????
  • ????-???????? - ???????,?????????????-
    ????????????????????????????????,????????-
    ??????64TB(246)- 4???,???????????????-
    Windows?Linux????????????

40
  • ??8086??(V86??)-?????

- ??????????????8086??????
???? ????? ??8086??
???? ???? ??????
???? 1MB ??8086??????1MB,?????4GB
??? ??? ??,??8086???IA-32?????????????
  • ??????-???? - ?????????????????????????????????
    - ?????????????????????,???????????????
  • IA-32e??(??Intel 64 Architecture??????)

41
???????
42
2.5.2 IA-32????????
?????
?????
???????
????
?????
?????
???????
?????
?????
??????
???????
????????
?????
43
1.?????
32???
16???
AH AL BH BL CH CLDH
DL SP BP DI SI
EAXEBXECXEDXESPEBPEDIESI
AXBXCXDXSPBPDISI
??? ???? ?? ?? ???? ???? ???? ???
?16???
16?
32?
  • AX?BX?CX?DX?SP?BP?DI?SI???EAX?EBX?ECX?EDX
    ?ESP?EBP?EDI?ESI??16?
  • AL?BL ?CL?DL???AX?BX?CX?DX????
  • AH?BH ?CH?DH???AX?BX?CX?DX????

44
1.?????
  • EAX ??? ????????,?????I/O?????
  • EBX ????? ??????????????
  • ECX ????? ??????????
  • EDX ????? ?????I/O?????
  • ??32??16??8?????,??,
  • EAX???16??AX,?????8??AH?AL

45
1.?????
  • ESP ???????,??????
  • EBP ???????,???????
  • ESI ??????
  • EDI ???????
  • ????????,???????,
  • ????32??16??????
  • ?ESI????16??SI

46
64??????????
47
2.????

???
???
???
???
  • CS ??????
  • DS ??????
  • SS ??????
  • ES ??????
  • FS?GS ??????
  • ??????16?????
  • ???????,????????
  • ?64????,FS, GS??,CS, DS, ES, SS???????0???

48
3.???????
  • EIP ?????????????,????????????????

16??IP
?16???
32????????EIP
  • 64????,???8???64?RIP

32??EIP
?32???
64????????RIP
49
4.?????
  • EFLAGS ?????( ????????PSW )????????????
    ????????????,??????????,???????(???????)????

50
8086/8088???????(?????) b15
b8 b7
b0 OF
DF IF TF SF ZF AF PF CF ??
?? ??1??? CF
???? ?/???????/?? OF ????
????????????????? ZF ???
?????0? SF ???? ?????????1?
AF ?????? ??????(b3)????/?? PF
???? ?????8??1??????? DF ????
???????????????? IF ??????
??CPU?????????? TF ????
CPU???????????
51
????????4????????,???8088???????????????

CF
PF
AF
ZF
SF
OF
0 0 0 0 1 0
1 1 0 1 0 1
1 1 0 0 1 0
0 0 1 0 1 1
52
  • ??
  • ????CF?????????????,?????????
  • ??????????????????????,??????????????
  • ???????????????????????????,?????CF,??????????????
    ?OF
  • ?????,????????,????CF,??????????OF?

53
IA-32 ?????EFLAG
????8088
ZF
AF
CF
PF
? ?
NT
VM
0
OF
DF
IF
TF
SF
IOPL
RF
AC
VIF
VIP
ID
0
1
0
31 22 21 20 19 18 17 16 15 14 13
12 11 10 9 8 7 6 5 4 3 2 1
0
?? ?? ??1???
IOPL IO??? ??????????I/O??????

00???????,11??????? NT ????
?????????????? RF ????
DBUG??????????????? VM ??8086??
??????????8086?? AC ????
?????????? VIF ?????
??V86????????????? VIP ??????? ???????? ID
??? ????????????CPUID
54
5. ?????
31
10 9 8 7 6 5
4 3 2 1 0
CR4
TSD

PSE
DE
PVI

PAE
MCE
??,????0
PGE
VME
PCE
31
12 11
4 3 0
PCD
CR3
PWT
?????????
31


0
CR2
??????????
31


0
CR1
? ?
31 30 29
18 17 16
5 4 3 2 1 0
NE
ET
MP
PG
EM
TS
WP
NW
CD
CR0
AM
PE
OSFXSR OSXMMEXCPT
55
?????? ???????? ???????? ???? ??????? ????
??? ???? ???? ??Cache ????
NE
ET
MP
PG
EM
TS
WP
NW
CD
CR0
AM
PE
31 30 29
18 17 16
5 4 3 2 1 0
CR0????286MSW(?????)???????,???????MOV EAX,
CR0/MOV CR0, EAX?????????
56
31
12 11
4 3 0
PCD
PWT
CR3
?????????
??Cache ?????
57
31
7 6 5
4 3 2 1 0
8
TSD
PSE
DE
PVI
PAE
CR4
MCE
??,????0
PGE
VME
PCE
??????? ????? ?????? ?????? ?????? ?????
?????? ???????? ??8086????
58
6 ???????
  • GDTR 48???????????

??????32?????
16????
  • IDTR 48???????????

??????32?????
16????
  • TR 16??????????

TSS?16????
  • LDTR 16?????????????

LDT?16????
59
????????CSFFFFH,EIP, DS, ES, SS, FS,
GS??EFLAGS?????????????CSEIP FFFF00000000,?????
?????,??????????????,?????BIOS???????
60
2.5.3 IA-32/Intel 64????????????
  • IA-32/Intel 64???????
  • IA-32/Intel 64 ?????????Byte, Word,
    Doubleword, Quadword?Double Quadword

1) ?????? ???????????,???????2???????,???????
,1????
? ? ?? ?????? ??????
?? 8 0255 -128127
? 16 065535 -3276832767
?? 32 0232-1(4G-1) -231231-1
?? 64 0264-1(16T-1) -263263-1
61
2) ?????? ???????,??????????,????????????,???
????????????
?? ???? ???? ???? ????
?????? 1 24 8 1.1810-38 3.40 1038
?????? 1 53 11 2.2310-308 1.7910308
??????? 1 64 16 3.3710- 4932 1.18104932
62
  • 3) ??????
  • ?????????????,?????????
  • 16????
  • ??????16?????
  • ?????16??????16???????
  • 32????
  • ??????32?????
  • ?????16??????32???????
  • 64????
  • ????64?????
  • ????32??,?????16??????16???????
  • ????32??,?????16??????32???????
  • ????64??,?????16??????64???????

63
4) ??(field)???? ????????????,???????????????
????????32????
5) ????? ?????????????????,??????????????????
???,????232-1?,???????????232???
6) BCD???BCD???? ?4??????????????09???BCD???
?????????,???BCD??????4?????????,?4??0?
64
2.?????????? ????????,??????????????
  • ????????????????,?????2??4??8???????,
  • ?8?????????,?8?????????,??????????,??????????(????
    )
  • ?????????????????????????
  • ??????????????????,????????????,4????8???????????,
    Pentium??????????????,??????,??????,??????????????

65
??????????
0000H 0001H 0002H 0003H 0004H 0005H 0006H 0007H
12H
34H
56H
78H
9AH
BCH
DEH
FFH
0000H???, ?????12H ????3412H ?????78563412H ?????F
FDEBC9A78563412H
66
3. ???????? ?????,IA-32???????????32???????808
6? a. ????????
  • ??16??????20??????
  • ???????64KB?????????
  • ???? ???????20?????,????,????????????
  • ???? ???????????????
  • ???(?????16?)
  • ??? (??????????????,???????EA)

67
  • ???????16???
  • ??????? ???

6417H0100H 6417H10H 0100H 64170H 0100H
64270H ?????????????????????
68
  • b???????
  • IA-32?6?16??????,????????
  • ??????????????
  • ????????????????
  • ????????????????
  • ?????????,????????
  • ????????6??,???????????? ??????,???,????(????????
    ?)???????

69
????????????????????????
? ?????? 16??? 32???
??? CS IP EIP
??? DS BX?SI? DI???8?16?? EAX?EBX?ECX?EDX? EDI? ESI???8?32??
??? SS SP?BP ESP?EBP
??? ES FS GS DI ??? ??? EDI(?????) ??? ???
3. ?????????
????4???
70
4. ????
  • ??????????????????????64KB?????,??????????,?????
    ?????
  • ??????-1??????,?????????????????
  • SS????????(???????)
  • SP???????????,????SP????????,?????2??
  • ??????????,??????????,???(16??32?)???

71
(No Transcript)
72
??????????
??
Write a Comment
User Comments (0)
About PowerShow.com