]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
predicates.md (rl78_near_mem_operand): New.
authorDJ Delorie <dj@redhat.com>
Fri, 15 Aug 2014 02:48:03 +0000 (22:48 -0400)
committerDJ Delorie <dj@gcc.gnu.org>
Fri, 15 Aug 2014 02:48:03 +0000 (22:48 -0400)
* config/rl78/predicates.md (rl78_near_mem_operand): New.
* config/rl78/rl78-virt.md (movqi_virt_mm, movqi_virt)
(movhi_virt_mm): Split out near mem-mem moves to avoid problems
with far-far moves.

From-SVN: r213998

gcc/ChangeLog
gcc/config/rl78/predicates.md
gcc/config/rl78/rl78-virt.md

index f1b17338e7e6ec33863bf18958d003f285b9d763..8b3a4bc6bc1a0ceb46bdfa4d870a70783f7f5e26 100644 (file)
 
 2014-08-14  DJ Delorie  <dj@redhat.com>
 
+       * config/rl78/predicates.md (rl78_near_mem_operand): New.
+       * config/rl78/rl78-virt.md (movqi_virt_mm, movqi_virt)
+       (movhi_virt_mm): Split out near mem-mem moves to avoid problems
+       with far-far moves.
+
        * config/rl78/rl78-expand.md (umulqihi3): Disable for G10.
        * config/rl78/rl78-virt.md (umulhi3_shift_virt): Likewise.
        (umulqihi3_virt): Likewise.
index e564f436953799e46adfb041bee3d4f5c3724c83..f94f124b6c97d5e70647db22c0bc9fcc4fa28fc8 100644 (file)
        (not (match_test "rl78_far_p (op)")))
 )
 
+(define_predicate "rl78_near_mem_operand"
+  (and (match_code "mem")
+       (match_test "!rl78_far_p (op) && rl78_as_legitimate_address (VOIDmode, XEXP (op, 0), true, ADDR_SPACE_GENERIC)"))
+)
+
 (define_predicate "ubyte_operand"
   (and (match_code "const_int")
        (match_test "IN_RANGE (INTVAL (op), 0, 255)")))
index 39488af98ecb5015aa2b44ad24aeda39f95ccd7c..07e5715c803d1fe987e3c57fe8e7aab70dce5213 100644 (file)
 
 ;;---------- Moving ------------------------
 
+(define_insn "*movqi_virt_mm"
+  [(set (match_operand:QI 0 "rl78_near_mem_operand" "=Y")
+       (match_operand    1 "rl78_near_mem_operand" "Y"))]
+  "rl78_virt_insns_ok ()"
+  "v.mov %0, %1"
+  [(set_attr "valloc" "op1")]
+)
+
 (define_insn "*movqi_virt"
   [(set (match_operand:QI 0 "nonimmediate_operand" "=vY,v,Wfr")
-       (match_operand    1 "general_operand" "vInt8JY,Wfr,vInt8J"))]
+       (match_operand    1 "general_operand" "vInt8J,YWfr,vInt8J"))]
   "rl78_virt_insns_ok ()"
   "v.mov %0, %1"
   [(set_attr "valloc" "op1")]
 )
 
+(define_insn "*movhi_virt_mm"
+  [(set (match_operand:HI 0 "rl78_near_mem_operand" "=Y")
+       (match_operand:HI 1 "rl78_near_mem_operand" "Y"))]
+  "rl78_virt_insns_ok ()"
+  "v.movw %0, %1"
+  [(set_attr "valloc" "op1")]
+)
+
 (define_insn "*movhi_virt"
   [(set (match_operand:HI 0 "nonimmediate_operand" "=vS,  Y,   v,   Wfr")
        (match_operand:HI 1 "general_operand"      "viYS, viS, Wfr, vi"))]