1 From 920a898d2a04933c13eb808a513bc5822e91f70a Mon Sep 17 00:00:00 2001
2 From: sandra <sandra@138bc75d-0d04-0410-961f-82ee72b054a4>
3 Date: Tue, 12 May 2015 15:57:22 +0000
4 Subject: [PATCH] gcc/nios2: Add IJMP_REGS enum
6 2015-05-12 Chung-Lin Tang <cltang@codesourcery.com>
7 Sandra Loosemore <sandra@codesourcery.com>
10 * config/nios2/nios2.h (enum reg_class): Add IJMP_REGS enum
12 (REG_CLASS_NAMES): Add "IJMP_REGS".
13 (REG_CLASS_CONTENTS): Add new entry for IJMP_REGS.
14 * config/nios2/nios2.md (indirect_jump,*tablejump): Adjust to
15 use new "c" register constraint.
16 * config/nios2/constraint.md (c): New register constraint
17 corresponding to IJMP_REGS.
19 git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@223082 138bc75d-0d04-0410-961f-82ee72b054a4
21 [Romain: rebase on gcc 5.4]
22 Signed-off-by: Romain Naour <romain.naour@gmail.com>
24 gcc/config/nios2/constraints.md | 3 +++
25 gcc/config/nios2/nios2.h | 11 +++++++----
26 gcc/config/nios2/nios2.md | 4 ++--
27 3 files changed, 12 insertions(+), 6 deletions(-)
29 diff --git a/gcc/config/nios2/constraints.md b/gcc/config/nios2/constraints.md
30 index f4bd9f7..735f892 100644
31 --- a/gcc/config/nios2/constraints.md
32 +++ b/gcc/config/nios2/constraints.md
35 ;; Register constraints
37 +(define_register_constraint "c" "IJMP_REGS"
38 + "A register suitable for an indirect jump.")
40 (define_register_constraint "j" "SIB_REGS"
41 "A register suitable for an indirect sibcall.")
43 diff --git a/gcc/config/nios2/nios2.h b/gcc/config/nios2/nios2.h
44 index 117983d..7c329ae 100644
45 --- a/gcc/config/nios2/nios2.h
46 +++ b/gcc/config/nios2/nios2.h
47 @@ -173,6 +173,7 @@ enum reg_class
55 @@ -183,6 +184,7 @@ enum reg_class
56 #define REG_CLASS_NAMES \
63 @@ -190,10 +192,11 @@ enum reg_class
65 #define REG_CLASS_CONTENTS \
67 - /* NO_REGS */ { 0, 0}, \
68 - /* SIB_REGS */ { 0xfe0c, 0}, \
69 - /* GP_REGS */ {~0, 0}, \
70 - /* ALL_REGS */ {~0,~0} \
71 + /* NO_REGS */ { 0, 0}, \
72 + /* SIB_REGS */ { 0xfe0c, 0}, \
73 + /* IJMP_REGS */ { 0x7fffffff, 0}, \
74 + /* GP_REGS */ {~0, 0}, \
75 + /* ALL_REGS */ {~0,~0} \
79 diff --git a/gcc/config/nios2/nios2.md b/gcc/config/nios2/nios2.md
80 index 7b35d269..36ef101 100644
81 --- a/gcc/config/nios2/nios2.md
82 +++ b/gcc/config/nios2/nios2.md
84 ; check or adjust for overflow.
86 (define_insn "indirect_jump"
87 - [(set (pc) (match_operand:SI 0 "register_operand" "r"))]
88 + [(set (pc) (match_operand:SI 0 "register_operand" "c"))]
91 [(set_attr "type" "control")])
94 (define_insn "*tablejump"
96 - (match_operand:SI 0 "register_operand" "r"))
97 + (match_operand:SI 0 "register_operand" "c"))
98 (use (label_ref (match_operand 1 "" "")))]