nios2.h (enum reg_class): Add IJMP_REGS enum value.
authorChung-Lin Tang <cltang@codesourcery.com>
Tue, 12 May 2015 15:57:22 +0000 (15:57 +0000)
committerSandra Loosemore <sandra@gcc.gnu.org>
Tue, 12 May 2015 15:57:22 +0000 (11:57 -0400)
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

gcc/ChangeLog
gcc/config/nios2/constraints.md
gcc/config/nios2/nios2.h
gcc/config/nios2/nios2.md

index 816f3ab2760e85a3cf2a6f8bb4bcd286d6fa489c..8d3887a744557ac45b03cbdd5bc8b2040c2e4529 100644 (file)
@@ -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,
index f4bd9f70e956aa95c79d8e093ae3654e3dc307e3..735f892d5240841003269009eac04855c5df7c37 100644 (file)
@@ -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.")
 
index 510ab5fc7fe50593161587031151e760b497bc46..ac339781b6c55d3ac973531c9e7b60e7e3bb917d 100644 (file)
@@ -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}                   \
   }
 
 
index 7b35d269c1c824e247c3aed06dfa22ea0ec55ef7..36ef101443b1cfbd52bf79a646f0b0381e3460c0 100644 (file)
 ; 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")])
 
 (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"