aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorChung-Ju Wu <jasonwucj@gmail.com>2017-11-17 04:36:01 +0000
committerChung-Ju Wu <jasonwucj@gcc.gnu.org>2017-11-17 04:36:01 +0000
commit3d7f09de5a5a4e74fdc25d8f7e2756410383d149 (patch)
treeb1e352e8a4b0b0f7e3738c70993f52ab26644a83 /gcc
parentdc8d52b14599692fc2868be9a29bbeff0cc5117a (diff)
downloadgcc-3d7f09de5a5a4e74fdc25d8f7e2756410383d149.zip
gcc-3d7f09de5a5a4e74fdc25d8f7e2756410383d149.tar.gz
gcc-3d7f09de5a5a4e74fdc25d8f7e2756410383d149.tar.bz2
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 <kito.cheng@gmail.com> From-SVN: r254853
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog7
-rw-r--r--gcc/config/nds32/iterators.md17
-rw-r--r--gcc/config/nds32/nds32-modes.def4
3 files changed, 26 insertions, 2 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 2b4bd57..549f9f2 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,10 @@
+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
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 */