diff mbox

[moxie] Restrict offsets for ldo/sto to 16 bits

Message ID 87r3vepkui.fsf@moxielogic.com
State New
Headers show

Commit Message

Anthony Green Jan. 1, 2015, 3:43 p.m. UTC
Happy new year!

I'm checking in this patch, which ensures that offsets for register
offset addressing on moxie are limited to 16 bits.

Since this is the first commit of 2015, I'm rolling the ChangeLog file
as well.

Thanks,

AG


2015-01-01  Anthony Green  <green@moxielogic.com>

	* config/moxie/predicates.md (moxie_general_movsrc_operand):
	Restrict move source register offsets to 16 bits.
diff mbox

Patch

Index: config/moxie/predicates.md
===================================================================
--- config/moxie/predicates.md	(revision 219135)
+++ config/moxie/predicates.md	(working copy)
@@ -34,7 +34,8 @@ 
   if (MEM_P (op)
       && GET_CODE (XEXP (op, 0)) == PLUS
       && GET_CODE (XEXP (XEXP (op, 0), 0)) == REG
-      && GET_CODE (XEXP (XEXP (op, 0), 1)) == CONST_INT)
+      && GET_CODE (XEXP (XEXP (op, 0), 1)) == CONST_INT
+      && IN_RANGE (INTVAL (XEXP (XEXP (op, 0), 1)), -32768, 32767))
     return 1;
 
   return general_operand (op, mode);