深入理解计算机系统
2
Hunan University
Intel x86 Processors
Totally y dominate laptop/desktop/server p p/ p/ market Evolutionary o ut o a y design des g
Backwards compatible up until 8086, introduced in 1978 Added more features as time goes on
11
Hunan University
Definitions
Architecture: ( (also instruction set architecture: ISA) ) The parts of a processor design that one needs to understand to write assembly code.
2004: Intel Announces EM64T extension to IA32
Extended Memory 64‐bit Technology Almost identical to x86‐64!
All but low‐end x86 processors support x86‐64
6
Hunan University
More Information
Intel p processors ( (Wikipedia) p ) Intel microarchitectures
7
Hunan University
x86 Clones: Advanced Micro Devices (AMD)
E Example l ISAs ISA (Intel): (I l) x86, 86 IA
12
Hunan University
Assembly Programmer’s View
CPU PC Registers Condition Codes
Memory
Addresses Data I Instructions i Code Data Stack
But, lots of code still runs in 32‐bit mode
9
Hunan University
Our Coverage
IA32
The traditional x86
x86‐64/EM64T
The emerging standard
Presentation
Code in files p1.c p2.c Compile with command: gcc –O1 p1.c p2.c -o p
Use basic optimizations (-O1) Put resulting binary in file p
text
C program (p1.c p2.c) Compiler p (g gcc -S)
1700‐3900
Four cores (our shark machines)
2013 1.4B 1900‐3700
4
Hunan University
Intel x86 Processors: Overview
Architectures
AMD Stepped in with Evolutionary Solution
x86‐64 (now called “AMD64”) AMD64 )
Intel Felt Obligated to Focus on IA64
Hard to admit mistake or that AMD is better
386
1985
275K
16‐33
First 32 bit processor , referred to as IA32 Added “flat addressing”, Capable of running Unix
Pentium 4F
2004
125M
2800‐3800
First 64‐bit processor processor, referred to as x86‐64
X86‐16
Processors
8086 286
X86‐32/IA32
MMX SSE SSE2 SSE3
386 486 Pentium Pentium MMX Pentium III Pentium 4 Pentium 4E Pentium 4F Core 2 Duo Core i7
5
X86‐64 / EM64t
Core 2 2006 291M 1060‐3500 Core i7 Haswell
On‐chip GPU
First multi‐core Intel processor p
2008
731M
Byte addressable array Code and user data Stack to support procedures
Register file
Condition codes
13
Hunan University
Turning g C into Object j Code
Add d Features Added F t
Instructions to support multimedia operations Instructions to enable more efficient conditional operations Transition from 32 bits to 64bits More cores
Book presents IA32 in Sections 3.1—3.12 Covers x86‐64 in 3.13 W will We ill cover b both th simultaneously i lt l Some labs will be based on x86‐64, others on IA32
Complex instruction set computer (CISC)
Many different instructions with many different formats
But, only small subset encountered with Linux programs Hard H d t to match t h performance f of f Reduced R d d Instruction I t ti Set S t Computers C t (RISC) But, Intel has done j just that! In terms of speed. Less so for low power.
Hunan University
程序的机器级表示 I: 基本
计算机组成与结构 第5-6讲,2015年3月
主讲教师 赵欢 hzhao@
1
Hunan University
Today: Machine Programming I: Basics
History y of Intel processors p and architectures C, assembly, machine code Assembly Basics: asics: Registers, operands, move Intro to x86‐64
3
Hunan University
Intel x86 Evolution: Milestones
Name 8086 Date 1978 Transistors 29K MHz 5‐10
First 16‐bit processor. Basis for IBM PC & DOS 1MB address space
Historically
AMD has followed just behind Intel A little bit slower, a lot cheaper
Then
Recruited top circuit designers from Digital Equipment Corp. and
10
Hunan University
Today: Machine Programming I: Basics
History y of Intel processors p and architectures C, assembly, machine code Assembly Basics: asics: Registers, operands, move Intro to x86‐64
8
Hunan University
Intel’s Intel s 64‐Bit
Intel Attempted Radical Shift from IA32 to IA64
Totally different architecture (Itanium) Executes IA32 code only as legacy Performance disappointing
Examples: instruction set specification, registers.
Microarchitecture: Implementation of the architecture.