This is the mail archive of the gcc@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]

Make SImode as default mode for INT type.


Hi all,

We are re-targeting the gcc 4.8.1 to the 16 bit core ,where word =int
= short = pointer= 16 , char = 8 bit  and long  =32 bit.

We model the above requirement as

#define BITS_PER_UNIT           8

#define BITS_PER_WORD           16

#define UNITS_PER_WORD          2

#define POINTER_SIZE            16

#define SHORT_TYPE_SIZE         16

#define INT_TYPE_SIZE           16

#define LONG_TYPE_SIZE          32

#define FLOAT_TYPE_SIZE         16

#define DOUBLE_TYPE_SIZE        32

Tried to compile the below sample by retargeted compiler

int a =10;

int b =10;


int func()

{

 return a+ b;

}

the compiler is stating that the a and b are global with short type(HI
mode) of size 2 bytes.

where as we  need the word mode as SI not HI ,I do understand that the
SI and HI modes are of  same size but till I insist  better to have SI
mode.

Please somebody or expert in the  group  share their thought on the
same  like how do we can achieve this ?

Thanks
~Umesh


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