Merge sibcall_local32/64
authorAlan Modra <amodra@gmail.com>
Mon, 13 Jul 2020 23:49:43 +0000 (09:19 +0930)
committerAlan Modra <amodra@gmail.com>
Mon, 13 Jul 2020 23:49:43 +0000 (09:19 +0930)
This patch consolidates four insn patterns into two.

* config/rs6000/rs6000.md (sibcall_local): Merge sibcall_local32
and sibcall_local64.
(sibcall_value_local): Similarly.

gcc/config/rs6000/rs6000.md

index e608a17..3a33982 100644 (file)
   DONE;
 })
 
-(define_insn "*sibcall_local32"
-  [(call (mem:SI (match_operand:SI 0 "current_file_function_operand" "s,s"))
+(define_insn "*sibcall_local<mode>"
+  [(call (mem:SI (match_operand:P 0 "current_file_function_operand" "s,s"))
         (match_operand 1))
    (use (match_operand:SI 2 "immediate_operand" "O,n"))
    (simple_return)]
   [(set_attr "type" "branch")
    (set_attr "length" "4,8")])
 
-(define_insn "*sibcall_local64"
-  [(call (mem:SI (match_operand:DI 0 "current_file_function_operand" "s,s"))
-        (match_operand 1))
-   (use (match_operand:SI 2 "immediate_operand" "O,n"))
-   (simple_return)]
-  "TARGET_64BIT && (INTVAL (operands[2]) & CALL_LONG) == 0"
-{
-  if (INTVAL (operands[2]) & CALL_V4_SET_FP_ARGS)
-    output_asm_insn ("crxor 6,6,6", operands);
-
-  else if (INTVAL (operands[2]) & CALL_V4_CLEAR_FP_ARGS)
-    output_asm_insn ("creqv 6,6,6", operands);
-
-  return (DEFAULT_ABI == ABI_V4 && flag_pic) ? "b %z0@local" : "b %z0";
-}
-  [(set_attr "type" "branch")
-   (set_attr "length" "4,8")])
-
-(define_insn "*sibcall_value_local32"
+(define_insn "*sibcall_value_local<mode>"
   [(set (match_operand 0 "" "")
-       (call (mem:SI (match_operand:SI 1 "current_file_function_operand" "s,s"))
+       (call (mem:SI (match_operand:P 1 "current_file_function_operand" "s,s"))
              (match_operand 2)))
    (use (match_operand:SI 3 "immediate_operand" "O,n"))
    (simple_return)]
   [(set_attr "type" "branch")
    (set_attr "length" "4,8")])
 
-(define_insn "*sibcall_value_local64"
-  [(set (match_operand 0 "" "")
-       (call (mem:SI (match_operand:DI 1 "current_file_function_operand" "s,s"))
-             (match_operand 2)))
-   (use (match_operand:SI 3 "immediate_operand" "O,n"))
-   (simple_return)]
-  "TARGET_64BIT && (INTVAL (operands[3]) & CALL_LONG) == 0"
-{
-  if (INTVAL (operands[3]) & CALL_V4_SET_FP_ARGS)
-    output_asm_insn ("crxor 6,6,6", operands);
-
-  else if (INTVAL (operands[3]) & CALL_V4_CLEAR_FP_ARGS)
-    output_asm_insn ("creqv 6,6,6", operands);
-
-  return (DEFAULT_ABI == ABI_V4 && flag_pic) ? "b %z1@local" : "b %z1";
-}
-  [(set_attr "type" "branch")
-   (set_attr "length" "4,8")])
-
 (define_insn "*sibcall_indirect_nonlocal_sysv<mode>"
   [(call (mem:SI (match_operand:P 0 "indirect_call_operand" "c,*l,X"))
         (match_operand 1))