First hack at alpha support

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@3532 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Richard Frith-MacDonald 1999-01-06 11:04:10 +00:00
parent 3d5bd13a52
commit 9a2d79b6e3
3 changed files with 146 additions and 0 deletions

View file

@ -1,3 +1,9 @@
Wed Jan 6 10:30:00 1999 Richard Frith-Macdonald <richard@brainstorm.co.uk>
* mframe/alpha/linux-gnu: First rough attempt at making a config
file for the DEC alpha.
* mframe/alpha/gneric: ditto.
Tue Jan 5 20:30:00 1999 Richard Frith-Macdonald <richard@brainstorm.co.uk>
* configure.in: New stuff for making byte-order and type-size

View file

@ -0,0 +1,70 @@
/* See ../README for copyright */
/*
* All arguments are passed on the stack with small (< sizeof(void*)) values
* occupying the space of a pointer.
* If the method returns a structure, it's address is passed as an invisible
* first argument.
*/
#define MFRAME_STRUCT_BYREF 0
#define MFRAME_SMALL_STRUCT 0
#define MFRAME_ARGS_SIZE 104
#define MFRAME_RESULT_SIZE 16
#define MFRAME_FLT_IN_FRAME_AS_DBL 0
/*
* Structures are passed by reference as an invisible first argument, so
* they go in the first space on the stack.
*/
#define MFRAME_GET_STRUCT_ADDR(ARGS, TYPES) \
((*(TYPES)==_C_STRUCT_B || *(TYPES)==_C_UNION_B || *(TYPES)==_C_ARY_B) ? \
*(void**)(ARGS) : (void*)0)
#define MFRAME_SET_STRUCT_ADDR(ARGS, TYPES, ADDR) \
({if (*(TYPES)==_C_STRUCT_B || *(TYPES)==_C_UNION_B || *(TYPES)==_C_ARY_B) \
*(void**)(ARGS) = (ADDR);})
/*
* Declare a type for keeping track of the arguments processed.
*/
typedef int MFRAME_ARGS;
/*
* Initialize a variable to keep track of argument info while processing a
* method. Keeps count of the offset of arguments on the stack.
* This offset is adjusted to take account of an invisible first argument
* used to return structures.
*/
#define MFRAME_INIT_ARGS(CUM, RTYPE) \
({ \
(CUM) = \
((*(RTYPE)==_C_STRUCT_B || *(RTYPE)==_C_UNION_B || *(RTYPE)==_C_ARY_B) ? \
sizeof(void*) : 0); \
})
#define MFRAME_ARG_ENCODING(CUM, TYPE, STACK, DEST) \
({ \
const char* type = (TYPE); \
int align, size; \
\
(TYPE) = objc_skip_typespec(type); \
align = objc_alignof_type (type); \
size = objc_sizeof_type (type); \
\
(CUM) = ROUND ((CUM), align); \
sprintf((DEST), "%.*s%d", (TYPE)-type, type, (CUM)); \
(STACK) = (CUM) + size; \
(CUM) += ROUND(size, sizeof(void*)); \
(DEST)=&(DEST)[strlen(DEST)]; \
if (*(TYPE) == '+') \
{ \
(TYPE)++; \
} \
while (isdigit(*(TYPE))) \
{ \
(TYPE)++; \
} \
})

View file

@ -0,0 +1,70 @@
/* See ../README for copyright */
/*
* All arguments are passed on the stack with small (< sizeof(void*)) values
* occupying the space of a pointer.
* If the method returns a structure, it's address is passed as an invisible
* first argument.
*/
#define MFRAME_STRUCT_BYREF 0
#define MFRAME_SMALL_STRUCT 0
#define MFRAME_ARGS_SIZE 104
#define MFRAME_RESULT_SIZE 16
#define MFRAME_FLT_IN_FRAME_AS_DBL 0
/*
* Structures are passed by reference as an invisible first argument, so
* they go in the first space on the stack.
*/
#define MFRAME_GET_STRUCT_ADDR(ARGS, TYPES) \
((*(TYPES)==_C_STRUCT_B || *(TYPES)==_C_UNION_B || *(TYPES)==_C_ARY_B) ? \
*(void**)(ARGS) : (void*)0)
#define MFRAME_SET_STRUCT_ADDR(ARGS, TYPES, ADDR) \
({if (*(TYPES)==_C_STRUCT_B || *(TYPES)==_C_UNION_B || *(TYPES)==_C_ARY_B) \
*(void**)(ARGS) = (ADDR);})
/*
* Declare a type for keeping track of the arguments processed.
*/
typedef int MFRAME_ARGS;
/*
* Initialize a variable to keep track of argument info while processing a
* method. Keeps count of the offset of arguments on the stack.
* This offset is adjusted to take account of an invisible first argument
* used to return structures.
*/
#define MFRAME_INIT_ARGS(CUM, RTYPE) \
({ \
(CUM) = \
((*(RTYPE)==_C_STRUCT_B || *(RTYPE)==_C_UNION_B || *(RTYPE)==_C_ARY_B) ? \
sizeof(void*) : 0); \
})
#define MFRAME_ARG_ENCODING(CUM, TYPE, STACK, DEST) \
({ \
const char* type = (TYPE); \
int align, size; \
\
(TYPE) = objc_skip_typespec(type); \
align = objc_alignof_type (type); \
size = objc_sizeof_type (type); \
\
(CUM) = ROUND ((CUM), align); \
sprintf((DEST), "%.*s%d", (TYPE)-type, type, (CUM)); \
(STACK) = (CUM) + size; \
(CUM) += ROUND(size, sizeof(void*)); \
(DEST)=&(DEST)[strlen(DEST)]; \
if (*(TYPE) == '+') \
{ \
(TYPE)++; \
} \
while (isdigit(*(TYPE))) \
{ \
(TYPE)++; \
} \
})