cs 105 intel x86 ia32 64 processors intel x86 ia32 64
play

CS 105 Intel x86 (IA32/64) Processors Intel x86 (IA32/64) - PowerPoint PPT Presentation

CS 105 Intel x86 (IA32/64) Processors Intel x86 (IA32/64) Processors Tour of the Black Holes of Computing Totally Dominate


  1. ✁ ✁ ✁ ✁ ✁ ✁ ✁ ✁ ✁ ✁ ✁ ✁ ✁ ✁ ✁ ✁ ✁ ✁ ✁ ✁ ✁ ✁ CS 105 Intel x86 (IA32/64) Processors Intel x86 (IA32/64) Processors “Tour of the Black Holes of Computing” Totally Dominate Computer Market Evolutionary Design Machine-Level Programming I Machine-Level Programming I Starting in 1978 with 8086 (really 1971 with 4004) Added more features as time went on Still support old features, although obsolete Topics Complex Instruction Set Computer (CISC) Assembly Programmer’s Many different instructions with many different formats Execution Model � But only small subset encountered with Linux programs Accessing Information Hard to match performance of Reduced Instruction Set Computers (RISC) � Registers � Memory But Intel has done just that! � Well…in terms of speed; less so for low power Arithmetic operations CS 105 – 2 – X86 Evolution: Milestones X86 Evolution: Milestones X86 Evolution: Milestones X86 Evolution: Milestones Name Date Transistors Frequency Name Date Transistors Frequency 4004 1971 2.3K 108 KHz 8086 1978 29K 5-10 MHz 4-bit processor. First 1-chip microprocessor 16-bit processor. Basis for IBM PC & DOS Didn’t even have interrupts! Limited to 1MB address space. DOS only gives you 640K 8008 1972 3.3K 200-800 KHz 80286 1982 134K 4-12 MHz Like 4004, but with 8-bit ALU Added elaborate, but not very useful, addressing scheme Basis for IBM PC-AT and Windows 8080 1974 6K 2 MHz 386 1985 275K 16-33 MHz Compatible at source level with 8008 Processor in first “kit” computers Extended to 32 bits. Added “flat addressing” Pricing caused it to beat similar processors with better programming models Capable of running Unix � Motorola 6800 (best of the bunch, IMO) By default, Linux/gcc compiling for 32-bit x86 machines use no instructions � MOS Technologies (MOSTEK) 6502 (used in Apple II) introduced in later models CS 105 CS 105 – 3 – – 4 –

  2. ✁ � ✁ ✁ ✁ ✁ ✁ ✁ � � ✁ ✁ � � ✁ ✁ � ✁ ✁ � ✁ ✁ ✁ ✁ ✁ X86 Evolution: Milestones X86 Evolution: Milestones X86 Evolution: Clones X86 Evolution: Clones Name Date Transistors Frequency Advanced Micro Devices (AMD) Historically 486 1989 1.9M 16-150 MHz � AMD has followed just behind Intel Pentium P5 1993 3.1M 60-66 MHz � A little bit slower, a lot cheaper Late 1990s Pentium 4E 2004 125M 2.8-3.8 GHz � Recruited top circuit designers from Digital Equipment Corp. First 64-bit Intel x86 processor � Exploited fact that Intel distracted by Itanium � Became close competitors to Intel Core 2 2006 291M 1.0-3.5 GHz Developed own extension to 64 bits (called x86_64) First multi-core Intel processor Intel adopted in early 2000’s after Itanium bombed Core i7 2008 731M 1.7-3.9 GHz � Has recovered lead in semiconductor technology � AMD has fallen behind again Ivy Bridge 2012 0.6-4.3B 3.2-4.0 GHz � But in recent years ARM has been rising due to smartphones Transistor counts are going crazy here… …but max GHz has been stuck since 2004 CS 105 CS 105 – 5 – – 6 – Assembly Programmer’s View Assembly Programmer’s View Definitions Definitions CPU Memory Architecture: (also ISA: instruction set architecture) The parts of a Addresses processor design that one needs to understand or write Registers Object Code R Data assembly/machine code. Program Data I OS Data Examples: instruction set specification, registers. Condition P Instructions Codes Microarchitecture: Implementation of the architecture. Examples: cache sizes and core frequency. Stack Code Forms: Programmer-Visible State RIP (Program Counter) Machine Code: The byte-level programs that a processor executes Address of next instruction Assembly Code: A text representation of machine code Register File Memory Example ISAs: Heavily used program data Byte-addressable array Condition Codes Intel: x86, IA32, Itanium, x86-64 Code, user data, (most) OS data Store status information about Includes stack used to support ARM: Used in almost all smartphones most recent arithmetic operation procedures Used for conditional branching CS 105 CS 105 – 7 – – 8 –

  3. ✁ ✁ ✁ ✁ ✁ ✁ ✁ ✁ ✁ ✁ ✁ ✁ ✁ ✁ ✁ ✁ Compiling Into Assembly Turning C into Object Code Turning C into Object Code C Code (sum.c) ������������������������� Code in files p1.c p2.c sumstore: long plus(long x, long y); Compile with command: gcc –Wall -g -Og p1.c p2.c -o p pushq %rbx void sumstore(long x, long y, movq %rdx, %rbx � Use basic, debugging-friendly optimizations ( -Og ) long *dest) call plus � Put resulting binary in file p { movq %rax, (%rbx) long t = plus(x, y); popq %rbx C program ( p1.c p2.c ) text *dest = t; ret } Compiler ( gcc –Wall -g -Og -S ) ������������������������������� Asm program ( p1.s p2.s ) text gcc –Og -g –S sum.c �������������� sum.s Assembler ( gcc or as ) ������������������������������������������ ����������� �������� ������������������ Object program ( p1.o p2.o ) Static libraries binary ( .a ) ������� ���������������������������������������������������������������������������� ���������������������������� �������������������������������� Linker ( gcc or ld ) binary Executable program ( p ) CS 105 CS 105 – 9 – – 10 – Object Code Object Code Assembly Characteristics Assembly Characteristics ���������������� sumstore Assembler Minimal data types 0x0400595: Translates .s into .o Integer data of 1, 2, 4, or 8 bytes 0x53 � Data values 0x48 Binary encoding of each instruction � Addresses (untyped pointers) 0x89 Nearly-complete image of executable code Floating-point data of 4, 8, or 10 bytes 0xd3 0xe8 No aggregate types such as arrays or structures Missing linkages between code in different files 0xf2 � Just contiguously allocated bytes in memory 0xff Linker Code is also just byte sequences encoding instructions 0xff Resolves references between files Primitive operations 0xff 0x48 Perform arithmetic function on register or memory data Combines with static run-time libraries 0x89 Transfer data between memory and register � E.g., code for malloc , printf 0x03 � Load data from memory into register 0x5b Some libraries are dynamically linked � Store register data into memory 0xc3 � Linking occurs when program begins execution Transfer control � ����������������� � Unconditional jumps to/from procedures � ����������������� � Conditional branches ���������������� � ������������������ 0x0400595 CS 105 CS 105 – 11 – – 12 –

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend