diff options
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/config/aarch64/iterators.md | 60 | ||||
-rw-r--r-- | gcc/doc/md.texi | 13 | ||||
-rw-r--r-- | gcc/read-rtl.cc | 21 |
3 files changed, 47 insertions, 47 deletions
diff --git a/gcc/config/aarch64/iterators.md b/gcc/config/aarch64/iterators.md index 1593a8f..a920de9 100644 --- a/gcc/config/aarch64/iterators.md +++ b/gcc/config/aarch64/iterators.md @@ -106,7 +106,7 @@ (define_mode_iterator DREG [V8QI V4HI V4HF V2SI V2SF DF]) ;; Copy of the above. -(define_mode_iterator DREG2 [V8QI V4HI V4HF V2SI V2SF DF]) +(define_mode_iterator DREG2 [DREG]) ;; Advanced SIMD modes for integer divides. (define_mode_iterator VQDIV [V4SI V2DI]) @@ -124,7 +124,7 @@ (define_mode_iterator VQ [V16QI V8HI V4SI V2DI V8HF V4SF V2DF V8BF]) ;; Copy of the above. -(define_mode_iterator VQ2 [V16QI V8HI V4SI V2DI V8HF V8BF V4SF V2DF]) +(define_mode_iterator VQ2 [VQ]) ;; Quad vector modes suitable for moving. Includes BFmode. (define_mode_iterator VQMOV [V16QI V8HI V4SI V2DI V8HF V8BF V4SF V2DF]) @@ -320,21 +320,13 @@ (define_mode_iterator TX [TI TF TD]) ;; Duplicate of the above -(define_mode_iterator TX2 [TI TF TD]) +(define_mode_iterator TX2 [TX]) (define_mode_iterator VTX [TI TF TD V16QI V8HI V4SI V2DI V8HF V4SF V2DF V8BF]) ;; Advanced SIMD opaque structure modes. (define_mode_iterator VSTRUCT [OI CI XI]) -;; Advanced SIMD 64-bit vector structure modes. -(define_mode_iterator VSTRUCT_D [V2x8QI V2x4HI V2x2SI V2x1DI - V2x4HF V2x2SF V2x1DF V2x4BF - V3x8QI V3x4HI V3x2SI V3x1DI - V3x4HF V3x2SF V3x1DF V3x4BF - V4x8QI V4x4HI V4x2SI V4x1DI - V4x4HF V4x2SF V4x1DF V4x4BF]) - ;; Advanced SIMD 64-bit 2-vector structure modes. (define_mode_iterator VSTRUCT_2D [V2x8QI V2x4HI V2x2SI V2x1DI V2x4HF V2x2SF V2x1DF V2x4BF]) @@ -347,6 +339,9 @@ (define_mode_iterator VSTRUCT_4D [V4x8QI V4x4HI V4x2SI V4x1DI V4x4HF V4x2SF V4x1DF V4x4BF]) +;; Advanced SIMD 64-bit vector structure modes. +(define_mode_iterator VSTRUCT_D [VSTRUCT_2D VSTRUCT_3D VSTRUCT_4D]) + ;; Advanced SIMD 64-bit 2-vector structure modes minus V2x1DI and V2x1DF. (define_mode_iterator VSTRUCT_2DNX [V2x8QI V2x4HI V2x2SI V2x4HF V2x2SF V2x4BF]) @@ -371,14 +366,6 @@ ;; Advanced SIMD 64-bit 4-vector structure modes with 64-bit elements. (define_mode_iterator VSTRUCT_4DX [V4x1DI V4x1DF]) -;; Advanced SIMD 128-bit vector structure modes. -(define_mode_iterator VSTRUCT_Q [V2x16QI V2x8HI V2x4SI V2x2DI - V2x8HF V2x4SF V2x2DF V2x8BF - V3x16QI V3x8HI V3x4SI V3x2DI - V3x8HF V3x4SF V3x2DF V3x8BF - V4x16QI V4x8HI V4x4SI V4x2DI - V4x8HF V4x4SF V4x2DF V4x8BF]) - ;; Advanced SIMD 128-bit 2-vector structure modes. (define_mode_iterator VSTRUCT_2Q [V2x16QI V2x8HI V2x4SI V2x2DI V2x8HF V2x4SF V2x2DF V2x8BF]) @@ -391,49 +378,32 @@ (define_mode_iterator VSTRUCT_4Q [V4x16QI V4x8HI V4x4SI V4x2DI V4x8HF V4x4SF V4x2DF V4x8BF]) +;; Advanced SIMD 128-bit vector structure modes. +(define_mode_iterator VSTRUCT_Q [VSTRUCT_2Q VSTRUCT_3Q VSTRUCT_4Q]) + ;; Advanced SIMD 2-vector structure modes. -(define_mode_iterator VSTRUCT_2QD [V2x8QI V2x4HI V2x2SI V2x1DI - V2x4HF V2x2SF V2x1DF V2x4BF - V2x16QI V2x8HI V2x4SI V2x2DI - V2x8HF V2x4SF V2x2DF V2x8BF]) +(define_mode_iterator VSTRUCT_2QD [VSTRUCT_2D VSTRUCT_2Q]) ;; Advanced SIMD 3-vector structure modes. -(define_mode_iterator VSTRUCT_3QD [V3x8QI V3x4HI V3x2SI V3x1DI - V3x4HF V3x2SF V3x1DF V3x4BF - V3x16QI V3x8HI V3x4SI V3x2DI - V3x8HF V3x4SF V3x2DF V3x8BF]) +(define_mode_iterator VSTRUCT_3QD [VSTRUCT_3D VSTRUCT_3Q]) ;; Advanced SIMD 4-vector structure modes. -(define_mode_iterator VSTRUCT_4QD [V4x8QI V4x4HI V4x2SI V4x1DI - V4x4HF V4x2SF V4x1DF V4x4BF - V4x16QI V4x8HI V4x4SI V4x2DI - V4x8HF V4x4SF V4x2DF V4x8BF]) +(define_mode_iterator VSTRUCT_4QD [VSTRUCT_4D VSTRUCT_4Q]) ;; Advanced SIMD vector structure modes. -(define_mode_iterator VSTRUCT_QD [V2x8QI V2x4HI V2x2SI V2x1DI - V2x4HF V2x2SF V2x1DF V2x4BF - V3x8QI V3x4HI V3x2SI V3x1DI - V3x4HF V3x2SF V3x1DF V3x4BF - V4x8QI V4x4HI V4x2SI V4x1DI - V4x4HF V4x2SF V4x1DF V4x4BF - V2x16QI V2x8HI V2x4SI V2x2DI - V2x8HF V2x4SF V2x2DF V2x8BF - V3x16QI V3x8HI V3x4SI V3x2DI - V3x8HF V3x4SF V3x2DF V3x8BF - V4x16QI V4x8HI V4x4SI V4x2DI - V4x8HF V4x4SF V4x2DF V4x8BF]) +(define_mode_iterator VSTRUCT_QD [VSTRUCT_D VSTRUCT_Q]) ;; Double scalar modes (define_mode_iterator DX [DI DF DD]) ;; Duplicate of the above -(define_mode_iterator DX2 [DI DF DD]) +(define_mode_iterator DX2 [DX]) ;; Single scalar modes (define_mode_iterator SX [SI SF]) ;; Duplicate of the above -(define_mode_iterator SX2 [SI SF]) +(define_mode_iterator SX2 [SX]) ;; Single and double integer and float modes (define_mode_iterator DSX [DF DI SF SI]) diff --git a/gcc/doc/md.texi b/gcc/doc/md.texi index a5c1d1f..5d86152 100644 --- a/gcc/doc/md.texi +++ b/gcc/doc/md.texi @@ -11797,6 +11797,19 @@ to @code{@var{mode}}. For example: means that the @code{:DI} expansion only applies if @code{TARGET_64BIT} but that the @code{:SI} expansion has no such constraint. +It is also possible to include iterators in other iterators. For example: + +@smallexample +(define_mode_iterator VI [V16QI V8HI V4SI V2DI]) +(define_mode_iterator VF [V8HF V4SF (V2DF "TARGET_DOUBLE")]) +(define_mode_iterator V [VI (VF "TARGET_FLOAT")]) +@end smallexample + +makes @samp{:V} iterate over the modes in @code{VI} and the modes +in @code{VF}. When a construct uses @samp{:V}, the @code{V8HF} and +@code{V4SF} expansions require @samp{TARGET_FLOAT} while the @code{V2DF} +expansion requires @samp{TARGET_DOUBLE && TARGET_FLOAT}. + Iterators are applied in the order they are defined. This can be significant if two iterators are used in a construct that requires substitutions. @xref{Substitutions}. diff --git a/gcc/read-rtl.cc b/gcc/read-rtl.cc index f3b5613..00bf4ab 100644 --- a/gcc/read-rtl.cc +++ b/gcc/read-rtl.cc @@ -1293,8 +1293,25 @@ md_reader::read_mapping (struct iterator_group *group, htab_t table) string = read_string (false); require_char_ws (')'); } - number = group->find_builtin (name.string); - end_ptr = add_map_value (end_ptr, number, string); + auto *subm = (struct mapping *) htab_find (group->iterators, + &name.string); + if (subm) + { + if (m == subm) + fatal_with_file_and_line ("recursive definition of `%s'", + name.string); + for (map_value *v = subm->values; v; v = v->next) + { + auto *joined = rtx_reader_ptr->join_c_conditions (v->string, + string); + end_ptr = add_map_value (end_ptr, v->number, joined); + } + } + else + { + number = group->find_builtin (name.string); + end_ptr = add_map_value (end_ptr, number, string); + } c = read_skip_spaces (); } while (c != ']'); |