Hi, all, This is the preparation for future nds32 vector implementation.
Committed as Rev.254853: http://gcc.gnu.org/r254853 gcc/ * config/nds32/nds32-modes.def: Add vector mode V4QI V2HI V8QI V4HI V2SI. * config/nds32/iterators.md: Add vector mode iterators and attributes. Best regards, jasonwucj
>From 61acc7f622e563d6b46e45b26ba1f03dcb61dcb5 Mon Sep 17 00:00:00 2001 From: Chung-Ju Wu <jason...@easystack.cn> Date: Sun, 12 Nov 2017 16:18:39 +0800 Subject: [PATCH 5/7] Add nds32 vector modes. --- gcc/config/nds32/iterators.md | 17 ++++++++++++++++- gcc/config/nds32/nds32-modes.def | 4 +++- 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/gcc/config/nds32/iterators.md b/gcc/config/nds32/iterators.md index 0a8f5ae..fce5ab6 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 295a709..6e76dd2 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 <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 */ -- 1.8.3.1