Chapter 4 PPTV 52 Link
Chapter 4 PPTV 52 Link
1
Outline
Introduction
Instruction Execution Characteristics
Charactestics of RISC
CISC vrs RISC
RISC Pipelining
2
Introduction
Reduced Instruction Set Computer (RISC)
represents
◦ An important innovation in computer architecture
◦ It is an alternative processor design philosophy
◦ It is an attempt to produce more CPU power by
simplifying the instruction set of the CPU
The opposed trend to RISC is that of Complex
Instruction Set Computer (CISC)
3
Introduction…
In order to improve efficiency of software
development:
◦ powerful high-level programming languages have
been developed (e.g., C++, Java)
Allow programmer express algorithm more concisely
Support naturally the use of:
Structured programming or object-oriented design
Support higher levels of abstraction
This evolution has increased the “semantic
gap” between programming languages and
machine languages
4
Introduction…
Semantic gap
◦ The difference between the operations provided in HLLs
and those provided in computer architecture
5
Introduction…
Main features of CISC
◦ A large number of instructions (>200)
◦ Complex instructions and data types
◦ Many and complex addressing modes
To efficiently support the manipulation of complex
data structures such as multidimensional arrays and
structures
◦ Direct hardware implementations of high-level
language statements:
For example
CASE (switch) on VAX
Loop instruction on Pentium
6
Introduction…
Main features of CISC….
◦ Microprogramming techniques are used so that
complicated instructions can be implemented
In a cost effective way
Using microcode
7
Introduction…
Arguments for CISC
◦ Ease compiler Writing
A rich instruction set should simplify the compiler by having instructions
which match the high-level language statements
This works fine if the number of HLLs is very small
8
Introduction…
Problems With CISC
◦ A large instruction set requires complex and
potentially time consuming hardware steps to decode
and execute the instructions
9
Introduction…
Problems With CISC…
◦ Instruction sets designed with specialized
instructions for several high-level languages will
not be efficient when executing program of a given
language
10
Evaluation of Program Execution
A number of studies conducted over years
◦ To understand execution behavior of machine instruction
sequences generated from HLL programs
◦ To analyze the behavior of HLL programs
11
Evaluation of Program Execution
What are programs doing most of the time?
12
Evaluation Results
Operations
◦ Table shows which types of HLL statements occurs most
often and therefore must be supported in optimal fashion
◦ Results
Assignment statement predominates
Suggests a simple movement of data is of high importance
Large number of conditional statements (IF, Loop)
Suggests sequence control mechanism of the instruction set is
important
13
Evaluation Results…
Operations …
◦ Table shows which types of HLL statements causes the
execution of the most machine language instructions
◦ Results
Procedure call statements are the most time consuming
operations of HLL programs
constitute about 12-15% of HLL statement but
constitute 31-32% of total machine instructions
Generates nearly half - 45% of all memory references
14
Evaluation Results…
Operations …
◦ Addressing modes:
the majority of instructions uses simple
addressing modes
complex addressing modes
(memory indirect, indexed + indirect, etc.) are
only used by ~18% of the instructions
15
Evaluation Results…
Operations …
◦ Conclusion
Target architectural implementation to support these
operations well
16
Evaluation Results…
Operand types:
◦ 74-80% of the operands are scalars
integers, reals, characters, etc…
about 80% of the scalars are local variables
◦ the rest (20-26%) are arrays/structures
90% of them are global variables
Conclusion:
◦ The majority of operands are local variables of
scalar type, which can be stored in registers
17
Evaluation Results…
Execution Sequencing --- Procedure calls
◦ Seen that procedure calls are the most time
consuming operations in HLLS
◦ Statistics on procedure calls
98% of dynamically called procedures passed
fewer than 6 parameters
92% use less than 6 local scalar variables
Implies about activation record size
Rare to have a long sequence of procedure calls
followed by returns
Depth of nesting was typically rather low
18
Evaluation Conclusion
An overwhelming dominance of Simple
(ALU and move) operations over complex
operations
Dominance of simple addressing
modes
Large frequency of operand accesses;
on average each instruction references
1.9 operands
19
Evaluation Conclusions …
Most of the referenced operands are scalars
(can be stored in registers) and are local
variables or parameters
20
RISC Characterstics
A small number of simple instructions (<100)
◦ Simple and small decode and execution hardware are
required
◦ A hard-wired controller is needed, rather than using
microprogramming
◦ The CPU takes less silicon area to implement, and runs also
faster
Execution of one instruction per clock cycle
21
RISC Characterstics
The instruction pipeline performs more efficiently
due to simple instructions and similar execution
patterns
22
RISC Characteristics …
Load-and-store architecture
◦ Only LOAD and STORE instructions reference data in memory
◦ All other instructions operate only with registers
Register- to-register instructions
Only a few simple addressing modes are used
◦ E.g. register, direct, register indirect, displacement
Instructions are of fixed length and uniform format
◦ Loading and decoding of instructions are simple and fast
◦ It is not needed to wait until the length of an instruction is
known in order to start decoding it.
◦ Decoding is simplified because the opcode and address
fields are located in the same position for all instructions
23
RISC Characteristics …
A large number of registers is available
◦ Variables and intermediate results can be stored in
registers and do not require repeated loads and stores
from/to memory
◦ All local variables of procedures and the passed parameters
can be stored in registers
The large number of registers is due to that the
reduced complexity of the processor leaves silicon
space on the chip to implement them
◦ This is usually not the case with CISC machines
24
RISC Characteristics …
Register Windows
◦ A large number of registers is usually very useful
◦ However, if contents of all registers must be saved at every
procedure call, more registers mean longer delay
◦ A solution to this problem is to divide the register file into a
set of fixed-size windows
Each window is assigned to a procedure
Windows for adjacent procedures are overlapped to allow
parameter passing
25
RISC Characteristics …
Register Windows
◦ A large number of registers is usually very useful
◦ However, if contents of all registers must be saved at every
procedure call, more registers mean longer delay.
◦ A solution to this problem is to divide the register file into a
set of fixed-size windows.
Each window is assigned to a procedure.
Windows for adjacent procedures are overlapped to allow
parameter passing
26
Main Advantages of RISC
Best support is given by optimizing most
used and most time consuming architecture
aspects
◦ Frequently executed instructions
◦ Memory reference
◦ Procedure call/return
◦ Pipeline design
Less design complexity, reducing design cost,
and reducing the time between designing and
Marketing
27
Criticisms of RISC
An operation might need two, three, or more
instructions to accomplish
◦ More memory access might be needed
◦ Execution speed may be reduced in certain
applications
It usually leads to longer programs, which needs
larger memory space to store
Difficult to program machine codes and assembly
programs
◦ More time consuming
28
RISC vrs CISC
Studies have shown that benchmark
programs run often faster on RISC processors
than on CISC machines
However, it is difficult to identify which RISC
29
RISC vrs CISC…
An argument in favor of the CISC:
◦ The simpler RISC instruction set results in a larger
memory requirement compared with the CISC case
30
CISC and RISC Examples
31
Reading Assignment
Pipelining in RISC processors
◦ (Read Chapter 13 --- of William Stallings)
32
Summary
Both RISCs and CISCs try to reduce the semantic gap, with
different approaches.
◦ CISCs follow the traditional way of implementing more and more
complex instructions.
◦ RISCs try to simplify the instruction set, while improving the instruction
execution performance.
Innovations in RISC architectures are based on a close analysis
of typical programs
The main features of RISC architectures are:
◦ reduced number of simple instructions, few addressing modes;
◦ instructions with fixed length and format, load store architecture;
◦ a large number of registers.
RISCs support efficient implementation of pipelining
Most modern architectures often include both RISC and
CISC features.
33