On Dec 6, 2013, at 5:40 AM, Umesh Kalappa <umesh.kalap...@gmail.com> wrote:
> 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 As Richard mentioned, SImode is not "the mode for int" but rather "the mode for the type that's 4x the size of QImode". So in your case, that would be the mode for "long" and HImode is the mode for "int". Apart from the float and double sizes, what you describe is just like the pdp11 target. And indeed that target has int == HImode as expected. paul