No subject


Fri Feb 8 08:55:55 EST 2008


/** stack value readers */
#define READ_I32(A)    ((A).data.i)
#define READ_I64(A)    ((A).data.l)
#define READ_DOUBLE(A) ((A).data.f)
#define READ_NATI(A)   ((DATA_TYPE (NATI))(((A).type =3D=3D VAL_I32) \
			   ? (A).data.i \
			   : (A).data.nati))

#define READ_SV(t, A) READ_##t ((A))

/** stack value writers */
#define WRITE_I32(A, v)    ((A).data.i =3D (DATA_TYPE (I32))(v))
#define WRITE_I64(A, v)    ((A).data.l =3D (DATA_TYPE (I64))(v))
#define WRITE_DOUBLE(A, v) ((A).data.f =3D (DATA_TYPE (DOUBLE))(v))
#define WRITE_NATI(A, v)   ((A).type   =3D VAL_NATI, \
			    (A).data.nati =3D (DATA_TYPE (NATI))(v))

#define WRITE_SV(t, A, v) WRITE_##t ((A), (v))

/**
 * Operation helpers:
 */
#define BINARY_OP_WITH_CHECK(t, op, A, B) \
do { \
	op##_CHECK (t, (A), (B)); \
	op##_OP    (t, (A), (B)); \
} while (0)

#define BINARY_OP(t, op, A, B) \
	WRITE_SV (t, (A), READ_SV (t, (A)) op READ_SV (t, (B))); \

#define CHECK_NONE (0)

/**
 * Binary numeric operations:
*/
#define BINARY_NUMERIC_RESULT_TYPE(A, B) \
	(((A).type =3D=3D (B).type) ? (A).type : VAL_NATI)

#define BINARY_NUMERIC_SWITCH(op, A, B) \
do { \
	switch (BINARY_NUMERIC_RESULT_TYPE ((A), (B))) { \
	case VAL_I32:    BINARY_OP_WITH_CHECK (I32,    op, (A), (B)); break;
\
	case VAL_I64:    BINARY_OP_WITH_CHECK (I64,    op, (A), (B)); break;
\
	case VAL_NATI:   BINARY_OP_WITH_CHECK (NATI,   op, (A), (B)); break;
\
	case VAL_DOUBLE: BINARY_OP_WITH_CHECK (DOUBLE, op, (A), (B)); break;
\
	default: ves_abort (); \
	} \
} while (0)


________________________________________
From: mono-devel-list-admin at lists.ximian.com
[mailto:mono-devel-list-admin at lists.ximian.com] On Behalf Of Bernie =
Solomon
Sent: Wednesday, July 23, 2003 5:15 PM
To: mono-devel-list at lists.ximian.com

=A0
I attach quite a large patch for interp.c to primarily cope with 64 bit =
big
endian machines though it also includes some fixes to instruction =
handling
particularly for OVF instructions - and generating exceptions for some =
other
operations properly. I have tried to get instruction behaviour correct =
re
handing of native int correct as per the spec. Also every exit now goes =
via
a label (exit_frame) partly for debugging and also because in some
experiments I wanted to add code for it.
=A0
No doubt there may be issues with the way I have done things but I =
though
I'd post it for review.
=A0
Bernie Solomon
=A0
=A0




More information about the Mono-devel-list mailing list