ST20-C1 STMICROELECTRONICS [STMicroelectronics], ST20-C1 Datasheet - Page 183

no-image

ST20-C1

Manufacturer Part Number
ST20-C1
Description
Instruction Set Reference Manual
Manufacturer
STMICROELECTRONICS [STMicroelectronics]
Datasheet
then the total stack requirement is the larger stack requirement of the individual
expressions. This is only the case if care is taken over the order of evaluation. Note
that ‘infinite’ should be taken as meaning greater than any finite depth - because a
function call does not preserve values on the stack.
Let the function eval( e, r ) evaluate expression e where there are r registers available
to perform the evaluation. Where this expression is an operation on two sub expres-
sions - e1 op e2 - it is efficiently evaluated by the following algorithm, where op
commutes is true if a op b is equal to b op a and false otherwise:
if (depth(e1) < r AND depth(e2) < r) /* i.e. depth of both expressions is less
{
}
else if (depth(e1) >= r OR depth(e2) >= r) {
if (depth(e2) > depth(e1)) {
}
else if (depth(e2) <= depth(e1)) {
}
if (depth(e2) >= depth(e1)) {
}
else if (depth(e2) < depth(e1)) {
if (op commutes) {
}
else {
}
eval( e1, r ); eval( e2, r-1 ); op
if (depth(e1) >= r ){
}
else {
}
if (depth(e2) >= r) {
}
else {
eval( e2, r ); eval( e1, r-1 ); op
eval( e2, r ); eval( e1, r-1 ); rev; op
eval( e2, r ); stl temp; eval( e1, r ); ldl temp; op
if (op commutes) {
}
else {
}
if (op commutes){
}
else {
}
eval( e1, r ); eval( e2, r-1 ); op
eval( e2, r ); eval( e1, r-1 ); op
eval( e2, r ); eval( e1, r-1 ); rev; op
eval( e1, r ); stl temp; eval( e2, r ); ldl temp; op
eval( e2, r ); stl temp; eval( e1, r ); ldl temp; op
/* i.e. both depths >= r */
/* i.e. depth(e1) < r AND depth(e2) >=r */
/* i.e. operation doesn’t commute */
/* i.e. both depths >= r */
/* i.e. (depth(e2) < r) AND depth(e1) >= r */
than the number of registers available */
(*)
183/205

Related parts for ST20-C1