v850.c (v850_legitimate_address_p): Handle large displacements for TARGET_V850E2V3...
authorJeff Law <law@redhat.com>
Fri, 29 Jun 2018 18:42:35 +0000 (12:42 -0600)
committerJeff Law <law@gcc.gnu.org>
Fri, 29 Jun 2018 18:42:35 +0000 (12:42 -0600)
* config/v850/v850.c (v850_legitimate_address_p): Handle large
displacements for TARGET_V850E2V3 and newer.
(TARGET_LRA_P): Remove.  Defaults to LRA now.
* config/v850/v850.md (sign23byte_load): Remove.
(unsign23byte_load, sign23hword_load, unsign23hword_load): Likewise.
(23word_load, 23byte_store, 23hword_store, 23word_store): Likewise.

From-SVN: r262257

gcc/ChangeLog
gcc/config/v850/v850.c
gcc/config/v850/v850.md

index a0da66e69324210c02b401d1952004bb5b55a747..c486d6d21728bdbe77fc13ceb54a64df69a7b01d 100644 (file)
@@ -1,3 +1,12 @@
+2018-06-29  Jeff Law  <law@redhat.com>
+
+       * config/v850/v850.c (v850_legitimate_address_p): Handle large
+       displacements for TARGET_V850E2V3 and newer.
+       (TARGET_LRA_P): Remove.  Defaults to LRA now.
+       * config/v850/v850.md (sign23byte_load): Remove.
+       (unsign23byte_load, sign23hword_load, unsign23hword_load): Likewise.
+       (23word_load, 23byte_store, 23hword_store, 23word_store): Likewise.
+
 2018-06-29  Martin Liska  <mliska@suse.cz>
 
        PR lto/85759
index cb2debf46f17b6a74011e2ed756c21d7466e08c8..8936c732307b3008d2ab80553cbadbf0c58ad5ee 100644 (file)
@@ -3079,7 +3079,10 @@ v850_legitimate_address_p (machine_mode mode, rtx x, bool strict_p,
     return true;
   if (GET_CODE (x) == PLUS
       && v850_rtx_ok_for_base_p (XEXP (x, 0), strict_p)
-      && constraint_satisfied_p (XEXP (x,1), CONSTRAINT_K)
+      && (constraint_satisfied_p (XEXP (x, 1), CONSTRAINT_K)
+         || (TARGET_V850E2V3_UP
+             && (mode == SImode || mode == HImode || mode == QImode)
+             && constraint_satisfied_p (XEXP (x, 1), CONSTRAINT_W)))
       && ((mode == QImode || INTVAL (XEXP (x, 1)) % 2 == 0)
           && CONST_OK_FOR_K (INTVAL (XEXP (x, 1))
                              + (GET_MODE_NUNITS (mode) * UNITS_PER_WORD))))
@@ -3309,9 +3312,6 @@ v850_modes_tieable_p (machine_mode mode1, machine_mode mode2)
 #undef  TARGET_LEGITIMATE_CONSTANT_P
 #define TARGET_LEGITIMATE_CONSTANT_P v850_legitimate_constant_p
 
-#undef TARGET_LRA_P
-#define TARGET_LRA_P hook_bool_void_false
-
 #undef  TARGET_ADDR_SPACE_LEGITIMATE_ADDRESS_P
 #define TARGET_ADDR_SPACE_LEGITIMATE_ADDRESS_P v850_legitimate_address_p
 
index b8f098b936328dddbb83ab0f387f322e94112f40..6530778c8f625a7c304d2de67ab772f4c4e85a05 100644 (file)
 ;; ----------------------------------------------------------------------
 ;; MOVE INSTRUCTIONS
 ;; ----------------------------------------------------------------------
-(define_insn "sign23byte_load"
-  [(set (match_operand:SI 0 "register_operand" "=r")
-       (sign_extend:SI
-       (mem:QI (plus:SI (match_operand:SI 1 "register_operand" "r")
-                        (match_operand 2 "disp23_operand" "W")))))]
-  "TARGET_V850E2V3_UP"
-  "ld.b %2[%1],%0"
-  [(set_attr "length" "4")])
-  
-(define_insn "unsign23byte_load"
-  [(set (match_operand:SI 0 "register_operand" "=r")
-       (zero_extend:SI
-       (mem:QI (plus:SI (match_operand:SI 1 "register_operand" "r")
-                        (match_operand 2 "disp23_operand" "W")))))]
-  "TARGET_V850E2V3_UP"
-  "ld.bu %2[%1],%0"
-  [(set_attr "length" "4")])
-
-(define_insn "sign23hword_load"
-  [(set (match_operand:SI 0 "register_operand" "=r")
-       (sign_extend:SI
-       (mem:HI (plus:SI (match_operand:SI 1 "register_operand" "r")
-                        (match_operand 2 "disp23_operand" "W")))))]
-  "TARGET_V850E2V3_UP"
-  "ld.h %2[%1],%0"
-  [(set_attr "length" "4")])
-
-(define_insn "unsign23hword_load"
-  [(set (match_operand:SI 0 "register_operand" "=r")
-       (zero_extend:SI
-       (mem:HI (plus:SI (match_operand:SI 1 "register_operand" "r")
-                        (match_operand 2 "disp23_operand" "W")))))]
-  "TARGET_V850E2V3_UP"
-  "ld.hu %2[%1],%0"
-  [(set_attr "length" "4")])
-
-(define_insn "23word_load"
-  [(set (match_operand:SI 0 "register_operand" "=r")
-       (mem:SI (plus:SI (match_operand:SI 1 "register_operand" "r")
-                        (match_operand 2 "disp23_operand" "W"))))]
-  "TARGET_V850E2V3_UP"
-  "ld.w %2[%1],%0"
-  [(set_attr "length" "4")])
-
-(define_insn "23byte_store"
-  [(set (mem:QI (plus:SI (match_operand:SI 0 "register_operand" "r")
-                        (match_operand 1 "disp23_operand" "W")))
-       (match_operand:QI 2 "register_operand" "r"))]
-  "TARGET_V850E2V3_UP"
-  "st.b %2,%1[%0]"
-  [(set_attr "length" "4")])
-
-(define_insn "23hword_store"
-  [(set (mem:HI (plus:SI (match_operand:SI 0 "register_operand" "r")
-                        (match_operand 1 "disp23_operand" "W")))
-       (match_operand:HI 2 "register_operand" "r"))]
-  "TARGET_V850E2V3_UP"
-  "st.h %2,%1[%0]"
-  [(set_attr "length" "4")])
-
-(define_insn "23word_store"
-  [(set (mem:SI (plus:SI (match_operand:SI 0 "register_operand" "r")
-                        (match_operand 1 "disp23_operand" "W")))
-       (match_operand:SI 2 "register_operand" "r"))]
-  "TARGET_V850E2V3_UP"
-  "st.w %2,%1[%0]"
-  [(set_attr "length" "4")])
-
 ;; movdi
 
 (define_expand "movdi"