1 ;; Machine Description for shared bits common to IWMMXT and Neon.
2 ;; Copyright (C) 2006 Free Software Foundation, Inc.
3 ;; Written by CodeSourcery.
5 ;; This file is part of GCC.
7 ;; GCC is free software; you can redistribute it and/or modify it
8 ;; under the terms of the GNU General Public License as published by
9 ;; the Free Software Foundation; either version 2, or (at your option)
12 ;; GCC is distributed in the hope that it will be useful, but
13 ;; WITHOUT ANY WARRANTY; without even the implied warranty of
14 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 ;; General Public License for more details.
17 ;; You should have received a copy of the GNU General Public License
18 ;; along with GCC; see the file COPYING. If not, write to the Free
19 ;; Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA
24 ;; All integer and float modes supported by Neon and IWMMXT.
25 (define_mode_macro VALL [V2DI V2SI V4HI V8QI V2SF V4SI V8HI V16QI V4SF])
27 ;; All integer and float modes supported by Neon and IWMMXT, except V2DI.
28 (define_mode_macro VALLW [V2SI V4HI V8QI V2SF V4SI V8HI V16QI V4SF])
30 ;; All integer modes supported by Neon and IWMMXT
31 (define_mode_macro VINT [V2DI V2SI V4HI V8QI V4SI V8HI V16QI])
33 ;; All integer modes supported by Neon and IWMMXT, except V2DI
34 (define_mode_macro VINTW [V2SI V4HI V8QI V4SI V8HI V16QI])
36 (define_expand "mov<mode>"
37 [(set (match_operand:VALL 0 "nonimmediate_operand" "")
38 (match_operand:VALL 1 "general_operand" ""))]
40 || (TARGET_REALLY_IWMMXT && VALID_IWMMXT_REG_MODE (<MODE>mode))"
44 ;; Vector arithmetic. Expanders are blank, then unnamed insns implement
45 ;; patterns separately for IWMMXT and Neon.
47 (define_expand "add<mode>3"
48 [(set (match_operand:VALL 0 "s_register_operand" "")
49 (plus:VALL (match_operand:VALL 1 "s_register_operand" "")
50 (match_operand:VALL 2 "s_register_operand" "")))]
52 || (TARGET_REALLY_IWMMXT && VALID_IWMMXT_REG_MODE (<MODE>mode))"
56 (define_expand "sub<mode>3"
57 [(set (match_operand:VALL 0 "s_register_operand" "")
58 (minus:VALL (match_operand:VALL 1 "s_register_operand" "")
59 (match_operand:VALL 2 "s_register_operand" "")))]
61 || (TARGET_REALLY_IWMMXT && VALID_IWMMXT_REG_MODE (<MODE>mode))"
65 (define_expand "mul<mode>3"
66 [(set (match_operand:VALLW 0 "s_register_operand" "")
67 (mult:VALLW (match_operand:VALLW 1 "s_register_operand" "")
68 (match_operand:VALLW 2 "s_register_operand" "")))]
69 "TARGET_NEON || (<MODE>mode == V4HImode && TARGET_REALLY_IWMMXT)"
73 (define_expand "smin<mode>3"
74 [(set (match_operand:VALLW 0 "s_register_operand" "")
75 (smin:VALLW (match_operand:VALLW 1 "s_register_operand" "")
76 (match_operand:VALLW 2 "s_register_operand" "")))]
78 || (TARGET_REALLY_IWMMXT && VALID_IWMMXT_REG_MODE (<MODE>mode))"
82 (define_expand "umin<mode>3"
83 [(set (match_operand:VINTW 0 "s_register_operand" "")
84 (umin:VINTW (match_operand:VINTW 1 "s_register_operand" "")
85 (match_operand:VINTW 2 "s_register_operand" "")))]
87 || (TARGET_REALLY_IWMMXT && VALID_IWMMXT_REG_MODE (<MODE>mode))"
91 (define_expand "smax<mode>3"
92 [(set (match_operand:VALLW 0 "s_register_operand" "")
93 (smax:VALLW (match_operand:VALLW 1 "s_register_operand" "")
94 (match_operand:VALLW 2 "s_register_operand" "")))]
96 || (TARGET_REALLY_IWMMXT && VALID_IWMMXT_REG_MODE (<MODE>mode))"
100 (define_expand "umax<mode>3"
101 [(set (match_operand:VINTW 0 "s_register_operand" "")
102 (umax:VINTW (match_operand:VINTW 1 "s_register_operand" "")
103 (match_operand:VINTW 2 "s_register_operand" "")))]
105 || (TARGET_REALLY_IWMMXT && VALID_IWMMXT_REG_MODE (<MODE>mode))"