summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChung-Lin Tang <cltang@codesourcery.com>2015-05-12 15:57:22 +0000
committerSandra Loosemore <sandra@gcc.gnu.org>2015-05-12 11:57:22 -0400
commit3c8c9f0daf922b6dd1f802d4dfd8b9387031b190 (patch)
tree1ac0c89cf96ca15ce0da3e94b077f3db5313db15
parenta92a1c274c7a8e88920f67f045dd5314f912a6b2 (diff)
downloadgcc-3c8c9f0daf922b6dd1f802d4dfd8b9387031b190.tar.gz
nios2.h (enum reg_class): Add IJMP_REGS enum value.
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. Co-Authored-By: Sandra Loosemore <sandra@codesourcery.com> From-SVN: r223082
-rw-r--r--gcc/ChangeLog12
-rw-r--r--gcc/config/nios2/constraints.md3
-rw-r--r--gcc/config/nios2/nios2.h11
-rw-r--r--gcc/config/nios2/nios2.md4
4 files changed, 24 insertions, 6 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 816f3ab2760..8d3887a7445 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,15 @@
+2015-05-12 Chung-Lin Tang <cltang@codesourcery.com>
+ Sandra Loosemore <sandra@codesourcery.com>
+
+ * 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.
+
2015-05-12 Segher Boessenkool <segher@kernel.crashing.org>
* config/rs6000/rs6000.md (*rotlsi3_internal4, *rotlsi3_internal5,
diff --git a/gcc/config/nios2/constraints.md b/gcc/config/nios2/constraints.md
index f4bd9f70e95..735f892d524 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 510ab5fc7fe..ac339781b6c 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 7b35d269c1c..36ef101443b 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"