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]

AVR -mint8 option patch checkin


Hi,

It seems I forgot about this patch. It has been approved once already. The original mail is here:

http://gcc.gnu.org/ml/gcc-patches/2002-11/msg01502.html

and the approval here:

http://gcc.gnu.org/ml/gcc-patches/2003-06/msg00351.html

I have updated the patch and added its documentation. If there are no objections I will act on the old approval and go ahead and check this into gcc (HEAD).

Can I please check this into the gcc-3_4-branch as well? This is a feature people have been waiting for, and adding this into 3.4 will certainly give it to them earlier.

Included is the patch for both HEAD and for the 3.4 branch.

gcc/ChangeLog:
2004-05-12  Svein E. Seldal  <Svein.Seldal@solidas.com>

      * config/avr/avr.h (LONG_LONG_TYPE_SIZE): Changed long long type
      to support 32-bit -mint8 mode.
      * doc/invoke.texi (-mint8): Added documentation for the -mint8
      option in the AVR architecture.

Regards,
Svein

Index: config/avr/avr.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/avr/avr.h,v
retrieving revision 1.95.4.2
diff -c -3 -p -r1.95.4.2 avr.h
*** config/avr/avr.h	9 Mar 2004 02:59:55 -0000	1.95.4.2
--- config/avr/avr.h	12 May 2004 09:33:28 -0000
*************** extern int avr_asm_only_p;
*** 198,204 ****
     used in `cpp'.  */
  
  
! #define LONG_LONG_TYPE_SIZE 64
  /* 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
--- 198,204 ----
     used in `cpp'.  */
  
  
! #define LONG_LONG_TYPE_SIZE (INT_TYPE_SIZE == 8 ? 32 : 64)
  /* 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
Index: doc/invoke.texi
===================================================================
RCS file: /cvs/gcc/gcc/gcc/doc/invoke.texi,v
retrieving revision 1.390.2.27
diff -c -3 -p -r1.390.2.27 invoke.texi
*** doc/invoke.texi	30 Apr 2004 16:43:48 -0000	1.390.2.27
--- doc/invoke.texi	12 May 2004 09:32:34 -0000
*************** in the following sections.
*** 583,589 ****
  
  @emph{AVR Options}
  @gccoptlist{-mmcu=@var{mcu}  -msize  -minit-stack=@var{n}  -mno-interrupts @gol
! -mcall-prologues  -mno-tablejump  -mtiny-stack}
  
  @emph{MCore Options}
  @gccoptlist{-mhardlit  -mno-hardlit  -mdiv  -mno-div  -mrelax-immediates @gol
--- 583,589 ----
  
  @emph{AVR Options}
  @gccoptlist{-mmcu=@var{mcu}  -msize  -minit-stack=@var{n}  -mno-interrupts @gol
! -mcall-prologues  -mno-tablejump  -mtiny-stack  -mint8}
  
  @emph{MCore Options}
  @gccoptlist{-mhardlit  -mno-hardlit  -mdiv  -mno-div  -mrelax-immediates @gol
*************** Do not generate tablejump insns which so
*** 9854,9859 ****
--- 9854,9867 ----
  @item -mtiny-stack
  @opindex mtiny-stack
  Change only the low 8 bits of the stack pointer.
+ 
+ @item -mint8
+ @opindex mint8
+ Assume int to be 8 bit integer. This affects the sizes of all types: A
+ char will be 1 byte, an int will be 1 byte, an long will be 2 bytes
+ and long long will be 4 bytes. Please note that this option does not
+ comply to the C standards, but it will provide you with smaller code
+ size.
  @end table
  
  @node MCore Options
Index: config/avr/avr.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/avr/avr.h,v
retrieving revision 1.102
diff -c -3 -p -r1.102 avr.h
*** config/avr/avr.h	7 Feb 2004 17:06:19 -0000	1.102
--- config/avr/avr.h	12 May 2004 07:54:34 -0000
*************** extern int avr_asm_only_p;
*** 142,148 ****
  #define INT_TYPE_SIZE (TARGET_INT8 ? 8 : 16)
  #define SHORT_TYPE_SIZE (INT_TYPE_SIZE == 8 ? INT_TYPE_SIZE : 16)
  #define LONG_TYPE_SIZE (INT_TYPE_SIZE == 8 ? 16 : 32)
! #define LONG_LONG_TYPE_SIZE 64
  #define FLOAT_TYPE_SIZE 32
  #define DOUBLE_TYPE_SIZE 32
  #define LONG_DOUBLE_TYPE_SIZE 32
--- 142,148 ----
  #define INT_TYPE_SIZE (TARGET_INT8 ? 8 : 16)
  #define SHORT_TYPE_SIZE (INT_TYPE_SIZE == 8 ? INT_TYPE_SIZE : 16)
  #define LONG_TYPE_SIZE (INT_TYPE_SIZE == 8 ? 16 : 32)
! #define LONG_LONG_TYPE_SIZE (INT_TYPE_SIZE == 8 ? 32 : 64)
  #define FLOAT_TYPE_SIZE 32
  #define DOUBLE_TYPE_SIZE 32
  #define LONG_DOUBLE_TYPE_SIZE 32
Index: doc/invoke.texi
===================================================================
RCS file: /cvs/gcc/gcc/gcc/doc/invoke.texi,v
retrieving revision 1.459
diff -c -3 -p -r1.459 invoke.texi
*** doc/invoke.texi	6 May 2004 16:10:25 -0000	1.459
--- doc/invoke.texi	12 May 2004 09:31:40 -0000
*************** in the following sections.
*** 576,582 ****
  
  @emph{AVR Options}
  @gccoptlist{-mmcu=@var{mcu}  -msize  -minit-stack=@var{n}  -mno-interrupts @gol
! -mcall-prologues  -mno-tablejump  -mtiny-stack}
  
  @emph{MCore Options}
  @gccoptlist{-mhardlit  -mno-hardlit  -mdiv  -mno-div  -mrelax-immediates @gol
--- 576,582 ----
  
  @emph{AVR Options}
  @gccoptlist{-mmcu=@var{mcu}  -msize  -minit-stack=@var{n}  -mno-interrupts @gol
! -mcall-prologues  -mno-tablejump  -mtiny-stack  -mint8}
  
  @emph{MCore Options}
  @gccoptlist{-mhardlit  -mno-hardlit  -mdiv  -mno-div  -mrelax-immediates @gol
*************** Do not generate tablejump insns which so
*** 9957,9962 ****
--- 9957,9970 ----
  @item -mtiny-stack
  @opindex mtiny-stack
  Change only the low 8 bits of the stack pointer.
+ 
+ @item -mint8
+ @opindex mint8
+ Assume int to be 8 bit integer. This affects the sizes of all types: A
+ char will be 1 byte, an int will be 1 byte, an long will be 2 bytes
+ and long long will be 4 bytes. Please note that this option does not
+ comply to the C standards, but it will provide you with smaller code
+ size.
  @end table
  
  @node MCore Options

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