annotate gcc/config/riscv/constraints.md @ 131:84e7813d76e9

gcc-8.2
author mir3636
date Thu, 25 Oct 2018 07:37:49 +0900
parents 04ced10e8804
children 1830386684a0
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
111
kono
parents:
diff changeset
1 ;; Constraint definitions for RISC-V target.
131
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
2 ;; Copyright (C) 2011-2018 Free Software Foundation, Inc.
111
kono
parents:
diff changeset
3 ;; Contributed by Andrew Waterman (andrew@sifive.com).
kono
parents:
diff changeset
4 ;; Based on MIPS target for GNU compiler.
kono
parents:
diff changeset
5 ;;
kono
parents:
diff changeset
6 ;; This file is part of GCC.
kono
parents:
diff changeset
7 ;;
kono
parents:
diff changeset
8 ;; GCC is free software; you can redistribute it and/or modify
kono
parents:
diff changeset
9 ;; it under the terms of the GNU General Public License as published by
kono
parents:
diff changeset
10 ;; the Free Software Foundation; either version 3, or (at your option)
kono
parents:
diff changeset
11 ;; any later version.
kono
parents:
diff changeset
12 ;;
kono
parents:
diff changeset
13 ;; GCC is distributed in the hope that it will be useful,
kono
parents:
diff changeset
14 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
kono
parents:
diff changeset
15 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
kono
parents:
diff changeset
16 ;; GNU General Public License for more details.
kono
parents:
diff changeset
17 ;;
kono
parents:
diff changeset
18 ;; You should have received a copy of the GNU General Public License
kono
parents:
diff changeset
19 ;; along with GCC; see the file COPYING3. If not see
kono
parents:
diff changeset
20 ;; <http://www.gnu.org/licenses/>.
kono
parents:
diff changeset
21
kono
parents:
diff changeset
22 ;; Register constraints
kono
parents:
diff changeset
23
kono
parents:
diff changeset
24 (define_register_constraint "f" "TARGET_HARD_FLOAT ? FP_REGS : NO_REGS"
kono
parents:
diff changeset
25 "A floating-point register (if available).")
kono
parents:
diff changeset
26
kono
parents:
diff changeset
27 (define_register_constraint "j" "SIBCALL_REGS"
kono
parents:
diff changeset
28 "@internal")
kono
parents:
diff changeset
29
kono
parents:
diff changeset
30 ;; Avoid using register t0 for JALR's argument, because for some
kono
parents:
diff changeset
31 ;; microarchitectures that is a return-address stack hint.
kono
parents:
diff changeset
32 (define_register_constraint "l" "JALR_REGS"
kono
parents:
diff changeset
33 "@internal")
kono
parents:
diff changeset
34
kono
parents:
diff changeset
35 ;; General constraints
kono
parents:
diff changeset
36
kono
parents:
diff changeset
37 (define_constraint "I"
kono
parents:
diff changeset
38 "An I-type 12-bit signed immediate."
kono
parents:
diff changeset
39 (and (match_code "const_int")
kono
parents:
diff changeset
40 (match_test "SMALL_OPERAND (ival)")))
kono
parents:
diff changeset
41
kono
parents:
diff changeset
42 (define_constraint "J"
kono
parents:
diff changeset
43 "Integer zero."
kono
parents:
diff changeset
44 (and (match_code "const_int")
kono
parents:
diff changeset
45 (match_test "ival == 0")))
kono
parents:
diff changeset
46
kono
parents:
diff changeset
47 (define_constraint "K"
kono
parents:
diff changeset
48 "A 5-bit unsigned immediate for CSR access instructions."
kono
parents:
diff changeset
49 (and (match_code "const_int")
kono
parents:
diff changeset
50 (match_test "IN_RANGE (ival, 0, 31)")))
kono
parents:
diff changeset
51
kono
parents:
diff changeset
52 ;; Floating-point constant +0.0, used for FCVT-based moves when FMV is
kono
parents:
diff changeset
53 ;; not available in RV32.
kono
parents:
diff changeset
54 (define_constraint "G"
kono
parents:
diff changeset
55 "@internal"
kono
parents:
diff changeset
56 (and (match_code "const_double")
kono
parents:
diff changeset
57 (match_test "op == CONST0_RTX (mode)")))
kono
parents:
diff changeset
58
kono
parents:
diff changeset
59 (define_memory_constraint "A"
kono
parents:
diff changeset
60 "An address that is held in a general-purpose register."
kono
parents:
diff changeset
61 (and (match_code "mem")
kono
parents:
diff changeset
62 (match_test "GET_CODE(XEXP(op,0)) == REG")))
kono
parents:
diff changeset
63
kono
parents:
diff changeset
64 (define_constraint "S"
kono
parents:
diff changeset
65 "@internal
kono
parents:
diff changeset
66 A constant call address."
kono
parents:
diff changeset
67 (match_operand 0 "absolute_symbolic_operand"))
kono
parents:
diff changeset
68
kono
parents:
diff changeset
69 (define_constraint "U"
kono
parents:
diff changeset
70 "@internal
kono
parents:
diff changeset
71 A PLT-indirect call address."
kono
parents:
diff changeset
72 (match_operand 0 "plt_symbolic_operand"))
kono
parents:
diff changeset
73
kono
parents:
diff changeset
74 (define_constraint "T"
kono
parents:
diff changeset
75 "@internal
kono
parents:
diff changeset
76 A constant @code{move_operand}."
kono
parents:
diff changeset
77 (and (match_operand 0 "move_operand")
kono
parents:
diff changeset
78 (match_test "CONSTANT_P (op)")))