Lecture 6 - RISC
Lecture 6 - RISC
Introduction
Since the development of the stored program computer around 1950, there are few innovations in
the area of computer organization and architecture. Some of the major developments are:
The Family Concept: Introduced by IBM with its system/360 in 1964 followed by DEC,
with its PDP-8. The family concept decouples the architecture of a machine from its
implementation. A set of computers are offered, with different price/performance
characteristics, that present the same architecture to the user.
Microprogrammed Control Unit: Suggested by Wilkes in 1951, and introduced by IBM
on the S/360 line in 1964. Microprogramming eases the task of designing and implementing
the control unit and provide support for the family concept.
Cache Memory: First introduced commercially on IBM S/360 Model 85 in 1968. The
insertion of this element into the memory hierarchy dramatically improves performance.
Pipelining: A means of introducing parallelism into the essentially sequential nature of a
machine instruction program. Examples are instruction pipelining and vector processing.
Multiple Processor: This category covers a number of different organizations and
objectives.
When it appeared, RISC architecture was a dramatic departure from the historical trend in processor
architecture. An analysis of the RISC architecture brings into focus many of the important issues in
computer organization and architecture.
Although RISC architectures have been defined and designed in a variety of ways by different
groups, the key elements shared by most designs are these:
A large number of general-purpose registers, and/or the use of compiler technology to
optimize register usage.
A limited and simple instruction set.
An emphasis on optimizing the instruction pipeline.
Table 1 compares several RISC and non-RISC systems. We begin this chapter with a brief survey of
some results on instruction sets, and then examine each of the three topics just listed. This is
followed by a description of two of the best-documented RISC designs
Instruction Execution Characteristics
One of the most visual forms of evolution associated with computers is that of programming
languages. Even more powerful and complex high level programming languages has been
developed by the researcher and industry people.
The development of powerful high level programming languages give rise to another problem
known as the semantic gap, the difference between the operations provided in HLLs and those
provided in computer architecture.
The computer designers intend to reduce this gap and include large instruction set, more addressing
mode and various HLL statements implemented in hardware. As a result the instruction set becomes
complex. Such complex instruction sets are intended to-
Ease the task of the compiler writer.
Improve execution efficiency, because complex sequences of operations can be implemented
in microcode.
Provide support for even more complex and sophisticated HLLs.
To reduce the gap between HLL and the instruction set of computer architecture, the system
becomes more and more complex and the resulted system is termed as Complex Instruction Set
Computer (CISC).
A number of studies have been done over the years to determine the characteristics and patterns of
execution of machine instructions generated from HLL programs. The instruction execution
characteristics involves the following aspects of computation:
Operation Performed: These determine the functions to be performed by the processor and
its interaction with memory.
Operand Used: The types of operands and the frequency of their use determine the memory
organization for storing them and the addressing modes for accessing them.
Execution sequencing: This determines the control and pipeline organization.
These results are instructive to the machine instruction set designers, indicating which type of
statements occur most often and therefore should be supported in an “optimal” fashion.
From these studies one can observe that though a complex and sophisticated instruction set is
available in a machine architecture, common programmer may not use those instructions frequently.
Operands :
Researches also studied the dynamic frequency of occurrence of classes of variables. The results
showed that majority of references are single scalar variables. In addition references to
arrays/structures required a previous reference to their index or pointer, which again is usually a
local scalar. Thus there is a predominance of references to scalars, and these are highly localized.
It is also observed that operation on local variables is performed frequently and it requires a fast
accessing of these operands. So, it suggests that a prime candidate for optimization is the
mechanism for storing and accessing local scalar variables.
Procedure Call :
The procedure calls and returns are an important aspects of HLL programs. Due to the concept of
modular and functional programming, the call/return statements are becoming a predominate factor
in HLL program.
It is known fact that call/return is a most time consuming and expensive statements. Because during
call we have to restore the current state of the program which includes the contents of local
variables that are present in general purpose registers. During return, we have to restore the original
state of the program from where we start the procedure call.
Thus, it will be profitable to consider ways of implementing these operations efficiently. Two
aspects are significant, the number of parameters and variables that a procedure deals with, and the
depth of nesting.
Implications :
A number of groups have looked at these results and have concluded that the attempt to make the
instruction set architecture close to HLL is not the most effective design strategy. Generalizing from
the work of a number of researchers three element emerge in the computer architecture.
First, use a large number of registers or use a compiler to optimize register usage. This is
intended to optimize operand referencing.
Second, careful attention needs to be paid to the design of instruction pipelines. Because of
the high proportion of conditional branch and procedure call instructions, a straight forward
instruction pipeline will be inefficient. This manifests itself as a high proportion of
instructions that are prefetched but never executed.
Third, a simplified (reduced) instruction set is indicated. It is observed that there is no point
to design a complex instruction set which will lead to a complex architecture. Due to the
fact, a most interesting and important processor architecture evolves which is termed as
Reduced Instruction Set Computer (RISC) architecture.
Although RISC system have been defined and designed in a variety of ways by different groups, the
key element shared by most design are these:
A large number of general purpose registers, or the use of compiler technology to optimize
register usage.
A limited and simple instruction set.
An emphasis on optimizing the instruction pipelin
An analysis of the RSIC architecture begins into focus many of the important issues in computer
organization and architecture. The table in the next page compares several RISC and non-RISC
system. . . . . .
Register Window :
The use of a large set of registers should decrease the need to access memory. The design task is to
organize the registers in such a way that this goal is realized.
Due to the use of the concept of modular programming, the present day programs are dominated by
call/return statements. There are some local variables present in each function or procedure.
1. On every call, local variables must be saved from the registers into memory, so that the
registers can be reused by the called program. Furthermore, the parameters must be passed.
2. On return, the variables of the parent program must be restored (loaded back into registers)
and results must be passed back to the parent program.
3. There are also some global variables which are used by the module or procedure.
Thus the variables that are used in a program can be categorized as follows :
Global variables : which is visible to all the procedures.
Local variables : which is local to a procedure and it can be accessed inside the procedure
only.
Passed parameters : which are passed to a subroutine from the calling program. So, these are
visible to both called and calling program.
Returned variable : variable to transfer the results from called program to the calling
program. These are also visible to both called and calling program.
Why CISC
CISC has richer instruction sets, which include a larger number of instructions and more complex
instructions. Two principal reasons have motivated this trend: a desire to simplify compilers and a
desire to improve performance.
The first of the reasons cited, compiler simplification, seems obvious. The task of the compiler
writer is to generate a sequence of machine instructions for each HLL statement. If there are
machine instructions that resemble HLL statements, this task is simplified.
This reasoning has been disputed by the RISC researchers. They have found that complex machine
instructions are often hard to exploit because the compiler must find those cases that exactly fit the
construct. The task of optimizing the generated code to minimize code size, reduce instruction
execution count, and enhance pipelining is much more difficult with a complex instruction set.
The other major reason cited is the expectation that a CISC will yield smaller, faster programs. Let
us examine both aspects of this assertion: that program will be smaller and that they will execute
faster. There are two advantages to smaller programs.
First, because the program takes up less memory, there is a savings in that resource.
Second, in a paging environment, smaller programs occupy fewer pages, reducing page
faults.
The problem with this line of reasoning is that it is far from certain that a CISC program will be
smaller than a corresponding RISC program. Thus it is far from clear that a trend to increasingly
complex instruction sets is appropriate. This has led a number of groups to pursue the opposite path.