]>
Commit | Line | Data |
---|---|---|
3965b35f | 1 | ;; Constraint definitions for OpenRISC |
a5544970 | 2 | ;; Copyright (C) 2018-2019 Free Software Foundation, Inc. |
3965b35f SH |
3 | ;; Contributed by Stafford Horne |
4 | ||
5 | ;; This file is part of GCC. | |
6 | ||
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 | |
9 | ;; by the Free Software Foundation; either version 3, or (at your | |
10 | ;; option) any later version. | |
11 | ||
12 | ;; GCC is distributed in the hope that it will be useful, but WITHOUT | |
13 | ;; ANY WARRANTY; without even the implied warranty of MERCHANTABILITY | |
14 | ;; or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public | |
15 | ;; License for more details. | |
16 | ||
17 | ;; You should have received a copy of the GNU General Public License | |
18 | ;; along with GCC; see the file COPYING3. If not see | |
19 | ;; <http://www.gnu.org/licenses/>. | |
20 | ||
21 | ;; ------------------------------------------------------------------------- | |
22 | ;; Constraints | |
23 | ;; ------------------------------------------------------------------------- | |
24 | ||
25 | ; We use: | |
26 | ; c - sibcall registers | |
27 | ; I - constant signed 16-bit | |
28 | ; K - constant unsigned 16-bit | |
29 | ; M - constant signed 16-bit shifted left 16-bits (l.movhi) | |
30 | ; O - constant zero | |
31 | ||
32 | (define_register_constraint "c" "SIBCALL_REGS" | |
33 | "Registers which can hold a sibling call address") | |
34 | ||
35 | ;; Immediates | |
36 | (define_constraint "I" | |
37 | "A signed 16-bit immediate in the range -32768 to 32767." | |
38 | (and (match_code "const_int") | |
39 | (match_test "IN_RANGE (ival, -32768, 32767)"))) | |
40 | ||
41 | (define_constraint "K" | |
42 | "An unsigned 16-bit immediate in the range 0 to 0xffff." | |
43 | (and (match_code "const_int") | |
44 | (match_test "IN_RANGE (ival, 0, 65535)"))) | |
45 | ||
46 | (define_constraint "M" | |
47 | "A shifted signed 16-bit constant suitable for l.movhi." | |
48 | (and (match_code "const_int") | |
49 | (match_test "(ival & 0xffff) == 0 | |
50 | && (ival >> 31 == -1 || ival >> 31 == 0)"))) | |
51 | ||
52 | (define_constraint "O" | |
53 | "The constant zero" | |
54 | (and (match_code "const_int") | |
55 | (match_test "ival == 0"))) |