OSDN Git Service

Apply https://gcc.gnu.org/bugzilla/attachment.cgi?id=28797 for lm32-elf. rework
authorMasaki Muranaka <monaka@monami-ya.jp>
Mon, 19 May 2014 12:42:07 +0000 (21:42 +0900)
committerMasaki Muranaka <monaka@monami-ya.jp>
Mon, 19 May 2014 12:42:07 +0000 (21:42 +0900)
gcc/config/lm32/lm32.c
gcc/config/lm32/lm32.md
gcc/config/lm32/predicates.md

index 0d0ee5f..fbd823b 100644 (file)
@@ -81,7 +81,6 @@ static rtx lm32_function_arg (cumulative_args_t cum,
 static void lm32_function_arg_advance (cumulative_args_t cum,
                                       enum machine_mode mode,
                                       const_tree type, bool named);
-static bool lm32_legitimate_constant_p (enum machine_mode, rtx);
 
 #undef TARGET_OPTION_OVERRIDE
 #define TARGET_OPTION_OVERRIDE lm32_option_override
@@ -109,8 +108,6 @@ static bool lm32_legitimate_constant_p (enum machine_mode, rtx);
 #define TARGET_CAN_ELIMINATE lm32_can_eliminate
 #undef TARGET_LEGITIMATE_ADDRESS_P
 #define TARGET_LEGITIMATE_ADDRESS_P lm32_legitimate_address_p
-#undef TARGET_LEGITIMATE_CONSTANT_P
-#define TARGET_LEGITIMATE_CONSTANT_P lm32_legitimate_constant_p
 
 struct gcc_target targetm = TARGET_INITIALIZER;
 
@@ -1230,15 +1227,3 @@ lm32_move_ok (enum machine_mode mode, rtx operands[2]) {
     return register_or_zero_operand (operands[1], mode);
   return true;
 }
-
-/* Implement TARGET_LEGITIMATE_CONSTANT_P.  */
-
-static bool
-lm32_legitimate_constant_p (enum machine_mode mode, rtx x)
-{
-  /* 32-bit addresses require multiple instructions.  */  
-  if (!flag_pic && reloc_operand (x, mode))
-    return false; 
-  
-  return true;
-}
index 7539cb0..850f948 100644 (file)
 )
 
 (define_insn "movsi_insn"
-  [(set (match_operand:SI 0 "nonimmediate_operand" "=r,r,m,m,r,r,r,r,r")
-        (match_operand:SI 1 "movsi_rhs_operand" "m,r,r,J,K,L,U,S,Y"))]
+  [(set (match_operand:SI 0 "nonimmediate_operand" "=r,r,m,m,r,r,r,r,r,r")
+        (match_operand:SI 1 "general_operand" "m,r,r,J,K,L,U,S,Y,n"))]
   "lm32_move_ok (SImode, operands)"
   "@
    lw       %0, %1
    ori      %0, r0, %1
    orhi     %0, r0, hi(%1)
    mva      %0, gp(%1)
-   orhi     %0, r0, hi(%1)"
-  [(set_attr "type" "load,arith,store,store,arith,arith,arith,arith,arith")]   
+   orhi     %0, r0, hi(%1)
+   ori      %0, r0, lo(%1); orhi     %0, %0, hi(%1)"
+  [(set_attr "type" "load,arith,store,store,arith,arith,arith,arith,arith,arith")]   
 )
 
 ;; ---------------------------------
   [(set_attr "type" "uibranch")]  
 )
 
-(define_insn "return"
+(define_expand "return"
   [(return)]
   "lm32_can_use_return ()"
+  ""
+) 
+
+(define_expand "simple_return"
+  [(simple_return)]
+  ""
+  ""
+) 
+
+(define_insn "*return"
+  [(return)]
+  "reload_completed"
+  "ret"
+  [(set_attr "type" "uibranch")]  
+) 
+
+(define_insn "*simple_return"
+  [(simple_return)]
+  ""
   "ret"
   [(set_attr "type" "uibranch")]  
 ) 
index 7137c01..b907f27 100644 (file)
@@ -70,8 +70,3 @@
   (ior (match_code "symbol_ref")
        (match_operand 0 "register_operand")))
 
-(define_predicate "movsi_rhs_operand"
-  (ior (match_operand 0 "nonimmediate_operand")
-       (ior (match_code "const_int")
-            (ior (match_test "satisfies_constraint_S (op)")
-                 (match_test "satisfies_constraint_Y (op)")))))