Information Technology Reference
In-Depth Information
8. A compiler designer is trying to decide between two code sequences for a
particular machine. The hardware designers have supplied the following
facts:
Instruction
class
CPI of the
instruction class
A
1
B
3
C
4
For a particular high-level language, the compiler writer is considering two
sequences that require the following instruction counts:
Instruction counts
(in millions)
Code
sequence
AB
C
1
2
1
2
2
4
3
1
What is the CPI for each sequence? Which code sequence is faster? By how
much?
9. Consider a machine with three instruction classes and CPI measurements as
follows:
Instruction
class
CPI of the
instruction class
A
2
B
5
C
7
Suppose that we measured the code for a given program in two different
compilers and obtained the following data:
Instruction counts
(in millions)
Code
sequence
AB
C
Compiler 1
15
5
3
Compiler 2
25
2
2
Search WWH ::




Custom Search