source: liacs/ca/opdr1/README@ 11

Last change on this file since 11 was 2, checked in by Rick van der Zwet, 15 years ago

Initial import of data of old repository ('data') worth keeping (e.g. tracking
means of URL access statistics)

File size: 2.2 KB
Line 
1/* Author : Rick van der Zwet
2 * S-number : 0433373
3 * Version : $Id: README.txt 217 2007-09-10 19:35:36Z rick $
4 * Copyright : FreeBSD Licence
5 */
6
7=Assignment 1=
8==Static instructions==
9We could define static instructions into groups:
10* Loop 1 : 18
11* Loop 2 : 30
12-------------------------------------------------
13TOTAL : 58
14
15==Dynamic instructions==
16Dynatic instructions into groups
17* Initial intructions : 0
18* Intructions loop 1 init : 2
19* Intructions loop 1 main : (3 + 13) * 20 + 4
20** *20 cause 20 times loop
21** +4 cause of the last compare (including jump)
22* Intructions loop 2 init : 4
23* Intructions loop 2 main : (3 + 22) * 20 + 4
24** *20 cause 20 times loop
25** +4 cause of the last compare (including jump)
26-------------------------------------------------
27TOTAL : 834
28
29==Data accesses==
30* Loop 1 : 1 + 1 * 21 + 5 * 20
31* init, compare, inner loop
32* Loop 2 : 2 + 1 * 21 + 8 * 20
33* init, compare, inner loop
34-------------------------------------------------
35TOTAL : 305
36
37
38=Optimalisation=
39
40The most easy way to kill all dynamic instructions will be calculating
41the final result and write the results into the memory and registery
42directly, meaning at the end
43for i = 1 .. 20
44B[i] = i
45A[i] = B[i-1] + C
46C = 42
47i = 20
48$2 = 20 (last value of i, last loop compare)
49$3 = 0 (last loop compare)
50$4 = 42
51
52==Static intructions==
53* Number of intructions will be: 84
54
55==Dynamic instructions==
56* Dynamic intructions eq to static intructions as we define all
57 results directly: 84
58
59==Data accesses==
60* Cause we also have some references to the registery not all calls are
61 data accesses, the count stops at:
62 * B = 19
63 * A1 = 2
64 * A = 18
65 * C = 1
66 * i = 1
67 ----------
68 TOTAL = 41
69
70==Speedup==
71Dynamic count old: 834
72Dynamic count new: 84
73Speedup in execution time: 1 / (84/834) = 9.93
74quote Van Thieu Vu, why we do not use the Amdahl law over here
75Here we calculate the performance gain of an optimized program while the
76Amdahl's law which you mentioned is used to calculate the performance gain
77of an improved computer. In your case, the speedup is 1/(84/834).
78
79
80
81
82
83
84
Note: See TracBrowser for help on using the repository browser.