> Gabriel Dos Reis <gdr at integrable-solutions dot net>
>| J Delorie <dj at redhat dot com> writes:
>| And the target can do this in tm.c:
>| 
>|       class machine_mode SImode ("SI", 32);
>|       class machine_mode V4QImode ("V4QI", 8, 0, 8, 4);
>| 
>| Then, the MI parts can obtain a mode with certain characteristics,
>| enumerate available modes, and get info about a given mode, but don't
>| have a compile-time identifier for a "well-known named" mode.
>
> I like it.
>
> However, that is orthogonal to changing the plain numeric value "0" to
> the named constant with current machinery, don't you believe?

Might it be more desirable for the compiler's code to only refer to target
"type" modes as opposed to "size" modes? Thereby avoiding the temptation to
incorrectly assume that any particular "size" mode, like SImode corresponds
to the targets int or int* mode for example?

Thereby the compiler's code should only refer to "type" modes:

  target_unit_mode:
  target_word_mode:
  target_vect_mode:

  target_char_mode;
  target_short_mode;
  target_int_mode;
  target_ptr_mode;
  target_long_mode:
  target_long_long_mode
  ...

Where then the target then defines their corresponding "size" modes:

  class machine_mode target_unit_mode ("QI", 8);
  class machine_mode target_word_mode ("HI", 16);
  class machine_mode target_vect_mode ("SI", 32);

  class machine_mode target_char_mode ("QI", 8);
  class machine_mode target_short_mode ("HI",16);
  class machine_mode target_int_mode ("HI", 32);
  class machine_mode target_ptr_mode ("HI", 16);
  class machine_mode target_long_mode ("SI", 32);
  class machine_mode target_long_long_mode ("SI", 32);
  ...


Reply via email to