Home | History | Annotate | Line # | Download | only in arm
      1   1.1  mrg ;; Constraint definitions for ARM and Thumb
      2  1.12  mrg ;; Copyright (C) 2006-2022 Free Software Foundation, Inc.
      3   1.1  mrg ;; Contributed by ARM Ltd.
      4   1.1  mrg 
      5   1.1  mrg ;; This file is part of GCC.
      6   1.1  mrg 
      7   1.1  mrg ;; GCC is free software; you can redistribute it and/or modify it
      8   1.1  mrg ;; under the terms of the GNU General Public License as published
      9   1.1  mrg ;; by the Free Software Foundation; either version 3, or (at your
     10   1.1  mrg ;; option) any later version.
     11   1.1  mrg 
     12   1.1  mrg ;; GCC is distributed in the hope that it will be useful, but WITHOUT
     13   1.1  mrg ;; ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
     14   1.1  mrg ;; or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public
     15   1.1  mrg ;; License for more details.
     16   1.1  mrg 
     17   1.1  mrg ;; You should have received a copy of the GNU General Public License
     18   1.1  mrg ;; along with GCC; see the file COPYING3.  If not see
     19   1.1  mrg ;; <http://www.gnu.org/licenses/>.
     20   1.1  mrg 
     21   1.1  mrg ;; The following register constraints have been used:
     22   1.3  mrg ;; - in ARM/Thumb-2 state: t, w, x, y, z
     23   1.1  mrg ;; - in Thumb state: h, b
     24   1.6  mrg ;; - in both states: l, c, k, q, Cs, Ts, US
     25   1.1  mrg ;; In ARM state, 'l' is an alias for 'r'
     26   1.3  mrg ;; 'f' and 'v' were previously used for FPA and MAVERICK registers.
     27   1.1  mrg 
     28   1.1  mrg ;; The following normal constraints have been used:
     29   1.3  mrg ;; in ARM/Thumb-2 state: G, I, j, J, K, L, M
     30   1.1  mrg ;; in Thumb-1 state: I, J, K, L, M, N, O
     31   1.3  mrg ;; 'H' was previously used for FPA.
     32   1.1  mrg 
     33   1.1  mrg ;; The following multi-letter normal constraints have been used:
     34   1.9  mrg ;; in ARM/Thumb-2 state: Da, Db, Dc, Dd, Dn, DN, Dm, Dl, DL, Do, Dv, Dy, Di,
     35  1.12  mrg ;;			 Ds, Dt, Dp, Dz, Tu, Te
     36   1.3  mrg ;; in Thumb-1 state: Pa, Pb, Pc, Pd, Pe
     37  1.11  mrg ;; in Thumb-2 state: Ha, Pj, PJ, Ps, Pt, Pu, Pv, Pw, Px, Py, Pz, Rd, Rf, Rb, Ra,
     38  1.11  mrg ;;		     Rg, Ri
     39  1.11  mrg ;; in all states: Pf, Pg
     40   1.1  mrg 
     41   1.1  mrg ;; The following memory constraints have been used:
     42  1.11  mrg ;; in ARM/Thumb-2 state: Uh, Ut, Uv, Uy, Un, Um, Us, Up, Uf, Ux, Ul
     43   1.1  mrg ;; in ARM state: Uq
     44   1.3  mrg ;; in Thumb state: Uu, Uw
     45   1.8  mrg ;; in all states: Q
     46   1.1  mrg 
     47  1.11  mrg (define_register_constraint "Up" "TARGET_HAVE_MVE ? VPR_REG : NO_REGS"
     48  1.11  mrg   "MVE VPR register")
     49  1.11  mrg 
     50  1.11  mrg (define_memory_constraint "Ul"
     51  1.11  mrg  "@internal
     52  1.11  mrg   In ARM/Thumb-2 state a valid address for load instruction with XEXP (op, 0)
     53  1.11  mrg   being label of the literal data item to be loaded."
     54  1.11  mrg  (and (match_code "mem")
     55  1.11  mrg       (match_test "TARGET_HAVE_MVE && reload_completed
     56  1.11  mrg 		   && (GET_CODE (XEXP (op, 0)) == LABEL_REF
     57  1.11  mrg 		       || (GET_CODE (XEXP (op, 0)) == CONST
     58  1.11  mrg 			   && GET_CODE (XEXP (XEXP (op, 0), 0)) == PLUS
     59  1.11  mrg 			   && GET_CODE (XEXP (XEXP (XEXP (op, 0), 0), 0)) == LABEL_REF
     60  1.11  mrg 			   && CONST_INT_P (XEXP (XEXP (XEXP (op, 0), 0), 1))))")))
     61  1.11  mrg 
     62  1.11  mrg (define_register_constraint "Uf" "TARGET_HAVE_MVE ? VFPCC_REG : NO_REGS"
     63  1.11  mrg   "MVE FPCCR register")
     64  1.11  mrg 
     65  1.11  mrg (define_register_constraint "Te" "TARGET_HAVE_MVE ? EVEN_REG : NO_REGS"
     66  1.11  mrg   "EVEN core registers @code{r0}, @code{r2}, @code{r4}, @code{r6}, @code{r8},
     67  1.11  mrg    @code{r10}, @code{r12}, @code{r14}")
     68  1.11  mrg 
     69  1.11  mrg (define_constraint "Rd"
     70  1.11  mrg   "@internal In Thumb-2 state a constant in range 1 to 16"
     71  1.11  mrg   (and (match_code "const_int")
     72  1.11  mrg        (match_test "TARGET_HAVE_MVE && ival >= 1 && ival <= 16")))
     73  1.11  mrg 
     74  1.11  mrg (define_constraint "Ra"
     75  1.11  mrg   "@internal In Thumb-2 state a constant in range 0 to 7"
     76  1.11  mrg   (and (match_code "const_int")
     77  1.11  mrg        (match_test "TARGET_HAVE_MVE && ival >= 0 && ival <= 7")))
     78  1.11  mrg 
     79  1.11  mrg (define_constraint "Rb"
     80  1.11  mrg   "@internal In Thumb-2 state a constant in range 1 to 8"
     81  1.11  mrg   (and (match_code "const_int")
     82  1.11  mrg        (match_test "TARGET_HAVE_MVE && ival >= 1 && ival <= 8")))
     83  1.11  mrg 
     84  1.11  mrg (define_constraint "Rc"
     85  1.11  mrg   "@internal In Thumb-2 state a constant in range 0 to 15"
     86  1.11  mrg   (and (match_code "const_int")
     87  1.11  mrg        (match_test "TARGET_HAVE_MVE && ival >= 0 && ival <= 15")))
     88  1.11  mrg 
     89  1.11  mrg (define_constraint "Re"
     90  1.11  mrg   "@internal In Thumb-2 state a constant in range 0 to 31"
     91  1.11  mrg   (and (match_code "const_int")
     92  1.11  mrg        (match_test "TARGET_HAVE_MVE && ival >= 0 && ival <= 31")))
     93  1.11  mrg 
     94  1.11  mrg (define_constraint "Rf"
     95  1.11  mrg   "@internal In Thumb-2 state a constant in range 1 to 32"
     96  1.11  mrg   (and (match_code "const_int")
     97  1.11  mrg        (match_test "TARGET_HAVE_MVE && ival >= 1 && ival <= 32")))
     98  1.11  mrg 
     99  1.11  mrg (define_constraint "Rg"
    100  1.11  mrg   "@internal In Thumb-2 state a constant is one among 1, 2, 4 and 8"
    101  1.11  mrg   (and (match_code "const_int")
    102  1.11  mrg        (match_test "TARGET_HAVE_MVE && ((ival == 1) || (ival == 2)
    103  1.11  mrg 				       || (ival == 4) || (ival == 8))")))
    104  1.11  mrg 
    105   1.1  mrg (define_register_constraint "t" "TARGET_32BIT ? VFP_LO_REGS : NO_REGS"
    106   1.1  mrg  "The VFP registers @code{s0}-@code{s31}.")
    107   1.1  mrg 
    108   1.1  mrg (define_register_constraint "w"
    109   1.1  mrg   "TARGET_32BIT ? (TARGET_VFPD32 ? VFP_REGS : VFP_LO_REGS) : NO_REGS"
    110   1.1  mrg  "The VFP registers @code{d0}-@code{d15}, or @code{d0}-@code{d31} for VFPv3.")
    111   1.1  mrg 
    112   1.1  mrg (define_register_constraint "x" "TARGET_32BIT ? VFP_D0_D7_REGS : NO_REGS"
    113   1.1  mrg  "The VFP registers @code{d0}-@code{d7}.")
    114   1.1  mrg 
    115   1.1  mrg (define_register_constraint "y" "TARGET_REALLY_IWMMXT ? IWMMXT_REGS : NO_REGS"
    116   1.1  mrg  "The Intel iWMMX co-processor registers.")
    117   1.1  mrg 
    118   1.1  mrg (define_register_constraint "z"
    119   1.1  mrg  "TARGET_REALLY_IWMMXT ? IWMMXT_GR_REGS : NO_REGS"
    120   1.1  mrg  "The Intel iWMMX GR registers.")
    121   1.1  mrg 
    122   1.1  mrg (define_register_constraint "l" "TARGET_THUMB ? LO_REGS : GENERAL_REGS"
    123   1.1  mrg  "In Thumb state the core registers @code{r0}-@code{r7}.")
    124   1.1  mrg 
    125   1.1  mrg (define_register_constraint "h" "TARGET_THUMB ? HI_REGS : NO_REGS"
    126   1.1  mrg  "In Thumb state the core registers @code{r8}-@code{r15}.")
    127   1.1  mrg 
    128   1.1  mrg (define_constraint "j"
    129   1.1  mrg  "A constant suitable for a MOVW instruction. (ARM/Thumb-2)"
    130   1.8  mrg  (and (match_test "TARGET_HAVE_MOVT")
    131   1.5  mrg       (ior (and (match_code "high")
    132   1.5  mrg 		(match_test "arm_valid_symbolic_address_p (XEXP (op, 0))"))
    133   1.1  mrg 	   (and (match_code "const_int")
    134   1.1  mrg                 (match_test "(ival & 0xffff0000) == 0")))))
    135   1.1  mrg 
    136   1.3  mrg (define_constraint "Pj"
    137   1.3  mrg  "@internal A 12-bit constant suitable for an ADDW or SUBW instruction. (Thumb-2)"
    138   1.3  mrg  (and (match_code "const_int")
    139   1.3  mrg       (and (match_test "TARGET_THUMB2")
    140   1.3  mrg 	   (match_test "(ival & 0xfffff000) == 0"))))
    141   1.3  mrg 
    142   1.3  mrg (define_constraint "PJ"
    143   1.3  mrg  "@internal A constant that satisfies the Pj constrant if negated."
    144   1.3  mrg  (and (match_code "const_int")
    145   1.3  mrg       (and (match_test "TARGET_THUMB2")
    146   1.3  mrg 	   (match_test "((-ival) & 0xfffff000) == 0"))))
    147   1.3  mrg 
    148   1.1  mrg (define_register_constraint "k" "STACK_REG"
    149   1.1  mrg  "@internal The stack register.")
    150   1.1  mrg 
    151   1.1  mrg (define_register_constraint "b" "TARGET_THUMB ? BASE_REGS : NO_REGS"
    152   1.1  mrg  "@internal
    153   1.1  mrg   Thumb only.  The union of the low registers and the stack register.")
    154   1.1  mrg 
    155  1.11  mrg (define_constraint "c"
    156  1.11  mrg  "@internal The condition code register."
    157  1.11  mrg  (match_operand 0 "cc_register"))
    158   1.1  mrg 
    159   1.5  mrg (define_register_constraint "Cs" "CALLER_SAVE_REGS"
    160   1.5  mrg  "@internal The caller save registers.  Useful for sibcalls.")
    161   1.5  mrg 
    162   1.1  mrg (define_constraint "I"
    163   1.1  mrg  "In ARM/Thumb-2 state a constant that can be used as an immediate value in a
    164   1.1  mrg   Data Processing instruction.  In Thumb-1 state a constant in the range
    165   1.1  mrg   0-255."
    166   1.1  mrg  (and (match_code "const_int")
    167   1.1  mrg       (match_test "TARGET_32BIT ? const_ok_for_arm (ival)
    168   1.1  mrg 		   : ival >= 0 && ival <= 255")))
    169   1.1  mrg 
    170   1.1  mrg (define_constraint "J"
    171   1.1  mrg  "In ARM/Thumb-2 state a constant in the range @minus{}4095-4095.  In Thumb-1
    172   1.1  mrg   state a constant in the range @minus{}255-@minus{}1."
    173   1.1  mrg  (and (match_code "const_int")
    174   1.1  mrg       (match_test "TARGET_32BIT ? (ival >= -4095 && ival <= 4095)
    175   1.1  mrg 		   : (ival >= -255 && ival <= -1)")))
    176   1.1  mrg 
    177   1.1  mrg (define_constraint "K"
    178   1.1  mrg  "In ARM/Thumb-2 state a constant that satisfies the @code{I} constraint if
    179   1.1  mrg   inverted.  In Thumb-1 state a constant that satisfies the @code{I}
    180   1.1  mrg   constraint multiplied by any power of 2."
    181   1.1  mrg  (and (match_code "const_int")
    182   1.1  mrg       (match_test "TARGET_32BIT ? const_ok_for_arm (~ival)
    183   1.1  mrg 		   : thumb_shiftable_const (ival)")))
    184   1.1  mrg 
    185   1.1  mrg (define_constraint "L"
    186   1.1  mrg  "In ARM/Thumb-2 state a constant that satisfies the @code{I} constraint if
    187   1.1  mrg   negated.  In Thumb-1 state a constant in the range @minus{}7-7."
    188   1.1  mrg  (and (match_code "const_int")
    189   1.1  mrg       (match_test "TARGET_32BIT ? const_ok_for_arm (-ival)
    190   1.1  mrg 		   : (ival >= -7 && ival <= 7)")))
    191   1.1  mrg 
    192   1.1  mrg ;; The ARM state version is internal...
    193   1.1  mrg ;; @internal In ARM/Thumb-2 state a constant in the range 0-32 or any
    194   1.1  mrg ;; power of 2.
    195   1.1  mrg (define_constraint "M"
    196   1.1  mrg  "In Thumb-1 state a constant that is a multiple of 4 in the range 0-1020."
    197   1.1  mrg  (and (match_code "const_int")
    198   1.1  mrg       (match_test "TARGET_32BIT ? ((ival >= 0 && ival <= 32)
    199   1.3  mrg 				 || (((ival & (ival - 1)) & 0xFFFFFFFF) == 0))
    200   1.3  mrg 		   : ival >= 0 && ival <= 1020 && (ival & 3) == 0")))
    201   1.1  mrg 
    202   1.1  mrg (define_constraint "N"
    203   1.1  mrg  "Thumb-1 state a constant in the range 0-31."
    204   1.1  mrg  (and (match_code "const_int")
    205   1.1  mrg       (match_test "!TARGET_32BIT && (ival >= 0 && ival <= 31)")))
    206   1.1  mrg 
    207   1.1  mrg (define_constraint "O"
    208   1.1  mrg  "In Thumb-1 state a constant that is a multiple of 4 in the range
    209   1.1  mrg   @minus{}508-508."
    210   1.1  mrg  (and (match_code "const_int")
    211   1.1  mrg       (match_test "TARGET_THUMB1 && ival >= -508 && ival <= 508
    212   1.1  mrg 		   && ((ival & 3) == 0)")))
    213   1.1  mrg 
    214   1.1  mrg (define_constraint "Pa"
    215   1.1  mrg   "@internal In Thumb-1 state a constant in the range -510 to +510"
    216   1.1  mrg   (and (match_code "const_int")
    217   1.1  mrg        (match_test "TARGET_THUMB1 && ival >= -510 && ival <= 510
    218   1.1  mrg 		    && (ival > 255 || ival < -255)")))
    219   1.1  mrg 
    220   1.1  mrg (define_constraint "Pb"
    221   1.1  mrg   "@internal In Thumb-1 state a constant in the range -262 to +262"
    222   1.1  mrg   (and (match_code "const_int")
    223   1.1  mrg        (match_test "TARGET_THUMB1 && ival >= -262 && ival <= 262
    224   1.1  mrg 		    && (ival > 255 || ival < -255)")))
    225   1.1  mrg 
    226   1.3  mrg (define_constraint "Pc"
    227   1.3  mrg   "@internal In Thumb-1 state a constant that is in the range 1021 to 1275"
    228   1.3  mrg   (and (match_code "const_int")
    229   1.3  mrg        (match_test "TARGET_THUMB1
    230   1.3  mrg   		    && ival > 1020 && ival <= 1275")))
    231   1.3  mrg 
    232   1.3  mrg (define_constraint "Pd"
    233   1.5  mrg   "@internal In Thumb state a constant in the range 0 to 7"
    234   1.3  mrg   (and (match_code "const_int")
    235   1.5  mrg        (match_test "TARGET_THUMB && ival >= 0 && ival <= 7")))
    236   1.3  mrg 
    237   1.3  mrg (define_constraint "Pe"
    238   1.3  mrg   "@internal In Thumb-1 state a constant in the range 256 to +510"
    239   1.3  mrg   (and (match_code "const_int")
    240   1.3  mrg        (match_test "TARGET_THUMB1 && ival >= 256 && ival <= 510")))
    241   1.3  mrg 
    242   1.8  mrg (define_constraint "Pf"
    243   1.8  mrg   "Memory models except relaxed, consume or release ones."
    244   1.8  mrg   (and (match_code "const_int")
    245   1.8  mrg        (match_test "!is_mm_relaxed (memmodel_from_int (ival))
    246   1.8  mrg 		    && !is_mm_consume (memmodel_from_int (ival))
    247   1.8  mrg 		    && !is_mm_release (memmodel_from_int (ival))")))
    248   1.8  mrg 
    249  1.11  mrg (define_constraint "Pg"
    250  1.11  mrg   "@internal In Thumb-2 state a constant in range 1 to 32"
    251  1.11  mrg   (and (match_code "const_int")
    252  1.11  mrg        (match_test "TARGET_THUMB2 && ival >= 1 && ival <= 32")))
    253  1.11  mrg 
    254   1.1  mrg (define_constraint "Ps"
    255   1.1  mrg   "@internal In Thumb-2 state a constant in the range -255 to +255"
    256   1.1  mrg   (and (match_code "const_int")
    257   1.1  mrg        (match_test "TARGET_THUMB2 && ival >= -255 && ival <= 255")))
    258   1.1  mrg 
    259   1.1  mrg (define_constraint "Pt"
    260   1.1  mrg   "@internal In Thumb-2 state a constant in the range -7 to +7"
    261   1.1  mrg   (and (match_code "const_int")
    262   1.1  mrg        (match_test "TARGET_THUMB2 && ival >= -7 && ival <= 7")))
    263   1.1  mrg 
    264   1.3  mrg (define_constraint "Pu"
    265   1.3  mrg   "@internal In Thumb-2 state a constant in the range +1 to +8"
    266   1.3  mrg   (and (match_code "const_int")
    267   1.3  mrg        (match_test "TARGET_THUMB2 && ival >= 1 && ival <= 8")))
    268   1.3  mrg 
    269   1.3  mrg (define_constraint "Pv"
    270   1.3  mrg   "@internal In Thumb-2 state a constant in the range -255 to 0"
    271   1.3  mrg   (and (match_code "const_int")
    272   1.3  mrg        (match_test "TARGET_THUMB2 && ival >= -255 && ival <= 0")))
    273   1.3  mrg 
    274   1.3  mrg (define_constraint "Pw"
    275   1.3  mrg   "@internal In Thumb-2 state a constant in the range -255 to -1"
    276   1.3  mrg   (and (match_code "const_int")
    277   1.3  mrg        (match_test "TARGET_THUMB2 && ival >= -255 && ival <= -1")))
    278   1.3  mrg 
    279   1.3  mrg (define_constraint "Px"
    280   1.3  mrg   "@internal In Thumb-2 state a constant in the range -7 to -1"
    281   1.3  mrg   (and (match_code "const_int")
    282   1.3  mrg        (match_test "TARGET_THUMB2 && ival >= -7 && ival <= -1")))
    283   1.3  mrg 
    284   1.3  mrg (define_constraint "Py"
    285   1.3  mrg   "@internal In Thumb-2 state a constant in the range 0 to 255"
    286   1.3  mrg   (and (match_code "const_int")
    287   1.3  mrg        (match_test "TARGET_THUMB2 && ival >= 0 && ival <= 255")))
    288   1.3  mrg 
    289   1.5  mrg (define_constraint "Pz"
    290   1.5  mrg   "@internal In Thumb-2 state the constant 0"
    291   1.5  mrg   (and (match_code "const_int")
    292   1.5  mrg        (match_test "TARGET_THUMB2 && (ival == 0)")))
    293   1.5  mrg 
    294   1.1  mrg (define_constraint "G"
    295   1.3  mrg  "In ARM/Thumb-2 state the floating-point constant 0."
    296   1.1  mrg  (and (match_code "const_double")
    297   1.1  mrg       (match_test "TARGET_32BIT && arm_const_double_rtx (op)")))
    298   1.1  mrg 
    299  1.10  mrg (define_constraint "Ha"
    300  1.10  mrg   "@internal In ARM / Thumb-2 a float constant iff literal pools are allowed."
    301  1.10  mrg   (and (match_code "const_double")
    302  1.10  mrg        (match_test "satisfies_constraint_E (op)")
    303  1.10  mrg        (match_test "!arm_disable_literal_pool")))
    304  1.10  mrg 
    305   1.3  mrg (define_constraint "Dz"
    306   1.3  mrg  "@internal
    307   1.3  mrg   In ARM/Thumb-2 state a vector of constant zeros."
    308   1.3  mrg  (and (match_code "const_vector")
    309  1.12  mrg       (match_test "(TARGET_NEON || TARGET_HAVE_MVE) && op == CONST0_RTX (mode)")))
    310  1.12  mrg 
    311  1.12  mrg (define_constraint "DB"
    312  1.12  mrg  "@internal
    313  1.12  mrg   In ARM/Thumb-2 state with MVE a constant vector of booleans."
    314  1.12  mrg  (and (match_code "const_vector")
    315  1.12  mrg       (match_test "TARGET_HAVE_MVE && GET_MODE_CLASS (mode) == MODE_VECTOR_BOOL")))
    316   1.1  mrg 
    317   1.1  mrg (define_constraint "Da"
    318   1.1  mrg  "@internal
    319   1.1  mrg   In ARM/Thumb-2 state a const_int, const_double or const_vector that can
    320   1.1  mrg   be generated with two Data Processing insns."
    321   1.1  mrg  (and (match_code "const_double,const_int,const_vector")
    322   1.1  mrg       (match_test "TARGET_32BIT && arm_const_double_inline_cost (op) == 2")))
    323   1.1  mrg 
    324   1.1  mrg (define_constraint "Db"
    325   1.1  mrg  "@internal
    326   1.1  mrg   In ARM/Thumb-2 state a const_int, const_double or const_vector that can
    327   1.1  mrg   be generated with three Data Processing insns."
    328   1.1  mrg  (and (match_code "const_double,const_int,const_vector")
    329   1.1  mrg       (match_test "TARGET_32BIT && arm_const_double_inline_cost (op) == 3")))
    330   1.1  mrg 
    331   1.1  mrg (define_constraint "Dc"
    332   1.1  mrg  "@internal
    333   1.1  mrg   In ARM/Thumb-2 state a const_int, const_double or const_vector that can
    334   1.1  mrg   be generated with four Data Processing insns.  This pattern is disabled
    335   1.1  mrg   if optimizing for space or when we have load-delay slots to fill."
    336   1.1  mrg  (and (match_code "const_double,const_int,const_vector")
    337   1.1  mrg       (match_test "TARGET_32BIT && arm_const_double_inline_cost (op) == 4
    338   1.1  mrg 		   && !(optimize_size || arm_ld_sched)")))
    339   1.1  mrg 
    340   1.3  mrg (define_constraint "Dd"
    341   1.3  mrg  "@internal
    342   1.3  mrg   In ARM/Thumb-2 state a const_int that can be used by insn adddi."
    343   1.3  mrg  (and (match_code "const_int")
    344   1.3  mrg       (match_test "TARGET_32BIT && const_ok_for_dimode_op (ival, PLUS)")))
    345   1.3  mrg 
    346   1.3  mrg (define_constraint "Di"
    347   1.3  mrg  "@internal
    348   1.3  mrg   In ARM/Thumb-2 state a const_int or const_double where both the high
    349   1.3  mrg   and low SImode words can be generated as immediates in 32-bit instructions."
    350   1.3  mrg  (and (match_code "const_double,const_int")
    351   1.3  mrg       (match_test "TARGET_32BIT && arm_const_double_by_immediates (op)")))
    352   1.3  mrg 
    353   1.9  mrg (define_constraint "Dm"
    354   1.1  mrg  "@internal
    355   1.9  mrg   In ARM/Thumb-2 state a const_vector which can be loaded with a Neon vmov
    356   1.9  mrg   immediate instruction."
    357   1.9  mrg  (and (match_code "const_vector")
    358   1.1  mrg       (match_test "TARGET_32BIT
    359   1.1  mrg 		   && imm_for_neon_mov_operand (op, GET_MODE (op))")))
    360   1.1  mrg 
    361   1.9  mrg (define_constraint "Dn"
    362   1.9  mrg  "@internal
    363   1.9  mrg   In ARM/Thumb-2 state a DImode const_int which can be loaded with a Neon vmov
    364   1.9  mrg   immediate instruction."
    365   1.9  mrg  (and (match_code "const_int")
    366   1.9  mrg       (match_test "TARGET_32BIT && imm_for_neon_mov_operand (op, DImode)")))
    367   1.9  mrg 
    368   1.9  mrg (define_constraint "DN"
    369   1.9  mrg  "@internal
    370   1.9  mrg   In ARM/Thumb-2 state a TImode const_int which can be loaded with a Neon vmov
    371   1.9  mrg   immediate instruction."
    372   1.9  mrg  (and (match_code "const_int")
    373   1.9  mrg       (match_test "TARGET_32BIT && imm_for_neon_mov_operand (op, TImode)")))
    374   1.9  mrg 
    375   1.1  mrg (define_constraint "Dl"
    376   1.1  mrg  "@internal
    377   1.1  mrg   In ARM/Thumb-2 state a const_vector which can be used with a Neon vorr or
    378   1.1  mrg   vbic instruction."
    379   1.1  mrg  (and (match_code "const_vector")
    380   1.1  mrg       (match_test "TARGET_32BIT
    381   1.1  mrg 		   && imm_for_neon_logic_operand (op, GET_MODE (op))")))
    382   1.1  mrg 
    383   1.1  mrg (define_constraint "DL"
    384   1.1  mrg  "@internal
    385   1.1  mrg   In ARM/Thumb-2 state a const_vector which can be used with a Neon vorn or
    386   1.1  mrg   vand instruction."
    387   1.1  mrg  (and (match_code "const_vector")
    388   1.1  mrg       (match_test "TARGET_32BIT
    389   1.1  mrg 		   && imm_for_neon_inv_logic_operand (op, GET_MODE (op))")))
    390   1.1  mrg 
    391   1.3  mrg (define_constraint "Do"
    392   1.3  mrg  "@internal
    393   1.3  mrg   In ARM/Thumb2 state valid offset for an ldrd/strd instruction."
    394   1.3  mrg  (and (match_code "const_int")
    395   1.3  mrg       (match_test "TARGET_LDRD && offset_ok_for_ldrd_strd (ival)")))
    396   1.3  mrg 
    397   1.1  mrg (define_constraint "Dv"
    398   1.1  mrg  "@internal
    399   1.1  mrg   In ARM/Thumb-2 state a const_double which can be used with a VFP fconsts
    400   1.1  mrg   instruction."
    401   1.1  mrg  (and (match_code "const_double")
    402   1.1  mrg       (match_test "TARGET_32BIT && vfp3_const_double_rtx (op)")))
    403   1.1  mrg 
    404   1.1  mrg (define_constraint "Dy"
    405   1.1  mrg  "@internal
    406   1.1  mrg   In ARM/Thumb-2 state a const_double which can be used with a VFP fconstd
    407   1.1  mrg   instruction."
    408   1.1  mrg  (and (match_code "const_double")
    409   1.1  mrg       (match_test "TARGET_32BIT && TARGET_VFP_DOUBLE && vfp3_const_double_rtx (op)")))
    410   1.1  mrg 
    411   1.5  mrg (define_constraint "Dt"
    412   1.3  mrg  "@internal
    413   1.3  mrg   In ARM/ Thumb2 a const_double which can be used with a vcvt.f32.s32 with fract bits operation"
    414   1.3  mrg   (and (match_code "const_double")
    415   1.8  mrg        (match_test "TARGET_32BIT && vfp3_const_double_for_fract_bits (op)")))
    416   1.3  mrg 
    417  1.12  mrg (define_constraint "Ds"
    418  1.12  mrg  "@internal
    419  1.12  mrg   In ARM/Thumb-2 state a const_vector which can be used as immediate
    420  1.12  mrg   in vshl instruction."
    421  1.12  mrg  (and (match_code "const_vector")
    422  1.12  mrg       (match_test "TARGET_32BIT
    423  1.12  mrg 		   && imm_for_neon_lshift_operand (op, GET_MODE (op))")))
    424  1.12  mrg 
    425   1.5  mrg (define_constraint "Dp"
    426   1.5  mrg  "@internal
    427   1.5  mrg   In ARM/ Thumb2 a const_double which can be used with a vcvt.s32.f32 with bits operation"
    428   1.5  mrg   (and (match_code "const_double")
    429   1.8  mrg        (match_test "TARGET_32BIT
    430   1.5  mrg 		    && vfp3_const_double_for_bits (op) > 0")))
    431   1.5  mrg 
    432  1.10  mrg (define_constraint "Tu"
    433  1.10  mrg   "@internal In ARM / Thumb-2 an integer constant iff literal pools are
    434  1.10  mrg    allowed."
    435  1.10  mrg   (and (match_test "CONSTANT_P (op)")
    436  1.10  mrg        (match_test "!arm_disable_literal_pool")))
    437  1.10  mrg 
    438   1.5  mrg (define_register_constraint "Ts" "(arm_restrict_it) ? LO_REGS : GENERAL_REGS"
    439   1.5  mrg  "For arm_restrict_it the core registers @code{r0}-@code{r7}.  GENERAL_REGS otherwise.")
    440   1.5  mrg 
    441   1.3  mrg (define_memory_constraint "Ua"
    442   1.3  mrg  "@internal
    443   1.3  mrg   An address valid for loading/storing register exclusive"
    444   1.3  mrg  (match_operand 0 "mem_noofs_operand"))
    445   1.3  mrg 
    446   1.3  mrg (define_memory_constraint "Uh"
    447   1.3  mrg  "@internal
    448   1.3  mrg   An address suitable for byte and half-word loads which does not point inside a constant pool"
    449   1.3  mrg  (and (match_code "mem")
    450   1.3  mrg       (match_test "arm_legitimate_address_p (GET_MODE (op), XEXP (op, 0), false) && !arm_is_constant_pool_ref (op)")))
    451   1.3  mrg 
    452   1.1  mrg (define_memory_constraint "Ut"
    453   1.1  mrg  "@internal
    454   1.1  mrg   In ARM/Thumb-2 state an address valid for loading/storing opaque structure
    455   1.1  mrg   types wider than TImode."
    456   1.1  mrg  (and (match_code "mem")
    457   1.1  mrg       (match_test "TARGET_32BIT && neon_struct_mem_operand (op)")))
    458   1.1  mrg 
    459   1.1  mrg (define_memory_constraint "Uv"
    460   1.1  mrg  "@internal
    461   1.1  mrg   In ARM/Thumb-2 state a valid VFP load/store address."
    462   1.1  mrg  (and (match_code "mem")
    463   1.1  mrg       (match_test "TARGET_32BIT && arm_coproc_mem_operand (op, FALSE)")))
    464   1.1  mrg 
    465  1.12  mrg (define_memory_constraint "Ug"
    466  1.12  mrg  "@internal
    467  1.12  mrg   In Thumb-2 state a valid MVE struct load/store address."
    468  1.12  mrg  (match_operand 0 "mve_struct_operand"))
    469  1.12  mrg 
    470  1.11  mrg (define_memory_constraint "Uj"
    471  1.11  mrg  "@internal
    472  1.11  mrg   In ARM/Thumb-2 state a VFP load/store address that supports writeback
    473  1.11  mrg   for Neon but not for MVE"
    474  1.11  mrg  (and (match_code "mem")
    475  1.11  mrg       (match_test "TARGET_32BIT")
    476  1.11  mrg       (match_test "TARGET_HAVE_MVE
    477  1.11  mrg                    ? arm_coproc_mem_operand_no_writeback (op)
    478  1.11  mrg                    : neon_vector_mem_operand (op, 2, true)")))
    479  1.11  mrg 
    480   1.1  mrg (define_memory_constraint "Uy"
    481   1.1  mrg  "@internal
    482   1.1  mrg   In ARM/Thumb-2 state a valid iWMMX load/store address."
    483   1.1  mrg  (and (match_code "mem")
    484   1.1  mrg       (match_test "TARGET_32BIT && arm_coproc_mem_operand (op, TRUE)")))
    485   1.1  mrg 
    486   1.1  mrg (define_memory_constraint "Un"
    487   1.1  mrg  "@internal
    488   1.1  mrg   In ARM/Thumb-2 state a valid address for Neon doubleword vector
    489   1.1  mrg   load/store instructions."
    490   1.1  mrg  (and (match_code "mem")
    491   1.5  mrg       (match_test "TARGET_32BIT && neon_vector_mem_operand (op, 0, true)")))
    492   1.1  mrg 
    493   1.1  mrg (define_memory_constraint "Um"
    494   1.1  mrg  "@internal
    495   1.1  mrg   In ARM/Thumb-2 state a valid address for Neon element and structure
    496   1.1  mrg   load/store instructions."
    497   1.1  mrg  (and (match_code "mem")
    498   1.5  mrg       (match_test "TARGET_32BIT && neon_vector_mem_operand (op, 2, true)")))
    499   1.1  mrg 
    500   1.1  mrg (define_memory_constraint "Us"
    501   1.1  mrg  "@internal
    502   1.1  mrg   In ARM/Thumb-2 state a valid address for non-offset loads/stores of
    503   1.1  mrg   quad-word values in four ARM registers."
    504   1.1  mrg  (and (match_code "mem")
    505   1.5  mrg       (match_test "TARGET_32BIT && neon_vector_mem_operand (op, 1, true)")))
    506   1.1  mrg 
    507  1.11  mrg (define_memory_constraint "Ux"
    508  1.11  mrg  "@internal
    509  1.11  mrg   In ARM/Thumb-2 state a valid address and load into CORE regs or only to
    510  1.11  mrg   LO_REGS based on mode of op."
    511  1.11  mrg  (and (match_code "mem")
    512  1.11  mrg       (match_test "(TARGET_HAVE_MVE || TARGET_HAVE_MVE_FLOAT)
    513  1.11  mrg 		   && mve_vector_mem_operand (GET_MODE (op),
    514  1.11  mrg 					      XEXP (op, 0), true)")))
    515  1.11  mrg 
    516  1.11  mrg (define_constraint "Ui"
    517  1.11  mrg   "@internal
    518  1.11  mrg    Match a constant (as per the 'i' constraint) provided that we have the
    519  1.11  mrg    literal pool available.  This is useful for load insns that would need
    520  1.11  mrg    to move such constants to the literal pool after RA."
    521  1.11  mrg  (match_test "!arm_disable_literal_pool && satisfies_constraint_i (op)"))
    522  1.11  mrg 
    523   1.1  mrg (define_memory_constraint "Uq"
    524   1.1  mrg  "@internal
    525   1.1  mrg   In ARM state an address valid in ldrsb instructions."
    526   1.1  mrg  (and (match_code "mem")
    527   1.1  mrg       (match_test "TARGET_ARM
    528   1.1  mrg 		   && arm_legitimate_address_outer_p (GET_MODE (op), XEXP (op, 0),
    529   1.3  mrg 						      SIGN_EXTEND, 0)
    530   1.3  mrg 		   && !arm_is_constant_pool_ref (op)")))
    531   1.1  mrg 
    532   1.1  mrg (define_memory_constraint "Q"
    533   1.1  mrg  "@internal
    534   1.8  mrg   An address that is a single base register."
    535   1.1  mrg  (and (match_code "mem")
    536   1.1  mrg       (match_test "REG_P (XEXP (op, 0))")))
    537   1.1  mrg 
    538   1.3  mrg (define_memory_constraint "Uu"
    539   1.3  mrg  "@internal
    540   1.3  mrg   In Thumb state an address that is valid in 16bit encoding."
    541   1.3  mrg  (and (match_code "mem")
    542   1.3  mrg       (match_test "TARGET_THUMB
    543   1.3  mrg 		   && thumb1_legitimate_address_p (GET_MODE (op), XEXP (op, 0),
    544   1.3  mrg 						   0)")))
    545   1.3  mrg 
    546   1.3  mrg ; The 16-bit post-increment LDR/STR accepted by thumb1_legitimate_address_p
    547   1.3  mrg ; are actually LDM/STM instructions, so cannot be used to access unaligned
    548   1.3  mrg ; data.
    549   1.3  mrg (define_memory_constraint "Uw"
    550   1.3  mrg  "@internal
    551   1.3  mrg   In Thumb state an address that is valid in 16bit encoding, and that can be
    552   1.3  mrg   used for unaligned accesses."
    553   1.3  mrg  (and (match_code "mem")
    554   1.3  mrg       (match_test "TARGET_THUMB
    555   1.3  mrg 		   && thumb1_legitimate_address_p (GET_MODE (op), XEXP (op, 0),
    556   1.3  mrg 						   0)
    557   1.3  mrg 		   && GET_CODE (XEXP (op, 0)) != POST_INC")))
    558   1.3  mrg 
    559   1.5  mrg (define_constraint "US"
    560   1.5  mrg  "@internal
    561   1.5  mrg   US is a symbol reference."
    562   1.5  mrg  (match_code "symbol_ref")
    563   1.5  mrg )
    564   1.5  mrg 
    565  1.12  mrg ;; True if the immediate is the range +/- 1016 and multiple of 8 for MVE.
    566  1.12  mrg (define_constraint "Ri"
    567  1.12  mrg   "@internal In Thumb-2 state a constant is multiple of 8 and in range
    568  1.12  mrg    of -/+ 1016 for MVE"
    569  1.12  mrg   (and (match_code "const_int")
    570  1.12  mrg        (match_test "TARGET_HAVE_MVE && (-1016 <= ival) && (ival <= 1016)
    571  1.12  mrg 		    && ((ival % 8) == 0)")))
    572  1.12  mrg 
    573  1.12  mrg ;; True if the immediate is multiple of 2 and in range of -/+ 252 for MVE.
    574  1.12  mrg (define_constraint "Rl"
    575  1.12  mrg   "@internal In Thumb-2 state a constant is multiple of 2 and in range
    576  1.12  mrg    of -/+ 252 for MVE"
    577  1.12  mrg   (and (match_code "const_int")
    578  1.12  mrg        (match_test "TARGET_HAVE_MVE && (-252 <= ival) && (ival <= 252)
    579  1.12  mrg 		    && ((ival % 2) == 0)")))
    580  1.12  mrg 
    581   1.8  mrg (define_memory_constraint "Uz"
    582   1.8  mrg  "@internal
    583   1.8  mrg   A memory access that is accessible as an LDC/STC operand"
    584   1.8  mrg  (and (match_code "mem")
    585   1.8  mrg       (match_test "arm_coproc_ldc_stc_legitimate_address (op)")))
    586   1.8  mrg 
    587   1.1  mrg ;; We used to have constraint letters for S and R in ARM state, but
    588   1.1  mrg ;; all uses of these now appear to have been removed.
    589   1.1  mrg 
    590   1.1  mrg ;; Additionally, we used to have a Q constraint in Thumb state, but
    591   1.1  mrg ;; this wasn't really a valid memory constraint.  Again, all uses of
    592   1.1  mrg ;; this now seem to have been removed.
    593   1.5  mrg 
    594