This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Trying to make a 12 bit compiler gcc3.0.4


I'd like sbdy opinions on my proc.h for the parts
concerning definition of type : 
/* RAM = 12 bits address, ROM = 24 bit address ,
register = 12 bit */

/* Define this if most significant byte of a word is
the lowest numbered. */
#define BITS_BIG_ENDIAN 0

/* Define this if most significant byte of a word is
the lowest numbered. */
#define BYTES_BIG_ENDIAN 0

/* Define this if most significant word of a multiword
number is the lowest
   numbered.  */
#define WORDS_BIG_ENDIAN 0

/* number of bits in an addressable storage unit */
#define BITS_PER_UNIT 12

/* Width in bits of a "word", which is the contents of
a machine register.
   Note that this is not necessarily the width of data
type `int';  */
#define BITS_PER_WORD 24


/* Width of a word, in units (bytes). */
#ifdef IN_LIBGCC2
/* This is to get correct SI and DI modes in libgcc2.c
(32 and 64 bits).  */
#define UNITS_PER_WORD 4
#else
/* Width of a word, in units (bytes). */
#define UNITS_PER_WORD 1	/* Have a try with 2 ?? */
#endif

/*Define this macro if functions should assume that
stack space 
has been allocated for arguments even when their
values are passed in registers. 
The value of this macro is the size, in bytes, of the
area reserved for arguments 
passed in registers for the function represented by
fndecl. 
This space can be allocated by the caller, or be a
part of the machine-dependent stack frame: 
OUTGOING_REG_PARM_STACK_SPACE says which.*/ 
#define REG_PARM_STACK_SPACE(DECL) (4*UNITS_PER_WORD)
/* 4 registre */

/* Width in bits of a pointer.
   See also the macro `Pmode' defined below.  */
#define POINTER_SIZE 24

/* Maximum sized of reasonable data type
   DImode or Dfmode ...  */
#define MAX_FIXED_MODE_SIZE 48

/* Allocation boundary (in *bits*) for storing
arguments in argument list. */
#define PARM_BOUNDARY 12

/* Allocation boundary (in *bits*) for the code of a
function. */
#define FUNCTION_BOUNDARY 12

/* Alignment of field after `int : 0' in a structure.
*/
#define EMPTY_FIELD_BOUNDARY 12	/* And 0 ?*/

/* No data type wants to be aligned rounder than this.
*/
#define BIGGEST_ALIGNMENT 12	/* Well ... */

/* Define this if move instructions will actually fail
to work
   when given unaligned data.  */
#define STRICT_ALIGNMENT 0

/* A C expression for the size in bits of the type
`int' on the
     target machine.  If you don't define this, the
default is one word.  */
#define INT_TYPE_SIZE (TARGET_INT12 ? 12 : 24)

/* A C expression for the size in bits of the type
`short' on the
   target machine.  If you don't define this, the
default is half a
   word.  (If this would be less than one storage
unit, it is rounded
   up to one unit.)  */
#define SHORT_TYPE_SIZE (INT_TYPE_SIZE == 12 ?
INT_TYPE_SIZE : 24)

/* A C expression for the size in bits of the type
`long' on the
   target machine.  If you don't define this, the
default is one word.  */
#define LONG_TYPE_SIZE (INT_TYPE_SIZE == 12 ? 24 : 48)

/* Maximum number for the size in bits of the type
`long' on the
   target machine.  If this is undefined, the default
is
   `LONG_TYPE_SIZE'.  Otherwise, it is the constant
value that is the
   largest value that `LONG_TYPE_SIZE' can have at
run-time.  This is
   used in `cpp'.  */
#define MAX_LONG_TYPE_SIZE 48

#define LONG_LONG_TYPE_SIZE 48
/* A C expression for the size in bits of the type
`long long' on the
   target machine.  If you don't define this, the
default is two
   words.  If you want to support GNU Ada on your
machine, the value
   of macro must be at least 64.  */

#define  CHAR_TYPE_SIZE 12
/* A C expression for the size in bits of the type
`char' on the
   target machine.  If you don't define this, the
default is one
   quarter of a word.  (If this would be less than one
storage unit,
   it is rounded up to one unit.)  */

#define FLOAT_TYPE_SIZE 48
/* A C expression for the size in bits of the type
`float' on the
   target machine.  If you don't define this, the
default is one word.  */

#define DOUBLE_TYPE_SIZE 48
/* A C expression for the size in bits of the type
`double' on the
   target machine.  If you don't define this, the
default is two
   words. */

#define LONG_DOUBLE_TYPE_SIZE 96
/* A C expression for the size in bits of the type
`long double' on
   the target machine.  If you don't define this, the
default is two
   words.  */

#define DEFAULT_SIGNED_CHAR 1
/* An expression whose value is 1 or 0, according to
whether the type
   `char' should be signed or unsigned by default. 
The user can
   always override this default with the options
`-fsigned-char' and
   `-funsigned-char'.  */

/* `DEFAULT_SHORT_ENUMS'
   A C expression to determine whether to give an
`enum' type only as
   many bytes as it takes to represent the range of
possible values
   of that type.  A nonzero value means to do that; a
zero value
   means all `enum' types should be allocated like
`int'.
   If you don't define the macro, the default is 0. 
*/

#define SIZE_TYPE (INT_TYPE_SIZE == 12 ? "long
unsigned int" : "long long unsigned int")
/* A C expression for a string describing the name of
the data type
   to use for size values.  The typedef name `size_t'
is defined
   using the contents of the string.
   
   The string can contain more than one keyword.  If
so, separate
   them with spaces, and write first any length
keyword, then
   `unsigned' if appropriate, and finally `int'.  The
string must
   exactly match one of the data type names defined in
the function
   `init_decl_processing' in the file `c-decl.c'.  You
may not omit
   `int' or change the order--that would cause the
compiler to crash
   on startup.
   
   If you don't define this macro, the default is
`"long unsigned
   int"'.  */

#define PTRDIFF_TYPE (INT_TYPE_SIZE == 12 ? "long"
:"long long")
/* A C expression for a string describing the name of
the data type
   to use for the result of subtracting two pointers. 
The typedef
   name `ptrdiff_t' is defined using the contents of
the string.  See
   `SIZE_TYPE' above for more information.   
   If you don't define this macro, the default is
`"long int"'.  */

#define WCHAR_TYPE_SIZE 24
/* A C expression for the size in bits of the data
type for wide
   characters.  This is used in `cpp', which cannot
make use of
   `WCHAR_TYPE'.  */

Of course this is not comiling, I got a segmentation
fault in tmp-dum.c.
Before changing those code I had previously made an 8
bit compiler that was compiling.
Thanks for all help
Pierre

___________________________________________________________
Do You Yahoo!? -- Une adresse @yahoo.fr gratuite et en français !
Yahoo! Mail : http://fr.mail.yahoo.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]