Crosscutting Issues: The Rôle of Compilers Architects must be aware of current compiler technology Compiler Architecture.

Slides:



Advertisements
Similar presentations
Instruction Set Design
Advertisements

Henk Corporaal TUEindhoven 2011
Goal: Write Programs in Assembly
Review of the MIPS Instruction Set Architecture. RISC Instruction Set Basics All operations on data apply to data in registers and typically change the.
CPE 631: Instruction Set Principles and Examples Electrical and Computer Engineering University of Alabama in Huntsville Aleksandar Milenkovic,
ISA Issues; Performance Considerations. Testing / System Verilog: ECE385.
1 Lecture 3: Instruction Set Architecture ISA types, register usage, memory addressing, endian and alignment, quantitative evaluation.
Lecture 3: Instruction Set Principles Kai Bu
1 ECE462/562 ISA and Datapath Review Ali Akoglu. 2 Instruction Set Architecture A very important abstraction –interface between hardware and low-level.
CS CS136, Advanced Architecture Instruction Set Architecture.
CS1104 – Computer Organization PART 2: Computer Architecture Lecture 5 MIPS ISA & Assembly Language Programming.
ELEN 468 Advanced Logic Design
Systems Architecture Lecture 5: MIPS Instruction Set
Chapter 2 Instructions: Language of the Computer
Chapter 2.
Recap Measuring and reporting performance Quantitative principles Performance vs Cost/Performance.
PART 4: (2/2) Central Processing Unit (CPU) Basics CHAPTER 13: REDUCED INSTRUCTION SET COMPUTERS (RISC) 1.
S. Barua – CPSC 440 CHAPTER 2 INSTRUCTIONS: LANGUAGE OF THE COMPUTER Goals – To get familiar with.
RISC Concepts, MIPS ISA and the Mini–MIPS project
Lecture 5 Sept 14 Goals: Chapter 2 continued MIPS assembly language instruction formats translating c into MIPS - examples.
RISC. Rational Behind RISC Few of the complex instructions were used –data movement – 45% –ALU ops – 25% –branching – 30% Cheaper memory VLSI technology.
CSE378 MIPS ISA1 MIPS History MIPS is a computer family –R2000/R3000 (32-bit); R4000/4400 (64-bit); R8000; R10000 (64-bit) etc. MIPS originated as a Stanford.
Reduced Instruction Set Computers (RISC) Computer Organization and Architecture.
CH13 Reduced Instruction Set Computers {Make hardware Simpler, but quicker} Key features  Large number of general purpose registers  Use of compiler.
CET 520/ Gannod1 The MIPS Architecture Section 2.12.
1 Appendix B Classifying Instruction Set Architecture Memory addressing mode Operations in the instruction set Control flow instructions Instruction format.
Classifying GPR Machines TypeNumber of Operands Memory Operands Examples Register- Register 30 SPARC, MIPS, etc. Register- Memory 21 Intel 80x86, Motorola.
Computer architecture Lecture 11: Reduced Instruction Set Computers Piotr Bilski.
1 Appendix A: Instruction Set Principles and Examples Classifying Instruction Set Architecture Memory addressing mode Operations in the instruction set.
1 Instruction Set Architecture (ISA) Alexander Titov 10/20/2012.
Instruction Set Architecture The portion of the machine visible to the programmer Issues: Internal storage model Addressing modes Operations Operands Encoding.
Computer Architecture (CS 207 D) Instruction Set Architecture ISA.
MIPS Processor Chapter 12 S. Dandamudi To be used with S. Dandamudi, “Introduction to Assembly Language Programming,” Second Edition, Springer,
ECEG-3202 Computer Architecture and Organization Chapter 7 Reduced Instruction Set Computers.
Reduced Instruction Set Computers. Major Advances in Computers(1) The family concept —IBM System/ —DEC PDP-8 —Separates architecture from implementation.
Csci 136 Computer Architecture II – Summary of MIPS ISA Xiuzhen Cheng
Lecture 04: Instruction Set Principles Kai Bu
 1998 Morgan Kaufmann Publishers MIPS arithmetic All instructions have 3 operands Operand order is fixed (destination first) Example: C code: A = B +
CS 211: Computer Architecture Lecture 2 Instructor: Morris Lancaster.
Chapter 2 CSF 2009 The MIPS Assembly Language. Stored Program Computers Instructions represented in binary, just like data Instructions and data stored.
MS108 Computer System I Lecture 3 ISA Prof. Xiaoyao Liang 2015/3/13 1.
Instruction Sets: Addressing modes and Formats Group #4  Eloy Reyes  Rafael Arevalo  Julio Hernandez  Humood Aljassar Computer Design EEL 4709c Prof:
Chapter 2 — Instructions: Language of the Computer — 1 Memory Operands Main memory used for composite data – Arrays, structures, dynamic data To apply.
What is a program? A sequence of steps
DR. SIMING LIU SPRING 2016 COMPUTER SCIENCE AND ENGINEERING UNIVERSITY OF NEVADA, RENO Session 7, 8 Instruction Set Architecture.
Computer Organization Instructions Language of The Computer (MIPS) 2.
Assembly Variables: Registers Unlike HLL like C or Java, assembly cannot use variables – Why not? Keep Hardware Simple Assembly Operands are registers.
MAC/VU-Advanced Computer Architecture Lecture 6- Instruction Set Principles (3) 1 Advanced Computer Architecture CS 704 Advanced Computer Architecture.
Instruction Set Principles
Assembly language.
ELEN 468 Advanced Logic Design
RISC Concepts, MIPS ISA Logic Design Tutorial 8.
Advanced Computer Architecture 5MD00 / 5Z032 Instruction Set Design
Computer Architecture (CS 207 D) Instruction Set Architecture ISA
Instructions - Type and Format
Appendix A Classifying Instruction Set Architecture
Lecture 4: MIPS Instruction Set
Systems Architecture I (CS ) Lecture 5: MIPS Instruction Set*
Systems Architecture Lecture 5: MIPS Instruction Set
The University of Adelaide, School of Computer Science
Computer Instructions
Chapter 2. Instruction Set Principles and Examples
Computer Architecture
Evolution of ISA’s ISA’s have changed over computer “generations”.
Instruction Set Principles
Evolution of ISA’s ISA’s have changed over computer “generations”.
Lecture 4: Instruction Set Design/Pipelining
Systems Architecture I (CS ) Lecture 5: MIPS Instruction Set*
Presentation transcript:

Crosscutting Issues: The Rôle of Compilers Architects must be aware of current compiler technology Compiler Architecture

Modern Compilers Front End High-level Optimisations Global Optimiser Code Generator E.g. procedure inlining, loop transformations Register allocation Machine dependent optimisations

Compiler Technology Multiple passes complicate matters –E.g. common subexpression elimination must assume that a register will be allocated for the temporary value –E.g. Procedure inlining before size is known Register allocation is critical –Uses graph colouring techniques –Requires at least 16 registers to be effective

Architectural Issues How are variables allocated and addressed? –Stack: local variables, scalars –Global data area: global variables, constants, arrays –Heap: dynamic objects, not scalars How many registers are needed? –Integer: 26 registers –FP: 20 registers

Aiding Compiler Writers Architectures should: –Be regular (orthogonal instruction set) –Provide primitives, not solutions –Simplify trade-offs among alternatives –Not require run-time interpretation of data known at compile-time VAX CALLS Keep it simple!

Compiler Support for Multimedia Instructions SIMD instructions act on multiple smaller data items in a large “word” –Solutions, not primitives! –Too few registers! –Data types not found in programming languages! Result: Only used by low-level graphics libraries.

Multimedia Instructions These SIMD instructions act like a “mini- vector” architecture –E.g. MMX in 64 bits 8 × 8-bit vectors 4 × 16-bit vectors 2 × 32-bit vectors –SSE: 128 bits –Much more limited than genuine vector processors

Putting It All Together: MIPS 64-bit load/store design RISC features: –GPR, load-store architecture –Small, simple instruction set –Designed for efficient pipelining (fixed length instructions) –Efficient compiler target

MIPS bit integer registers –R0…R31 –R0 fixed: bit or 32-bit floating point registers –Supports “paired single” operations

MIPS Data Types Integer: –Bytes, 16-bit halfwords, 32-bit words, 64-bit double words Operations are all 64-bit Floating point: –32-bit and 64-bit

MIPS Addressing Modes Only immediate and displacement –16-bit displacements/immediates –Register-indirect: set displacement = 0 –16-bit absolute: use R0 Byte addressable with 64-bit addresses Big-endian or little-endian Alignment required

MIPS Instructions Three instruction formats: opcode rs rt immediate I-type opcode offset 6 26 J-type opcode rs rtshamt R-type rd 5 funct 6

MIPS Operations Load-store ALU operations –Add, subtract, multiply, divide, and, or, xor, LUI (load upper immediate), shifts Control transfer –Set conditions –Branch (reg=0, reg  0, reg 1 =reg 2, reg 1  reg 2 ), jump, jump-and-link (call) –Conditional move Floating point –Paired single operations –Multiply-add (DSP)

MIPS: Instruction Usage Integer applications: –Load, add, branch, store, or, compare FP applications: –Add (int), load (int), load, multiply, add, store Figure 2.34.

Another View: Trimedia Media Processor Embedded processor for multimedia applications –E.g. set-top boxes (decoders, etc.) and TVs Very different architecture – bit registers (FP or int) –Partitioned (SIMD) instructions –2’s complement and saturating arithmetic –VLIW architecture

Trimedia: VLIW Approach Compiler can group up to five instructions for simultaneous execution –Must be independent –Use NOPs if there are insufficient independent instructions Large program size Trimedia uses memory compression Programs are 2-3 times larger than MIPS (even with compression)!

Fallacies and Pitfalls Pitfall: Designing a “high-level” instruction set to support HLL’s –Seldom provide an exact match –Often too general (VAX CALLS )

Fallacies and Pitfalls Fallacy: There is such a thing as a typical program –Programs vary very significantly Pitfall: Designing an architecture to reduce code size without considering compilers –Compilers have much greater impact on code size –Start with densest compiled code

Fallacies and Pitfalls Pitfall: Expecting good compiled performance for DSPs –Hand-tuned assembler is faster and more compact Fallacy: An architecture without flaws cannot be successful –80x86! Segments, accumulators, stack-based FP

Fallacies and Pitfalls Fallacy: You can design a flawless architecture –All designs have trade-offs VAX code size more important than easy decoding Early RISCs: delayed branches Address space

2.15. Concluding Remarks 1960’s: Stack architectures –Matched the compiler technology of the day 1970’s: CISC era –Tried to support HLL features in hardware Today: RISC era –Simple, load-store architectures

Concluding Remarks Trends in the 1990’s: –Move to 64 bits –Conditional instructions Eliminating branches –Optimisation of cache access (prefetch instructions) –Support for multimedia –Faster floating point

The Future Trend towards VLIW architectures Increased use of conditional execution Blending of general-purpose and DSP architectures Emulating 80x86 architecture