+2017-11-17 Chung-Ju Wu <jasonwucj@gmail.com>
+ Kito Cheng <kito.cheng@gmail.com>
+
+ * config/nds32/nds32-modes.def: Add vector mode V4QI V2HI V8QI V4HI
+ V2SI.
+ * config/nds32/iterators.md: Add vector mode iterators and attributes.
+
2017-11-16 Steven Munroe <munroesj@gcc.gnu.org>
* config/rs6000/mmintrin.h (_mm_add_pi32[_ARCH_PWR]): Correct
;; A list of integer modes that are up to one word long.
(define_mode_iterator QIHISI [QI HI SI])
+;; A list of integer modes for one word and double word.
+(define_mode_iterator SIDI [SI DI])
+
;; A list of integer modes that are up to one half-word long.
(define_mode_iterator QIHI [QI HI])
;; A list of the modes that are up to double-word long.
(define_mode_iterator DIDF [DI DF])
+;; A list of the modes that are up to one word long vector.
+(define_mode_iterator VQIHI [V4QI V2HI])
+
+;; A list of the modes that are up to one word long vector
+;; and scalar for varies mode.
+(define_mode_iterator VSHI [V2HI HI])
+(define_mode_iterator VSQIHI [V4QI V2HI QI HI])
+(define_mode_iterator VSQIHIDI [V4QI V2HI QI HI DI])
+(define_mode_iterator VQIHIDI [V4QI V2HI DI])
;;----------------------------------------------------------------------------
;; Mode attributes.
(define_mode_attr size [(QI "b") (HI "h") (SI "w")])
-(define_mode_attr byte [(QI "1") (HI "2") (SI "4")])
+(define_mode_attr byte [(QI "1") (HI "2") (SI "4") (V4QI "4") (V2HI "4")])
+
+(define_mode_attr bits [(V4QI "8") (QI "8") (V2HI "16") (HI "16") (DI "64")])
+(define_mode_attr VELT [(V4QI "QI") (V2HI "HI")])
;;----------------------------------------------------------------------------
;; Code iterators.
along with GCC; see the file COPYING3. If not see
<http://www.gnu.org/licenses/>. */
-/* So far, there is no need to define any modes for nds32 target. */
+/* Vector modes. */
+VECTOR_MODES (INT, 4); /* V4QI V2HI */
+VECTOR_MODES (INT, 8); /* V8QI V4HI V2SI */