Hi Pan, in general LGTM. Would you mind adding the coremark-pro testcase which should be working now, and, was the original reason for doing this?
I believe the following should do:
extern int wsize;
typedef unsigned short Posf;
#define NIL 0
void foo (Posf *p)
{
register unsigned n, m;
do {
m = *--p;
*p = (Posf)(m >= wsize ? m-wsize : NIL);
} while (--n);
}
Regards
Robin
