From 75af26d25f7bff47a1ff92c533d6cc9e63f0af6a Mon Sep 17 00:00:00 2001 From: Bryce Denney Date: Wed, 17 Apr 2002 04:19:03 +0000 Subject: [PATCH] - auxilliary file included by translate1.c --- bochs-performance/testcases/translate1-defs.h | 36 +++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 bochs-performance/testcases/translate1-defs.h diff --git a/bochs-performance/testcases/translate1-defs.h b/bochs-performance/testcases/translate1-defs.h new file mode 100644 index 000000000..aef2ad145 --- /dev/null +++ b/bochs-performance/testcases/translate1-defs.h @@ -0,0 +1,36 @@ +typedef struct { + int x, y; + int accum; + int *load_ptr; + int *store_ptr; + int done; +} State; + +#define MAX 128 +extern int array[MAX][MAX]; +extern int array2[MAX][MAX]; + +//#define ST(n) (state->n) +#define ST(n) (n) + +#define TOP_OF_TRANSLATED_FUNCTION() \ + int x=state->x, y=state->y, accum=state->accum; \ + int *load_ptr=state->load_ptr, *store_ptr=state->store_ptr; \ + +#define BOTTOM_OF_TRANSLATED_FUNCTION() do { \ + state->x=x; state->y=y; state->accum=accum; \ + state->load_ptr=load_ptr; state->store_ptr=store_ptr; \ +} while (0) + + +#define DO_MOVE_REL(delta_x,delta_y) do { \ + ST(x) += delta_x; \ + ST(y) += delta_y; \ + ST(load_ptr) = &array[ST(x)][ST(y)]; \ + } while (0) +#define DO_SET_ACCUM(x) ST(accum) = x +#define DO_ADD_DATA() ST(accum) += *ST(load_ptr) +#define DO_SUBTRACT_DATA() ST(accum) -= *ST(load_ptr) +#define DO_MULTIPLY_DATA() ST(accum) *= *ST(load_ptr) +#define DO_STORE_DATA() *ST(store_ptr) = ST(accum) +#define DO_END() ST(done) = 1