gccint: Defining Mode Iterators

1 
1 17.23.1.1 Defining Mode Iterators
1 .................................
1 
1 The syntax for defining a mode iterator is:
1 
1      (define_mode_iterator NAME [(MODE1 "COND1") ... (MODEN "CONDN")])
1 
1  This allows subsequent '.md' file constructs to use the mode suffix
1 ':NAME'.  Every construct that does so will be expanded N times, once
1 with every use of ':NAME' replaced by ':MODE1', once with every use
1 replaced by ':MODE2', and so on.  In the expansion for a particular
1 MODEI, every C condition will also require that CONDI be true.
1 
1  For example:
1 
1      (define_mode_iterator P [(SI "Pmode == SImode") (DI "Pmode == DImode")])
1 
1  defines a new mode suffix ':P'.  Every construct that uses ':P' will be
1 expanded twice, once with every ':P' replaced by ':SI' and once with
1 every ':P' replaced by ':DI'.  The ':SI' version will only apply if
1 'Pmode == SImode' and the ':DI' version will only apply if 'Pmode ==
1 DImode'.
1 
1  As with other '.md' conditions, an empty string is treated as "always
1 true".  '(MODE "")' can also be abbreviated to 'MODE'.  For example:
1 
1      (define_mode_iterator GPR [SI (DI "TARGET_64BIT")])
1 
1  means that the ':DI' expansion only applies if 'TARGET_64BIT' but that
1 the ':SI' expansion has no such constraint.
1 
1  Iterators are applied in the order they are defined.  This can be
1 significant if two iterators are used in a construct that requires
1 substitutions.  ⇒Substitutions.
1