Mercurial > hg > CbC > CbC_gcc
comparison gcc/config/s390/constraints.md @ 111:04ced10e8804
gcc 7
author | kono |
---|---|
date | Fri, 27 Oct 2017 22:46:09 +0900 |
parents | 77e2b8dfacca |
children | 84e7813d76e9 |
comparison
equal
deleted
inserted
replaced
68:561a7518be6b | 111:04ced10e8804 |
---|---|
1 ;; Constraints definitions belonging to the gcc backend for IBM S/390. | 1 ;; Constraints definitions belonging to the gcc backend for IBM S/390. |
2 ;; Copyright (C) 2006, 2007, 2008 Free Software Foundation, Inc. | 2 ;; Copyright (C) 2006-2017 Free Software Foundation, Inc. |
3 ;; Written by Wolfgang Gellerich, using code and information found in | 3 ;; Written by Wolfgang Gellerich, using code and information found in |
4 ;; files s390.md, s390.h, and s390.c. | 4 ;; files s390.md, s390.h, and s390.c. |
5 ;; | 5 ;; |
6 ;; This file is part of GCC. | 6 ;; This file is part of GCC. |
7 ;; | 7 ;; |
27 ;; b -- Memory operand whose address is a symbol reference or a symbol | 27 ;; b -- Memory operand whose address is a symbol reference or a symbol |
28 ;; reference + constant which can be proven to be naturally aligned. | 28 ;; reference + constant which can be proven to be naturally aligned. |
29 ;; c -- Condition code register 33. | 29 ;; c -- Condition code register 33. |
30 ;; d -- Any register from 0 to 15. | 30 ;; d -- Any register from 0 to 15. |
31 ;; f -- Floating point registers. | 31 ;; f -- Floating point registers. |
32 ;; j -- Multiple letter constraint for constant scalar and vector values | |
33 ;; j00: constant zero scalar or vector | |
34 ;; jm1: constant scalar or vector with all bits set | |
35 ;; jxx: contiguous bitmask of 0 or 1 in all vector elements | |
36 ;; jyy: constant consisting of byte chunks being either 0 or 0xff | |
37 ;; jKK: constant vector with all elements having the same value and | |
38 ;; matching K constraint | |
39 ;; jm6: An integer operand with the lowest order 6 bits all ones. | |
32 ;; t -- Access registers 36 and 37. | 40 ;; t -- Access registers 36 and 37. |
41 ;; v -- Vector registers v0-v31. | |
33 ;; C -- A signed 8-bit constant (-128..127) | 42 ;; C -- A signed 8-bit constant (-128..127) |
34 ;; D -- An unsigned 16-bit constant (0..65535) | 43 ;; D -- An unsigned 16-bit constant (0..65535) |
35 ;; G -- Const double zero operand | 44 ;; G -- Const double zero operand |
36 ;; I -- An 8-bit constant (0..255). | 45 ;; I -- An 8-bit constant (0..255). |
37 ;; J -- A 12-bit constant (0..4095). | 46 ;; J -- A 12-bit constant (0..4095). |
43 ;; N -- Multiple letter constraint followed by 4 parameter letters. | 52 ;; N -- Multiple letter constraint followed by 4 parameter letters. |
44 ;; 0..9,x: number of the part counting from most to least significant | 53 ;; 0..9,x: number of the part counting from most to least significant |
45 ;; H,Q: mode of the part | 54 ;; H,Q: mode of the part |
46 ;; D,S,H: mode of the containing operand | 55 ;; D,S,H: mode of the containing operand |
47 ;; 0,F: value of the other parts (F - all bits set) | 56 ;; 0,F: value of the other parts (F - all bits set) |
57 ;; -- | |
58 ;; xxDq satisfies s390_contiguous_bitmask_p for DImode | |
59 ;; (with possible wraparound of the one-bit range) | |
60 ;; xxSw satisfies s390_contiguous_bitmask_p for SImode | |
61 ;; (with possible wraparound of the one-bit range) | |
62 ;; xxSq satisfies s390_contiguous_bitmask_nowrap_p for SImode | |
63 ;; (without wraparound of the one-bit range) | |
48 ;; | 64 ;; |
49 ;; The constraint matches if the specified part of a constant | 65 ;; The constraint matches if the specified part of a constant |
50 ;; has a value different from its other parts. If the letter x | 66 ;; has a value different from its other parts. If the letter x |
51 ;; is specified instead of a part number, the constraint matches | 67 ;; is specified instead of a part number, the constraint matches |
52 ;; if there is any single part with non-default value. | 68 ;; if there is any single part with non-default value. |
64 ;; A -- Multiple letter constraint followed by Q, R, S, or T: | 80 ;; A -- Multiple letter constraint followed by Q, R, S, or T: |
65 ;; Offsettable memory reference of type specified by second letter. | 81 ;; Offsettable memory reference of type specified by second letter. |
66 ;; B -- Multiple letter constraint followed by Q, R, S, or T: | 82 ;; B -- Multiple letter constraint followed by Q, R, S, or T: |
67 ;; Memory reference of the type specified by second letter that | 83 ;; Memory reference of the type specified by second letter that |
68 ;; does *not* refer to a literal pool entry. | 84 ;; does *not* refer to a literal pool entry. |
69 ;; U -- Pointer with short displacement. (deprecated - use ZQZR) | 85 ;; U -- Pointer with short displacement. (deprecated - use ZR) |
70 ;; W -- Pointer with long displacement. (deprecated - use ZSZT) | 86 ;; W -- Pointer with long displacement. (deprecated - use ZT) |
71 ;; Y -- Shift count operand. | 87 ;; Y -- Address style operand without index. |
72 ;; ZQ -- Pointer without index register and with short displacement. | 88 ;; ZQ -- Pointer without index register and with short displacement. |
73 ;; ZR -- Pointer with index register and short displacement. | 89 ;; ZR -- Pointer with index register and short displacement. |
74 ;; ZS -- Pointer without index register but with long displacement. | 90 ;; ZS -- Pointer without index register but with long displacement. |
75 ;; ZT -- Pointer with index register and long displacement. | 91 ;; ZT -- Pointer with index register and long displacement. |
76 ;; | 92 ;; |
105 "ACCESS_REGS" | 121 "ACCESS_REGS" |
106 "@internal | 122 "@internal |
107 Access registers 36 and 37") | 123 Access registers 36 and 37") |
108 | 124 |
109 | 125 |
126 (define_register_constraint "v" | |
127 "VEC_REGS" | |
128 "Vector registers v0-v31") | |
129 | |
130 | |
110 ;; | 131 ;; |
111 ;; General constraints for constants. | 132 ;; General constraints for constants. |
112 ;; | 133 ;; |
113 | 134 |
114 (define_constraint "C" | 135 (define_constraint "C" |
171 (and (match_code "const_int") | 192 (and (match_code "const_int") |
172 (match_test "legitimate_reload_constant_p (GEN_INT (ival))"))) | 193 (match_test "legitimate_reload_constant_p (GEN_INT (ival))"))) |
173 | 194 |
174 | 195 |
175 (define_address_constraint "Y" | 196 (define_address_constraint "Y" |
176 "Shift count operand" | 197 "Address style operand without index register" |
177 | 198 |
178 ;; Simply check for the basic form of a shift count. Reload will | 199 ;; Simply check for base + offset style operands. Reload will take |
179 ;; take care of making sure we have a proper base register. | 200 ;; care of making sure we have a proper base register. |
180 | 201 |
181 (match_test "s390_decompose_shift_count (op, NULL, NULL)" )) | 202 (match_test "s390_decompose_addrstyle_without_index (op, NULL, NULL)" )) |
182 | 203 |
183 | 204 |
184 ;; N -- Multiple letter constraint followed by 4 parameter letters. | 205 ;; N -- Multiple letter constraint followed by 4 parameter letters. |
185 ;; 0..9,x: number of the part counting from most to least significant | 206 ;; 0..9,x: number of the part counting from most to least significant |
186 ;; H,Q: mode of the part | 207 ;; H,Q: mode of the part |
328 (define_constraint "NxQH0" | 349 (define_constraint "NxQH0" |
329 "@internal" | 350 "@internal" |
330 (and (match_code "const_int") | 351 (and (match_code "const_int") |
331 (match_test "s390_N_constraint_str (\"xQH0\", ival)"))) | 352 (match_test "s390_N_constraint_str (\"xQH0\", ival)"))) |
332 | 353 |
333 | 354 (define_constraint "NxxDw" |
334 | 355 "@internal" |
356 (and (match_code "const_int") | |
357 (match_test "s390_contiguous_bitmask_p (ival, true, 64, NULL, NULL)"))) | |
358 | |
359 (define_constraint "NxxSq" | |
360 "@internal" | |
361 (and (match_code "const_int") | |
362 (match_test "s390_contiguous_bitmask_p (ival, false, 32, NULL, NULL)"))) | |
363 | |
364 (define_constraint "NxxSw" | |
365 "@internal" | |
366 (and (match_code "const_int") | |
367 (match_test "s390_contiguous_bitmask_p (ival, true, 32, NULL, NULL)"))) | |
335 | 368 |
336 ;; | 369 ;; |
337 ;; Double-letter constraints starting with O follow. | 370 ;; Double-letter constraints starting with O follow. |
338 ;; | 371 ;; |
339 | 372 |
363 the extended-immediate facility." | 396 the extended-immediate facility." |
364 (and (match_code "const_int") | 397 (and (match_code "const_int") |
365 (match_test "s390_O_constraint_str ('n', ival)"))) | 398 (match_test "s390_O_constraint_str ('n', ival)"))) |
366 | 399 |
367 | 400 |
368 | 401 ;; |
402 ;; Vector constraints follow. | |
403 ;; | |
404 | |
405 (define_constraint "j00" | |
406 "Zero scalar or vector constant" | |
407 (match_test "op == CONST0_RTX (GET_MODE (op))")) | |
408 | |
409 (define_constraint "jm1" | |
410 "All one bit scalar or vector constant" | |
411 (match_test "op == CONSTM1_RTX (GET_MODE (op))")) | |
412 | |
413 ; vector generate mask operand - support for up to 64 bit elements | |
414 (define_constraint "jxx" | |
415 "@internal" | |
416 (and (match_code "const_vector") | |
417 (match_test "s390_contiguous_bitmask_vector_p (op, NULL, NULL)"))) | |
418 | |
419 ; vector generate byte mask operand - this is only supposed to deal | |
420 ; with real vectors 128 bit values of being either 0 or -1 are handled | |
421 ; with j00 and jm1 | |
422 (define_constraint "jyy" | |
423 "@internal" | |
424 (and (match_code "const_vector") | |
425 (match_test "s390_bytemask_vector_p (op, NULL)"))) | |
426 | |
427 ; vector replicate immediate operand - support for up to 64 bit elements | |
428 (define_constraint "jKK" | |
429 "@internal" | |
430 (and (and (and (match_code "const_vector") | |
431 (match_test "const_vec_duplicate_p (op)")) | |
432 (match_test "GET_MODE_UNIT_SIZE (GET_MODE (op)) <= 8")) | |
433 (match_test "satisfies_constraint_K (XVECEXP (op, 0, 0))"))) | |
434 | |
435 (define_constraint "jm6" | |
436 "@internal An integer operand with the lowest order 6 bits all ones." | |
437 (match_operand 0 "const_int_6bitset_operand")) | |
369 | 438 |
370 ;; | 439 ;; |
371 ;; Memory constraints follow. | 440 ;; Memory constraints follow. |
372 ;; | 441 ;; |
373 | 442 |
395 "Memory reference whose address is a naturally aligned symbol reference." | 464 "Memory reference whose address is a naturally aligned symbol reference." |
396 (match_test "MEM_P (op) | 465 (match_test "MEM_P (op) |
397 && s390_check_symref_alignment (XEXP (op, 0), | 466 && s390_check_symref_alignment (XEXP (op, 0), |
398 GET_MODE_SIZE (GET_MODE (op)))")) | 467 GET_MODE_SIZE (GET_MODE (op)))")) |
399 | 468 |
400 (define_memory_constraint "e" | |
401 "Matches all memory references available on the current architecture | |
402 level. This constraint will never be used and using it in an inline | |
403 assembly is *always* a bug since there is no instruction accepting all | |
404 those addresses. It just serves as a placeholder for a generic memory | |
405 constraint." | |
406 (match_test "strict_memory_address_p (GET_MODE (op), op)")) | |
407 | |
408 ; This defines 'm' as normal memory constraint. This is only possible | 469 ; This defines 'm' as normal memory constraint. This is only possible |
409 ; since the standard memory constraint is re-defined in s390.h using | 470 ; since the standard memory constraint is re-defined in s390.h using |
410 ; the TARGET_MEM_CONSTRAINT macro. | 471 ; the TARGET_MEM_CONSTRAINT macro. |
411 (define_memory_constraint "m" | 472 (define_memory_constraint "m" |
412 "Matches the most general memory address for pre-z10 machines." | 473 "Matches the most general memory address for pre-z10 machines." |
413 (match_test "s390_mem_constraint (\"R\", op) | 474 (match_test "s390_mem_constraint (\"T\", op)")) |
414 || s390_mem_constraint (\"T\", op)")) | |
415 | 475 |
416 (define_memory_constraint "AQ" | 476 (define_memory_constraint "AQ" |
417 "@internal | 477 "@internal |
418 Offsettable memory reference without index register and with short displacement" | 478 Offsettable memory reference without index register and with short displacement" |
419 (match_test "s390_mem_constraint (\"AQ\", op)")) | 479 (match_test "s390_mem_constraint (\"AQ\", op)")) |
465 does *not* refer to a literal pool entry. " | 525 does *not* refer to a literal pool entry. " |
466 (match_test "s390_mem_constraint (\"BT\", op)")) | 526 (match_test "s390_mem_constraint (\"BT\", op)")) |
467 | 527 |
468 | 528 |
469 (define_address_constraint "U" | 529 (define_address_constraint "U" |
470 "Pointer with short displacement. (deprecated - use ZQZR)" | 530 "Pointer with short displacement. (deprecated - use ZR)" |
471 (match_test "s390_mem_constraint (\"U\", op)")) | 531 (match_test "s390_mem_constraint (\"ZR\", op)")) |
472 | 532 |
473 (define_address_constraint "W" | 533 (define_address_constraint "W" |
474 "Pointer with long displacement. (deprecated - use ZSZT)" | 534 "Pointer with long displacement. (deprecated - use ZT)" |
475 (match_test "s390_mem_constraint (\"W\", op)")) | 535 (match_test "s390_mem_constraint (\"ZT\", op)")) |
476 | 536 |
477 | 537 |
478 (define_address_constraint "ZQ" | 538 (define_address_constraint "ZQ" |
479 "Pointer without index register and with short displacement." | 539 "Pointer without index register and with short displacement." |
480 (match_test "s390_mem_constraint (\"ZQ\", op)")) | 540 (match_test "s390_mem_constraint (\"ZQ\", op)")) |