blob: f3cb47fd13a50fbca89decca8597ca568cbe3bcf [file] [log] [blame]
Patrick Williamsd8c66bc2016-06-20 12:57:21 -05001From 1d67120d95c2c6e0ed4f7357d1cc62887eaba463 Mon Sep 17 00:00:00 2001
2From: sandra <sandra@138bc75d-0d04-0410-961f-82ee72b054a4>
3Date: Tue, 12 May 2015 15:57:22 +0000
4Subject: [PATCH] 2015-05-12 Chung-Lin Tang <cltang@codesourcery.com>
5 Sandra Loosemore <sandra@codesourcery.com>
6
7 gcc/
8 * config/nios2/nios2.h (enum reg_class): Add IJMP_REGS enum
9 value.
10 (REG_CLASS_NAMES): Add "IJMP_REGS".
11 (REG_CLASS_CONTENTS): Add new entry for IJMP_REGS.
12 * config/nios2/nios2.md (indirect_jump,*tablejump): Adjust to
13 use new "c" register constraint.
14 * config/nios2/constraint.md (c): New register constraint
15 corresponding to IJMP_REGS.
16
17
18
19git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@223082 138bc75d-0d04-0410-961f-82ee72b054a4
20Signed-off-by: Marek Vasut <marex@denx.de>
21Upstream-Status: Backport [ git://gcc.gnu.org/git/gcc.git 1d67120d95c2c6e0ed4f7357d1cc62887eaba463 ]
22---
23 gcc/ChangeLog | 12 ++++++++++++
24 gcc/config/nios2/constraints.md | 3 +++
25 gcc/config/nios2/nios2.h | 11 +++++++----
26 gcc/config/nios2/nios2.md | 4 ++--
27 4 files changed, 24 insertions(+), 6 deletions(-)
28
29diff --git a/gcc/config/nios2/constraints.md b/gcc/config/nios2/constraints.md
30index f4bd9f7..735f892 100644
31--- a/gcc/config/nios2/constraints.md
32+++ b/gcc/config/nios2/constraints.md
33@@ -39,6 +39,9 @@
34
35 ;; Register constraints
36
37+(define_register_constraint "c" "IJMP_REGS"
38+ "A register suitable for an indirect jump.")
39+
40 (define_register_constraint "j" "SIB_REGS"
41 "A register suitable for an indirect sibcall.")
42
43diff --git a/gcc/config/nios2/nios2.h b/gcc/config/nios2/nios2.h
44index 510ab5f..ac33978 100644
45--- a/gcc/config/nios2/nios2.h
46+++ b/gcc/config/nios2/nios2.h
47@@ -173,6 +173,7 @@ enum reg_class
48 {
49 NO_REGS,
50 SIB_REGS,
51+ IJMP_REGS,
52 GP_REGS,
53 ALL_REGS,
54 LIM_REG_CLASSES
55@@ -183,6 +184,7 @@ enum reg_class
56 #define REG_CLASS_NAMES \
57 { "NO_REGS", \
58 "SIB_REGS", \
59+ "IJMP_REGS", \
60 "GP_REGS", \
61 "ALL_REGS" }
62
63@@ -190,10 +192,11 @@ enum reg_class
64
65 #define REG_CLASS_CONTENTS \
66 { \
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} \
76 }
77
78
79diff --git a/gcc/config/nios2/nios2.md b/gcc/config/nios2/nios2.md
80index 7b35d269..36ef101 100644
81--- a/gcc/config/nios2/nios2.md
82+++ b/gcc/config/nios2/nios2.md
83@@ -697,7 +697,7 @@
84 ; check or adjust for overflow.
85
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"))]
89 ""
90 "jmp\\t%0"
91 [(set_attr "type" "control")])
92@@ -811,7 +811,7 @@
93
94 (define_insn "*tablejump"
95 [(set (pc)
96- (match_operand:SI 0 "register_operand" "r"))
97+ (match_operand:SI 0 "register_operand" "c"))
98 (use (label_ref (match_operand 1 "" "")))]
99 ""
100 "jmp\\t%0"
101--
1022.7.0
103