aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorDJ Delorie <dj@redhat.com>2015-06-05 01:00:05 -0400
committerDJ Delorie <dj@gcc.gnu.org>2015-06-05 01:00:05 -0400
commit14ae1d88b337dcd79f6bfe29263b8a8ae07c38b3 (patch)
treeb9a36265a813a664354fe926455cefe5075688df /gcc
parentb1ada49be04014013fb915d5a056bf7facd7a5f7 (diff)
downloadgcc-14ae1d88b337dcd79f6bfe29263b8a8ae07c38b3.zip
gcc-14ae1d88b337dcd79f6bfe29263b8a8ae07c38b3.tar.gz
gcc-14ae1d88b337dcd79f6bfe29263b8a8ae07c38b3.tar.bz2
msp430.md (movsi_s): New.
* config/msp430/msp430.md (movsi_s): New. Special case for storing a 20-bit symbol into a 32-bit register. * config/msp430/msp430.c (msp430_subreg): Add support for it. * config/msp430/predicates.md (msp430_symbol_operand): New. From-SVN: r224145
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog7
-rw-r--r--gcc/config/msp430/msp430.c7
-rw-r--r--gcc/config/msp430/msp430.md13
-rw-r--r--gcc/config/msp430/predicates.md4
4 files changed, 31 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 2ad6068..a052bd3 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,10 @@
+2015-06-04 DJ Delorie <dj@redhat.com>
+
+ * config/msp430/msp430.md (movsi_s): New. Special case for
+ storing a 20-bit symbol into a 32-bit register.
+ * config/msp430/msp430.c (msp430_subreg): Add support for it.
+ * config/msp430/predicates.md (msp430_symbol_operand): New.
+
2015-06-04 Sriraman Tallam <tmsriram@google.com>
* c-family/c-common.c (noplt): New attribute.
diff --git a/gcc/config/msp430/msp430.c b/gcc/config/msp430/msp430.c
index f99cb60..1c18047 100644
--- a/gcc/config/msp430/msp430.c
+++ b/gcc/config/msp430/msp430.c
@@ -2374,6 +2374,13 @@ msp430_subreg (machine_mode mode, rtx r, machine_mode omode, int byte)
}
else if (GET_CODE (r) == MEM)
rv = adjust_address (r, mode, byte);
+ else if (GET_CODE (r) == SYMBOL_REF
+ && (byte == 0 || byte == 2)
+ && mode == HImode)
+ {
+ rv = gen_rtx_ZERO_EXTRACT (HImode, r, GEN_INT (16), GEN_INT (8*byte));
+ rv = gen_rtx_CONST (HImode, r);
+ }
else
rv = simplify_gen_subreg (mode, r, omode, byte);
diff --git a/gcc/config/msp430/msp430.md b/gcc/config/msp430/msp430.md
index 64fdc45..ad8fb7a 100644
--- a/gcc/config/msp430/msp430.md
+++ b/gcc/config/msp430/msp430.md
@@ -214,6 +214,19 @@
""
)
+(define_insn_and_split "movsi_s"
+ [(set (match_operand:SI 0 "nonimmediate_operand" "=rm")
+ (subreg:SI (match_operand:PSI 1 "msp430_symbol_operand" "i") 0))]
+ ""
+ ""
+ "reload_completed"
+ [(set (match_operand:HI 2 "nonimmediate_operand")
+ (match_operand:HI 4 "general_operand"))
+ (set (match_operand:HI 3 "nonimmediate_operand")
+ (match_operand:HI 5 "general_operand"))]
+ "msp430_split_movsi (operands);"
+ )
+
(define_insn_and_split "movsi_x"
[(set (match_operand:SI 0 "nonimmediate_operand" "=rm")
(match_operand:SI 1 "general_operand" "rmi"))]
diff --git a/gcc/config/msp430/predicates.md b/gcc/config/msp430/predicates.md
index 1331ff6..5902339 100644
--- a/gcc/config/msp430/predicates.md
+++ b/gcc/config/msp430/predicates.md
@@ -82,3 +82,7 @@
(and (match_code "const_int")
(match_test (" INTVAL (op) >= 0
&& INTVAL (op) <= 15 "))))
+
+(define_predicate "msp430_symbol_operand"
+ (match_code "symbol_ref")
+)