From: Chung-Ju Wu Date: Fri, 17 Nov 2017 04:36:01 +0000 (+0000) Subject: Add nds32 vector modes. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=3d7f09de5a5a4e74fdc25d8f7e2756410383d149;p=gcc.git Add nds32 vector modes. gcc/ * config/nds32/nds32-modes.def: Add vector mode V4QI V2HI V8QI V4HI V2SI. * config/nds32/iterators.md: Add vector mode iterators and attributes. Co-Authored-By: Kito Cheng From-SVN: r254853 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 2b4bd57d180..549f9f23a9a 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2017-11-17 Chung-Ju Wu + Kito Cheng + + * 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 * config/rs6000/mmintrin.h (_mm_add_pi32[_ARCH_PWR]): Correct diff --git a/gcc/config/nds32/iterators.md b/gcc/config/nds32/iterators.md index 0a8f5aeb5ce..fce5ab66ab6 100644 --- a/gcc/config/nds32/iterators.md +++ b/gcc/config/nds32/iterators.md @@ -26,12 +26,24 @@ ;; 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. @@ -39,8 +51,11 @@ (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. diff --git a/gcc/config/nds32/nds32-modes.def b/gcc/config/nds32/nds32-modes.def index 295a7096704..6e76dd2834c 100644 --- a/gcc/config/nds32/nds32-modes.def +++ b/gcc/config/nds32/nds32-modes.def @@ -18,4 +18,6 @@ along with GCC; see the file COPYING3. If not see . */ -/* 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 */