|
24 | 24 | UNSPEC_ARCV_APEX_VOID_SRC0_V
|
25 | 25 | UNSPEC_ARCV_APEX_VOID_SRC0_SRC1_V
|
26 | 26 | UNSPEC_ARCV_APEX_DEST
|
| 27 | + UNSPEC_ARCV_APEX_DEST_V |
27 | 28 | UNSPEC_ARCV_APEX_DEST_SRC0
|
| 29 | + UNSPEC_ARCV_APEX_DEST_SRC0_V |
28 | 30 | UNSPEC_ARCV_APEX_DEST_SRC0_SRC1
|
| 31 | + UNSPEC_ARCV_APEX_DEST_SRC0_SRC1_V |
29 | 32 | ])
|
30 | 33 |
|
31 | 34 | ;; Used by "XD" insn. format: `insn`
|
|
41 | 44 | )
|
42 | 45 |
|
43 | 46 | ;; Used by "XI","XD" insn. format: `insn src0`
|
44 |
| -(define_insn "riscv_arcv_apex_void_ftype_src0" |
45 |
| - [(unspec_volatile:SI [(match_operand:SI 0 "const_int_operand" "xAVpXI,xAVpXD") |
46 |
| - (match_operand:SI 1 "nonmemory_operand" "I,r")] |
| 47 | +(define_insn "riscv_arcv_apex_void_ftype_<S0M:mode>" |
| 48 | + [(unspec_volatile [(match_operand:SI 0 "const_int_operand" "xAVpXI,xAVpXD") |
| 49 | + (match_operand:S0M 1 "nonmemory_operand" "I,r")] |
47 | 50 | UNSPEC_ARCV_APEX_VOID_SRC0_V)]
|
48 | 51 | ""
|
49 | 52 | {
|
|
65 | 68 | [(set_attr "type" "arith,arith")]
|
66 | 69 | )
|
67 | 70 |
|
| 71 | +(define_expand "riscv_arcv_apex_void_ftype_src0_v" |
| 72 | + [(unspec_volatile [(match_operand:SI 0 "const_int_operand") |
| 73 | + (match_operand 1 "nonmemory_operand")] |
| 74 | + UNSPEC_ARCV_APEX_VOID_SRC0_V)] |
| 75 | + "" |
| 76 | +{ |
| 77 | + /* Build the SET exactly as it appears above, but with the |
| 78 | + real RTX objects. Every operand already carries its mode, |
| 79 | + so nothing needs to be guessed. The UNSPEC code is |
| 80 | + essential as it tags this RTL with a unique ID, so the |
| 81 | + recognizer can match it to the correct mode-specific |
| 82 | + define_insn. */ |
| 83 | + emit_insn (gen_rtx_UNSPEC_VOLATILE (VOIDmode, |
| 84 | + gen_rtvec (2, operands[0], |
| 85 | + operands[1]), |
| 86 | + UNSPEC_ARCV_APEX_VOID_SRC0_V)); |
| 87 | + DONE; |
| 88 | +}) |
| 89 | + |
68 | 90 | ;; Used by "XS","XD" insn. format: `insn src0, src1`
|
69 |
| -(define_insn "riscv_arcv_apex_void_ftype_src0_src1" |
70 |
| - [(unspec_volatile:SI [(match_operand:SI 0 "const_int_operand" "xAVpXS,xAVpXD") |
71 |
| - (match_operand:SI 1 "register_operand" "r,r") |
72 |
| - (match_operand:SI 2 "nonmemory_operand" "B8,r")] |
| 91 | +(define_insn "riscv_arcv_apex_void_ftype_<S0M:mode>_<S1M:mode>_v" |
| 92 | + [(unspec_volatile [(match_operand:SI 0 "const_int_operand" "xAVpXS,xAVpXD") |
| 93 | + (match_operand:S0M 1 "register_operand" "r,r") |
| 94 | + (match_operand:S1M 2 "nonmemory_operand" "B8,r")] |
73 | 95 | UNSPEC_ARCV_APEX_VOID_SRC0_SRC1_V)]
|
74 | 96 | ""
|
75 | 97 | {
|
|
93 | 115 | [(set_attr "type" "arith,arith")]
|
94 | 116 | )
|
95 | 117 |
|
| 118 | +(define_expand "riscv_arcv_apex_void_ftype_src0_src1_v" |
| 119 | + [(unspec_volatile [(match_operand:SI 0 "const_int_operand") |
| 120 | + (match_operand 1 "register_operand") |
| 121 | + (match_operand 2 "nonmemory_operand")] |
| 122 | + UNSPEC_ARCV_APEX_VOID_SRC0_SRC1_V)] |
| 123 | + "" |
| 124 | +{ |
| 125 | + /* Build the SET exactly as it appears above, but with the |
| 126 | + real RTX objects. Every operand already carries its mode, |
| 127 | + so nothing needs to be guessed. The UNSPEC code is |
| 128 | + essential as it tags this RTL with a unique ID, so the |
| 129 | + recognizer can match it to the correct mode-specific |
| 130 | + define_insn. */ |
| 131 | + emit_insn (gen_rtx_UNSPEC_VOLATILE (VOIDmode, |
| 132 | + gen_rtvec (3, operands[0], |
| 133 | + operands[1], |
| 134 | + operands[2]), |
| 135 | + UNSPEC_ARCV_APEX_VOID_SRC0_SRC1_V)); |
| 136 | + DONE; |
| 137 | +}) |
| 138 | + |
96 | 139 | ;; Used by "XD" insn. format: `insn dest` volatile
|
97 |
| -(define_insn "riscv_arcv_apex_dest_volatile" |
98 |
| - [(set (match_operand:SI 0 "register_operand" "=r") |
99 |
| - (unspec_volatile:SI [(match_operand:SI 1 "const_int_operand" "xAVpXD")] |
100 |
| - UNSPEC_ARCV_APEX_DEST))] |
| 140 | +(define_insn "riscv_arcv_apex_<DM:mode>_ftype_v" |
| 141 | + [(set (match_operand:DM 0 "register_operand" "=r") |
| 142 | + (unspec_volatile:DM [(match_operand:SI 1 "const_int_operand" "xAVpXD")] |
| 143 | + UNSPEC_ARCV_APEX_DEST_V))] |
101 | 144 | ""
|
102 | 145 | {
|
103 | 146 | const char *str = arcv_apex_get_insn_name (operands[1]);
|
|
108 | 151 | [(set_attr "type" "arith")]
|
109 | 152 | )
|
110 | 153 |
|
| 154 | +(define_expand "riscv_arcv_apex_dest_ftype_v" |
| 155 | + [(set (match_operand 0 "register_operand") |
| 156 | + (unspec [(match_operand:SI 1 "const_int_operand")] |
| 157 | + UNSPEC_ARCV_APEX_DEST_V))] |
| 158 | + "" |
| 159 | +{ |
| 160 | + /* Build the SET exactly as it appears above, but with the |
| 161 | + real RTX objects. Every operand already carries its mode, |
| 162 | + so nothing needs to be guessed. The UNSPEC code is |
| 163 | + essential as it tags this RTL with a unique ID, so the |
| 164 | + recognizer can match it to the correct mode-specific |
| 165 | + define_insn. */ |
| 166 | + emit_insn (gen_rtx_SET (operands[0], |
| 167 | + gen_rtx_UNSPEC_VOLATILE (GET_MODE (operands[0]), |
| 168 | + gen_rtvec (1, operands[1]), |
| 169 | + UNSPEC_ARCV_APEX_DEST_V))); |
| 170 | + DONE; |
| 171 | +}) |
| 172 | + |
111 | 173 | ;; Used by "XD" insn. format: `insn dest`
|
112 |
| -(define_insn "riscv_arcv_apex_dest_ftype" |
113 |
| - [(set (match_operand:SI 0 "register_operand" "=r") |
114 |
| - (unspec:SI [(match_operand:SI 1 "const_int_operand" "xAVpXD")] |
| 174 | +(define_insn "riscv_arcv_apex_<DM:mode>_ftype" |
| 175 | + [(set (match_operand:DM 0 "register_operand" "=r") |
| 176 | + (unspec:DM [(match_operand:SI 1 "const_int_operand" "xAVpXD")] |
115 | 177 | UNSPEC_ARCV_APEX_DEST))]
|
116 | 178 | ""
|
117 | 179 | {
|
|
123 | 185 | [(set_attr "type" "arith")]
|
124 | 186 | )
|
125 | 187 |
|
| 188 | +(define_expand "riscv_arcv_apex_dest_ftype" |
| 189 | + [(set (match_operand 0 "register_operand") |
| 190 | + (unspec [(match_operand:SI 1 "const_int_operand")] |
| 191 | + UNSPEC_ARCV_APEX_DEST))] |
| 192 | + "" |
| 193 | +{ |
| 194 | + /* Build the SET exactly as it appears above, but with the |
| 195 | + real RTX objects. Every operand already carries its mode, |
| 196 | + so nothing needs to be guessed. The UNSPEC code is |
| 197 | + essential as it tags this RTL with a unique ID, so the |
| 198 | + recognizer can match it to the correct mode-specific |
| 199 | + define_insn. */ |
| 200 | + emit_insn (gen_rtx_SET (operands[0], |
| 201 | + gen_rtx_UNSPEC (GET_MODE (operands[0]), |
| 202 | + gen_rtvec (1, operands[1]), |
| 203 | + UNSPEC_ARCV_APEX_DEST))); |
| 204 | + DONE; |
| 205 | +}) |
| 206 | + |
126 | 207 | ;; Used by "XI","XD" insn. format: `insn dest, src0` volatile
|
127 |
| -(define_insn "riscv_arcv_apex_dest_src0_volatile" |
128 |
| - [(set (match_operand:SI 0 "register_operand" "=r,r") |
129 |
| - (unspec_volatile:SI [(match_operand:SI 1 "const_int_operand" "xAVpXI,xAVpXD") |
130 |
| - (match_operand:SI 2 "nonmemory_operand" "I,r")] |
131 |
| - UNSPEC_ARCV_APEX_DEST_SRC0))] |
| 208 | +(define_insn "riscv_arcv_apex_<DM:mode>_ftype_<S0M:mode>_v" |
| 209 | + [(set (match_operand:DM 0 "register_operand" "=r,r") |
| 210 | + (unspec_volatile:DM [(match_operand:SI 1 "const_int_operand" "xAVpXI,xAVpXD") |
| 211 | + (match_operand:S0M 2 "nonmemory_operand" "I,r")] |
| 212 | + UNSPEC_ARCV_APEX_DEST_SRC0_V))] |
132 | 213 | ""
|
133 | 214 | {
|
134 | 215 | const char *str = arcv_apex_get_insn_name (operands[1]);
|
|
151 | 232 | [(set_attr "type" "arith,arith")]
|
152 | 233 | )
|
153 | 234 |
|
| 235 | +(define_expand "riscv_arcv_apex_dest_ftype_src0_v" |
| 236 | + [(set (match_operand 0 "register_operand") |
| 237 | + (unspec_volatile [(match_operand:SI 1 "const_int_operand") |
| 238 | + (match_operand 2 "nonmemory_operand")] |
| 239 | + UNSPEC_ARCV_APEX_DEST_SRC0_V))] |
| 240 | + "" |
| 241 | +{ |
| 242 | + /* Build the SET exactly as it appears above, but with the |
| 243 | + real RTX objects. Every operand already carries its mode, |
| 244 | + so nothing needs to be guessed. The UNSPEC code is |
| 245 | + essential as it tags this RTL with a unique ID, so the |
| 246 | + recognizer can match it to the correct mode-specific |
| 247 | + define_insn. */ |
| 248 | + emit_insn (gen_rtx_SET (operands[0], |
| 249 | + gen_rtx_UNSPEC_VOLATILE (GET_MODE (operands[0]), |
| 250 | + gen_rtvec (2, operands[1], |
| 251 | + operands[2]), |
| 252 | + UNSPEC_ARCV_APEX_DEST_SRC0_V))); |
| 253 | + DONE; |
| 254 | +}) |
| 255 | + |
154 | 256 | ;; Used by "XI","XD" insn. format: `insn dest, src0`
|
155 |
| -(define_insn "riscv_arcv_apex_dest_ftype_src0" |
156 |
| - [(set (match_operand:SI 0 "register_operand" "=r,r") |
157 |
| - (unspec:SI [(match_operand:SI 1 "const_int_operand" "xAVpXI,xAVpXD") |
158 |
| - (match_operand:SI 2 "nonmemory_operand" "I,r")] |
| 257 | +(define_insn "riscv_arcv_apex_<DM:mode>_ftype_<S0M:mode>" |
| 258 | + [(set (match_operand:DM 0 "register_operand" "=r,r") |
| 259 | + (unspec:DM [(match_operand:SI 1 "const_int_operand" "xAVpXI,xAVpXD") |
| 260 | + (match_operand:S0M 2 "nonmemory_operand" "I,r")] |
159 | 261 | UNSPEC_ARCV_APEX_DEST_SRC0))]
|
160 | 262 | ""
|
161 | 263 | {
|
|
179 | 281 | [(set_attr "type" "arith,arith")]
|
180 | 282 | )
|
181 | 283 |
|
| 284 | +(define_expand "riscv_arcv_apex_dest_ftype_src0" |
| 285 | + [(set (match_operand 0 "register_operand") |
| 286 | + (unspec [(match_operand:SI 1 "const_int_operand") |
| 287 | + (match_operand 2 "nonmemory_operand")] |
| 288 | + UNSPEC_ARCV_APEX_DEST_SRC0))] |
| 289 | + "" |
| 290 | +{ |
| 291 | + /* Build the SET exactly as it appears above, but with the |
| 292 | + real RTX objects. Every operand already carries its mode, |
| 293 | + so nothing needs to be guessed. The UNSPEC code is |
| 294 | + essential as it tags this RTL with a unique ID, so the |
| 295 | + recognizer can match it to the correct mode-specific |
| 296 | + define_insn. */ |
| 297 | + emit_insn (gen_rtx_SET (operands[0], |
| 298 | + gen_rtx_UNSPEC (GET_MODE (operands[0]), |
| 299 | + gen_rtvec (2, operands[1], |
| 300 | + operands[2]), |
| 301 | + UNSPEC_ARCV_APEX_DEST_SRC0))); |
| 302 | + DONE; |
| 303 | +}) |
| 304 | + |
182 | 305 | ;; Used by "XS","XC","XD" insn. format: `insn dest, src0, imm/src1` volatile
|
183 |
| -(define_insn "riscv_arcv_apex_dest_src0_src1_volatile" |
184 |
| - [(set (match_operand:SI 0 "register_operand" "=r,r,r") |
185 |
| - (unspec_volatile:SI [(match_operand:SI 1 "const_int_operand" "xAVpXS,xAVpXC,xAVpXD") |
186 |
| - (match_operand:SI 2 "register_operand" "r,0,r") |
187 |
| - (match_operand:SI 3 "nonmemory_operand" "B8,I,r")] |
188 |
| - UNSPEC_ARCV_APEX_DEST_SRC0_SRC1))] |
| 306 | +(define_insn "riscv_arcv_apex_<DM:mode>_ftype_<S0M:mode>_<S1M:mode>_v" |
| 307 | + [(set (match_operand:DM 0 "register_operand" "=r,r,r") |
| 308 | + (unspec_volatile:DM [(match_operand:SI 1 "const_int_operand" "xAVpXS,xAVpXC,xAVpXD") |
| 309 | + (match_operand:S0M 2 "register_operand" "r,0,r") |
| 310 | + (match_operand:S1M 3 "nonmemory_operand" "B8,I,r")] |
| 311 | + UNSPEC_ARCV_APEX_DEST_SRC0_SRC1_V))] |
189 | 312 | ""
|
190 | 313 | {
|
191 | 314 | const char *str = arcv_apex_get_insn_name (operands[1]);
|
|
216 | 339 | [(set_attr "type" "arith,arith,arith")]
|
217 | 340 | )
|
218 | 341 |
|
| 342 | +(define_expand "riscv_arcv_apex_dest_ftype_src0_src1_v" |
| 343 | + [(set (match_operand 0 "register_operand") |
| 344 | + (unspec [(match_operand:SI 1 "const_int_operand") |
| 345 | + (match_operand 2 "register_operand") |
| 346 | + (match_operand 3 "nonmemory_operand")] |
| 347 | + UNSPEC_ARCV_APEX_DEST_SRC0_SRC1_V))] |
| 348 | + "" |
| 349 | +{ |
| 350 | + /* Build the SET exactly as it appears above, but with the |
| 351 | + real RTX objects. Every operand already carries its mode, |
| 352 | + so nothing needs to be guessed. The UNSPEC code is |
| 353 | + essential as it tags this RTL with a unique ID, so the |
| 354 | + recognizer can match it to the correct mode-specific |
| 355 | + define_insn. */ |
| 356 | + emit_insn (gen_rtx_SET (operands[0], |
| 357 | + gen_rtx_UNSPEC_VOLATILE (GET_MODE (operands[0]), |
| 358 | + gen_rtvec (3, operands[1], |
| 359 | + operands[2], |
| 360 | + operands[3]), |
| 361 | + UNSPEC_ARCV_APEX_DEST_SRC0_SRC1_V))); |
| 362 | + DONE; |
| 363 | +}) |
| 364 | + |
219 | 365 | ;; Used by "XS","XC","XD" insn. format: `insn dest, src0, imm/src1`
|
220 |
| -(define_insn "riscv_arcv_apex_dest_ftype_src0_src1" |
221 |
| - [(set (match_operand:SI 0 "register_operand" "=r,r,r") |
222 |
| - (unspec:SI [(match_operand:SI 1 "const_int_operand" "xAVpXS,xAVpXC,xAVpXD") |
223 |
| - (match_operand:SI 2 "register_operand" "r,0,r") |
224 |
| - (match_operand:SI 3 "nonmemory_operand" "B8,I,r")] |
| 366 | +(define_insn "riscv_arcv_apex_<DM:mode>_ftype_<S0M:mode>_<S1M:mode>" |
| 367 | + [(set (match_operand:DM 0 "register_operand" "=r,r,r") |
| 368 | + (unspec:DM [(match_operand:SI 1 "const_int_operand" "xAVpXS,xAVpXC,xAVpXD") |
| 369 | + (match_operand:S0M 2 "register_operand" "r,0,r") |
| 370 | + (match_operand:S1M 3 "nonmemory_operand" "B8,I,r")] |
225 | 371 | UNSPEC_ARCV_APEX_DEST_SRC0_SRC1))]
|
226 | 372 | ""
|
227 | 373 | {
|
|
253 | 399 | [(set_attr "type" "arith,arith,arith")]
|
254 | 400 | )
|
255 | 401 |
|
| 402 | +(define_expand "riscv_arcv_apex_dest_ftype_src0_src1" |
| 403 | + [(set (match_operand 0 "register_operand") |
| 404 | + (unspec [(match_operand:SI 1 "const_int_operand") |
| 405 | + (match_operand 2 "register_operand") |
| 406 | + (match_operand 3 "nonmemory_operand")] |
| 407 | + UNSPEC_ARCV_APEX_DEST_SRC0_SRC1))] |
| 408 | + "" |
| 409 | +{ |
| 410 | + /* Build the SET exactly as it appears above, but with the |
| 411 | + real RTX objects. Every operand already carries its mode, |
| 412 | + so nothing needs to be guessed. The UNSPEC code is |
| 413 | + essential as it tags this RTL with a unique ID, so the |
| 414 | + recognizer can match it to the correct mode-specific |
| 415 | + define_insn. */ |
| 416 | + emit_insn (gen_rtx_SET (operands[0], |
| 417 | + gen_rtx_UNSPEC (GET_MODE (operands[0]), |
| 418 | + gen_rtvec (3, operands[1], |
| 419 | + operands[2], |
| 420 | + operands[3]), |
| 421 | + UNSPEC_ARCV_APEX_DEST_SRC0_SRC1))); |
| 422 | + DONE; |
| 423 | +}) |
0 commit comments