summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/gcc/gcc-5.4/0052-nios2-use-ret-with-r31.patch
blob: f3cb47fd13a50fbca89decca8597ca568cbe3bcf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
From 1d67120d95c2c6e0ed4f7357d1cc62887eaba463 Mon Sep 17 00:00:00 2001
From: sandra <sandra@138bc75d-0d04-0410-961f-82ee72b054a4>
Date: Tue, 12 May 2015 15:57:22 +0000
Subject: [PATCH] 2015-05-12  Chung-Lin Tang  <cltang@codesourcery.com>
 Sandra Loosemore <sandra@codesourcery.com>

	gcc/
	* config/nios2/nios2.h (enum reg_class): Add IJMP_REGS enum
	value.
	(REG_CLASS_NAMES): Add "IJMP_REGS".
	(REG_CLASS_CONTENTS): Add new entry for IJMP_REGS.
	* config/nios2/nios2.md (indirect_jump,*tablejump): Adjust to
	use new "c" register constraint.
	* config/nios2/constraint.md (c): New register constraint
	corresponding to IJMP_REGS.



git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@223082 138bc75d-0d04-0410-961f-82ee72b054a4
Signed-off-by: Marek Vasut <marex@denx.de>
Upstream-Status: Backport [ git://gcc.gnu.org/git/gcc.git 1d67120d95c2c6e0ed4f7357d1cc62887eaba463 ]
---
 gcc/ChangeLog                   | 12 ++++++++++++
 gcc/config/nios2/constraints.md |  3 +++
 gcc/config/nios2/nios2.h        | 11 +++++++----
 gcc/config/nios2/nios2.md       |  4 ++--
 4 files changed, 24 insertions(+), 6 deletions(-)

diff --git a/gcc/config/nios2/constraints.md b/gcc/config/nios2/constraints.md
index f4bd9f7..735f892 100644
--- a/gcc/config/nios2/constraints.md
+++ b/gcc/config/nios2/constraints.md
@@ -39,6 +39,9 @@
 
 ;; Register constraints
 
+(define_register_constraint "c" "IJMP_REGS"
+  "A register suitable for an indirect jump.")
+
 (define_register_constraint "j" "SIB_REGS"
   "A register suitable for an indirect sibcall.")
 
diff --git a/gcc/config/nios2/nios2.h b/gcc/config/nios2/nios2.h
index 510ab5f..ac33978 100644
--- a/gcc/config/nios2/nios2.h
+++ b/gcc/config/nios2/nios2.h
@@ -173,6 +173,7 @@ enum reg_class
 {
   NO_REGS,
   SIB_REGS,
+  IJMP_REGS,
   GP_REGS,
   ALL_REGS,
   LIM_REG_CLASSES
@@ -183,6 +184,7 @@ enum reg_class
 #define REG_CLASS_NAMES   \
   {  "NO_REGS",		  \
      "SIB_REGS",	  \
+     "IJMP_REGS",	  \
      "GP_REGS",           \
      "ALL_REGS" }
 
@@ -190,10 +192,11 @@ enum reg_class
 
 #define REG_CLASS_CONTENTS			\
   {						\
-    /* NO_REGS  */ { 0, 0},			\
-    /* SIB_REGS */ { 0xfe0c, 0},		\
-    /* GP_REGS  */ {~0, 0},			\
-    /* ALL_REGS */ {~0,~0}			\
+    /* NO_REGS    */ { 0, 0},			\
+    /* SIB_REGS   */ { 0xfe0c, 0},		\
+    /* IJMP_REGS  */ { 0x7fffffff, 0},		\
+    /* GP_REGS    */ {~0, 0},			\
+    /* ALL_REGS   */ {~0,~0}			\
   }
 
 
diff --git a/gcc/config/nios2/nios2.md b/gcc/config/nios2/nios2.md
index 7b35d269..36ef101 100644
--- a/gcc/config/nios2/nios2.md
+++ b/gcc/config/nios2/nios2.md
@@ -697,7 +697,7 @@
 ; check or adjust for overflow.
 
 (define_insn "indirect_jump"
-  [(set (pc) (match_operand:SI 0 "register_operand" "r"))]
+  [(set (pc) (match_operand:SI 0 "register_operand" "c"))]
   ""
   "jmp\\t%0"
   [(set_attr "type" "control")])
@@ -811,7 +811,7 @@
 
 (define_insn "*tablejump"
   [(set (pc)
-        (match_operand:SI 0 "register_operand" "r"))
+        (match_operand:SI 0 "register_operand" "c"))
    (use (label_ref (match_operand 1 "" "")))]
   ""
   "jmp\\t%0"
-- 
2.7.0