From ec8e39498ba9fd7effa6700351503798e1dd61a2 Mon Sep 17 00:00:00 2001 From: jasonwucj Date: Fri, 17 Nov 2017 04:36:01 +0000 Subject: [PATCH] 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@254853 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/ChangeLog | 7 +++++++ gcc/config/nds32/iterators.md | 17 ++++++++++++++++- gcc/config/nds32/nds32-modes.def | 4 +++- 3 files changed, 26 insertions(+), 2 deletions(-) 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 */ -- 2.11.4.GIT