self@BAYES.ARC.NASA.GOV (Matthew Self) (11/17/88)
In gcc.texinfo (1.30), it states: > The only modes which a machine description must support are QImode, > SImode, SFmode and DFmode. The compiler will attempt to use DImode > for two-word structures and unions, but it would not be hard to > program it to avoid this. Likewise, you can arrange for the C type > short int to avoid using HImode. In the long term it would be > desirable to make the set of available machine modes machine-dependent > and eliminate all assumptions about specific machine modes or their > uses from the machine-independent code of the compiler. How far has this program been carried out? I am considering a port to a machine where most registers are 24 bits wide but the smallest addressable unit of memory is 48 bits wide. It is possible to load the left and right halves of these units individually (with different instructions, not different addresses), and there are no instructions for addressing bytes. I initially intend to support 24 and 48 bit ints, 24 and 48 bit floats and 24 bit chars (I may pack these later). I don't understand how I tell gcc my plan in its current set-up. Am I free to make QImode be 24 bits wide? What assumptions is gcc making about the relationships between machine modes? Does it assume that HImode is exactly twice as big as QImode, for example? This may be way off base, but I would have thought rtl should be generated without reference to machine-dependent modes. Rather it should refer to machine-independent (i.e. c) modes, like unsigned short, etc. It would then be up to the machine description to determine the mapping between c modes and machine modes. Basically, I suspect this port is weird enough that it is going to require changes to gcc as well as just writing a machine description. I want any such changes to be made in a positive direction, so as to ease future weird ports. All input is appreciated, Matthew Self NASA Ames Research Center self@bayes.arc.nasa.gov P.S. Should discussions go on info-gcc instead?