Patchwork rx: fix builtin mvtipl

login
register
mail settings
Submitter DJ Delorie
Date Aug. 10, 2010, 5:05 p.m.
Message ID <201008101705.o7AH5fsp011336@greed.delorie.com>
Download mbox | patch
Permalink /patch/61401/
State New
Headers show

Comments

DJ Delorie - Aug. 10, 2010, 5:05 p.m.
Ok?

	* config/rx/rx.md (mvtipl): Make it volatile.
	* config/rx/rx.c (rx_expand_builtin_mvtipl): Pass integer, not
	rtx, to IN_RANGE.

Patch

Index: rx.md
===================================================================
--- rx.md	(revision 163042)
+++ rx.md	(working copy)
@@ -1845,13 +1845,13 @@ 
   ;; the possibility of this instruction being placed in between
   ;; them.
 )
 
 ;; Move to interrupt priority level
 (define_insn "mvtipl"
-  [(unspec:SI [(match_operand:SI 0 "immediate_operand" "Uint04")]
+  [(unspec_volatile:SI [(match_operand:SI 0 "immediate_operand" "Uint04")]
 	      UNSPEC_BUILTIN_MVTIPL)]
   ""
   "mvtipl\t%0"
   [(set_attr "length" "3")]
 )
 
Index: rx.c
===================================================================
--- rx.c	(revision 163042)
+++ rx.c	(working copy)
@@ -1893,13 +1893,13 @@  static rtx
 rx_expand_builtin_mvtipl (rtx arg)
 {
   /* The RX610 does not support the MVTIPL instruction.  */
   if (rx_cpu_type == RX610)
     return NULL_RTX;
 
-  if (! CONST_INT_P (arg) || ! IN_RANGE (arg, 0, (1 << 4) - 1))
+  if (! CONST_INT_P (arg) || ! IN_RANGE (INTVAL (arg), 0, (1 << 4) - 1))
     return NULL_RTX;
 
   emit_insn (gen_mvtipl (arg));
 
   return NULL_RTX;
 }