1 |
709 |
jeremybenn |
;; Constraint definitions for Tilera TILE-Gx.
|
2 |
|
|
;; Copyright (C) 2011, 2012
|
3 |
|
|
;; Free Software Foundation, Inc.
|
4 |
|
|
;; Contributed by Walter Lee (walt@tilera.com)
|
5 |
|
|
;;
|
6 |
|
|
;; This file is part of GCC.
|
7 |
|
|
;;
|
8 |
|
|
;; GCC is free software; you can redistribute it and/or modify it
|
9 |
|
|
;; under the terms of the GNU General Public License as published
|
10 |
|
|
;; by the Free Software Foundation; either version 3, or (at your
|
11 |
|
|
;; option) any later version.
|
12 |
|
|
;;
|
13 |
|
|
;; GCC is distributed in the hope that it will be useful, but WITHOUT
|
14 |
|
|
;; ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
15 |
|
|
;; or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
|
16 |
|
|
;; License for more details.
|
17 |
|
|
;;
|
18 |
|
|
;; You should have received a copy of the GNU General Public License
|
19 |
|
|
;; along with GCC; see the file COPYING3. If not see
|
20 |
|
|
;; .
|
21 |
|
|
|
22 |
|
|
(define_register_constraint "R00" "R0_REGS" "r0")
|
23 |
|
|
(define_register_constraint "R01" "R1_REGS" "r1")
|
24 |
|
|
(define_register_constraint "R02" "R2_REGS" "r2")
|
25 |
|
|
(define_register_constraint "R03" "R3_REGS" "r3")
|
26 |
|
|
(define_register_constraint "R04" "R4_REGS" "r4")
|
27 |
|
|
(define_register_constraint "R05" "R5_REGS" "r5")
|
28 |
|
|
(define_register_constraint "R06" "R6_REGS" "r6")
|
29 |
|
|
(define_register_constraint "R07" "R7_REGS" "r7")
|
30 |
|
|
(define_register_constraint "R08" "R8_REGS" "r8")
|
31 |
|
|
(define_register_constraint "R09" "R9_REGS" "r9")
|
32 |
|
|
(define_register_constraint "R10" "R10_REGS" "r10")
|
33 |
|
|
|
34 |
|
|
(define_constraint "I"
|
35 |
|
|
"A signed 8 bit constant"
|
36 |
|
|
(and (match_code "const_int")
|
37 |
|
|
(match_test "ival >= -128 && ival <= 127")))
|
38 |
|
|
|
39 |
|
|
(define_constraint "J"
|
40 |
|
|
"Signed 16-bit integer constant"
|
41 |
|
|
(and (match_code "const_int")
|
42 |
|
|
(match_test "ival >= -32768 && ival <= 32767")))
|
43 |
|
|
|
44 |
|
|
(define_constraint "K"
|
45 |
|
|
"Unsigned 16-bit integer constant"
|
46 |
|
|
(and (match_code "const_int")
|
47 |
|
|
(match_test "(ival >= 0 && ival <= 65535)")))
|
48 |
|
|
|
49 |
|
|
(define_constraint "L"
|
50 |
|
|
"Integer constant that fits in one signed byte when incremented"
|
51 |
|
|
(and (match_code "const_int")
|
52 |
|
|
(match_test "ival >= -129 && ival <= 126")))
|
53 |
|
|
|
54 |
|
|
(define_constraint "M"
|
55 |
|
|
"A bit mask suitable for 'bfins'"
|
56 |
|
|
(and (match_code "const_int")
|
57 |
|
|
(match_test "tilegx_bitfield_operand_p (ival, NULL, NULL)")))
|
58 |
|
|
|
59 |
|
|
(define_constraint "N"
|
60 |
|
|
"Integer constant that is a byte tiled out eight times"
|
61 |
|
|
(and (match_code "const_int")
|
62 |
|
|
(match_test "(ival == (ival & 0xFF) * 0x0101010101010101LL)")))
|
63 |
|
|
|
64 |
|
|
(define_constraint "O"
|
65 |
|
|
"The integer zero constant"
|
66 |
|
|
(and (match_code "const_int")
|
67 |
|
|
(match_test "ival == 0")))
|
68 |
|
|
|
69 |
|
|
(define_constraint "P"
|
70 |
|
|
"Integer constant that is a sign-extended byte tiled out as four shorts"
|
71 |
|
|
(and (match_code "const_int")
|
72 |
|
|
(match_test "(ival
|
73 |
|
|
== ((trunc_int_for_mode (ival, QImode) & 0xFFFF)
|
74 |
|
|
* 0x0001000100010001LL))")))
|
75 |
|
|
|
76 |
|
|
(define_constraint "Q"
|
77 |
|
|
"Integer constant that fits in one signed byte when incremented, but not -1"
|
78 |
|
|
(and (match_code "const_int")
|
79 |
|
|
(match_test "ival >= -129 && ival <= 126 && ival != -1")))
|
80 |
|
|
|
81 |
|
|
(define_constraint "S"
|
82 |
|
|
"Integer constant that has all 1 bits consecutive and starting at bit 0"
|
83 |
|
|
(and (match_code "const_int")
|
84 |
|
|
(match_test "ival != 0 && (ival & (ival + 1)) == 0")))
|
85 |
|
|
|
86 |
|
|
(define_constraint "T"
|
87 |
|
|
"An unspec wrapper for a symbolc operand"
|
88 |
|
|
(ior (match_operand 0 "const_last_symbolic_operand")
|
89 |
|
|
(match_operand 0 "const_symbolic_operand")))
|
90 |
|
|
|
91 |
|
|
(define_memory_constraint "U"
|
92 |
|
|
"Non-auto-incrementing memory"
|
93 |
|
|
(and (match_code "mem")
|
94 |
|
|
(match_test "GET_RTX_CLASS (GET_CODE (XEXP (op, 0))) != RTX_AUTOINC")))
|
95 |
|
|
|
96 |
|
|
(define_constraint "W"
|
97 |
|
|
"An 8-element vector constant with identical elements"
|
98 |
|
|
(and (match_code "const_vector")
|
99 |
|
|
(match_test "CONST_VECTOR_NUNITS (op) == 8")
|
100 |
|
|
(match_test "CONST_VECTOR_ELT (op, 0) == CONST_VECTOR_ELT (op, 1)")
|
101 |
|
|
(match_test "CONST_VECTOR_ELT (op, 0) == CONST_VECTOR_ELT (op, 2)")
|
102 |
|
|
(match_test "CONST_VECTOR_ELT (op, 0) == CONST_VECTOR_ELT (op, 3)")
|
103 |
|
|
(match_test "CONST_VECTOR_ELT (op, 0) == CONST_VECTOR_ELT (op, 4)")
|
104 |
|
|
(match_test "CONST_VECTOR_ELT (op, 0) == CONST_VECTOR_ELT (op, 5)")
|
105 |
|
|
(match_test "CONST_VECTOR_ELT (op, 0) == CONST_VECTOR_ELT (op, 6)")
|
106 |
|
|
(match_test "CONST_VECTOR_ELT (op, 0) == CONST_VECTOR_ELT (op, 7)")))
|
107 |
|
|
|
108 |
|
|
(define_constraint "Y"
|
109 |
|
|
"A 4-element vector constant with identical elements"
|
110 |
|
|
(and (match_code "const_vector")
|
111 |
|
|
(match_test "CONST_VECTOR_NUNITS (op) == 4")
|
112 |
|
|
(match_test "CONST_VECTOR_ELT (op, 0) == CONST_VECTOR_ELT (op, 1)")
|
113 |
|
|
(match_test "CONST_VECTOR_ELT (op, 0) == CONST_VECTOR_ELT (op, 2)")
|
114 |
|
|
(match_test "CONST_VECTOR_ELT (op, 0) == CONST_VECTOR_ELT (op, 3)")))
|
115 |
|
|
(define_constraint "Z0"
|
116 |
|
|
"The integer constant 0xffffffff"
|
117 |
|
|
(and (match_code "const_int")
|
118 |
|
|
(match_test "ival == 0xffffffff")))
|
119 |
|
|
|
120 |
|
|
(define_constraint "Z1"
|
121 |
|
|
"The integer constant 0xffffffff00000000"
|
122 |
|
|
(and (match_code "const_int")
|
123 |
|
|
(match_test "ival == (HOST_WIDE_INT)0xffffffff00000000LL")))
|