Quoting paul_kon...@dell.com:

It would seem that making it equal to word size (whatever that is on the platform) or size of the int type would be a way to make this better. Would that have any bad consequences for other platforms?

For MXP (16-bit word addressed, with 128 bit vector registers) I had this:

2008-04-25  J"orn Rennecke  <joern.renne...@arc.com>
        * genmodes.c (vector_class):
        (complete_mode): Allow bytesize to have been set for MODE_CC.


     case MODE_CC:
       /* Again, nothing more need be said.  For historical reasons,
-        the size of a CC mode is four units.  */
-      validate_mode (m, UNSET, UNSET, UNSET, UNSET, UNSET);
+        the size of a CC mode defaults to four units.  */
+      if (m->bytesize != blank_mode.bytesize)
+       validate_mode (m, UNSET, SET, UNSET, UNSET, UNSET);
+      else
+       {
+         validate_mode (m, UNSET, UNSET, UNSET, UNSET, UNSET);
+         m->bytesize = 4;
+       }

-      m->bytesize = 4;
       m->ncomponents = 1;
       m->component = 0;
       break;
Then there was also:

ChangeLog.ARC:  (SIZED_CC_MODE): New macro.
genmodes.c:#define SIZED_CC_MODE(N, Y) (CC_MODE (N)->bytesize = (Y))

Of course, MXP needed a few more patches to support MODE_VECTOR_PARTIAL_INT
and MODE_VECTOR_CC modes.

In mxp-modes.def, I had then:

VECTOR_MODES (INT, 4); /* V4QI V2HI */
VECTOR_MODES (INT, 8); /* V8QI V4HI V2SI */
VECTOR_MODES (INT, 16); /* V16QI V8HI V4SI V2DI */
PARTIAL_INT_MODE (SI);  /* Needed to make V2PSI / V4PSI.  */
VECTOR_MODE (PARTIAL_INT, PSI, 2); /* V2PSI, flags for DImode arithmetic. */
VECTOR_MODE (PARTIAL_INT, PSI, 4); /* V4PSI, flags for V2DImode arithmetic. */
VECTOR_MODES (FLOAT, 8); /* V2SF */
VECTOR_MODES (FLOAT, 16); /* V4SF V2DF */
#define CC_MODES(N) SIZED_CC_MODE (N, 2); \
  VECTOR_MODE (CC, N, 2); VECTOR_MODE (CC, N, 4); VECTOR_MODE (CC, N, 8)
CC_MODES (CCI); /* Ordinary integer flags.  */
CC_MODES (CCZN); /* Only zero / negative flag relevant.  */
CC_MODES (CCZ); /* Only zero flag relevant.  */
VECTOR_MODE (CC, CC, 2); /* V2CCmode - flag clobber for DI arithmetic.  */
VECTOR_MODE (CC, CC, 4); /* V4CCmode - flag clobber for V2DI arithmetic.  */

Reply via email to