5 B.1. Excerpts from the non-optimized EM_table
7 Even though the non-optimized version of the EM_table is relatively
8 straight-forward, examples have never hurt anybody.
9 One of the simplest instructions is the \*(Siloc\*(So, which appears in
10 our EM_table as follows:
13 .TA 8 16 24 32 40 48 56 64
14 C_loc ==> "set $1, T1";
19 Just as \*(SiSP\*(So is an alias for \*(Si%l0\*(So, \*(SiT1\*(So is
20 an alias for \*(Si%g1\*(So.
21 A little more complex is the \*(Siadi\*(So which performs integer
25 C_adi ==> "ld [SP], T1";
32 We could go on with even more complex instructions, but since that would
33 not contribute to anything the reader is referred to the implementation
36 B.2. Excerpts from the optimized EM_table
38 The optimized EM_table uses the cache primitives mentioned in chapter 4.
39 This means that the \*(Siloc\*(So this time appears as
42 C_loc ==> push_const($1).
45 The \*(Silol\*(So can now be written as
48 C_lol ==> push_reg(LB);
54 Due to the law of conservation of misery somebody has to do the dirty work.
55 In this case, it is the \*(Silos\*(So. To show just a small part of
56 the implementation of the \*(Silos\*(So:
60 if (type_of_tos() == T_cst) {
71 case 1: LD = "ldub"; break;
72 case 2: LD = "lduh"; break;
73 case 4: LD = "ld"; break;
74 default: arg_error("C_los", size);
84 For the full implementation, the reader is again referred to the actual
85 implementation. Just to show how other instructions are affected
86 by the optimization we will show that implementation of the \*(Sitge\*(So
98 " mov 1, $b"; /* delay slot */
111 In order of appearance:
115 Original idea - Dick Grune
116 Design & implementation - Philip Homburg
119 Assistant Tutor - Ceriel Jacobs
120 Proofreading - Dick Grune