;; variable argument function. It is > 0 if FP registers were passed
;; and < 0 if they were not.
-(define_insn "*call_local32"
- [(call (mem:SI (match_operand:SI 0 "current_file_function_operand" "s,s"))
+(define_insn "*call_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"))
- (clobber (reg:SI LR_REGNO))]
+ (clobber (reg:P LR_REGNO))]
"(INTVAL (operands[2]) & CALL_LONG) == 0"
{
if (INTVAL (operands[2]) & CALL_V4_SET_FP_ARGS)
else if (INTVAL (operands[2]) & CALL_V4_CLEAR_FP_ARGS)
output_asm_insn ("creqv 6,6,6", operands);
+ if (rs6000_pcrel_p (cfun))
+ return "bl %z0@notoc";
return (DEFAULT_ABI == ABI_V4 && flag_pic) ? "bl %z0@local" : "bl %z0";
}
[(set_attr "type" "branch")
(set_attr "length" "4,8")])
-(define_insn "*call_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"))
- (clobber (reg:DI LR_REGNO))]
- "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) ? "bl %z0@local" : "bl %z0";
-}
- [(set_attr "type" "branch")
- (set_attr "length" "4,8")])
-
-(define_insn "*call_value_local32"
+(define_insn "*call_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"))
- (clobber (reg:SI LR_REGNO))]
+ (clobber (reg:P LR_REGNO))]
"(INTVAL (operands[3]) & CALL_LONG) == 0"
{
if (INTVAL (operands[3]) & CALL_V4_SET_FP_ARGS)
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) ? "bl %z1@local" : "bl %z1";
-}
- [(set_attr "type" "branch")
- (set_attr "length" "4,8")])
-
-
-(define_insn "*call_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"))
- (clobber (reg:DI LR_REGNO))]
- "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);
-
+ if (rs6000_pcrel_p (cfun))
+ return "bl %z1@notoc";
return (DEFAULT_ABI == ABI_V4 && flag_pic) ? "bl %z1@local" : "bl %z1";
}
[(set_attr "type" "branch")
(const_int 8)
(const_int 4)))])
-;; Call to AIX abi function in the same module.
-
-(define_insn "*call_local_aix<mode>"
- [(call (mem:SI (match_operand:P 0 "current_file_function_operand" "s"))
- (match_operand 1))
- (clobber (reg:P LR_REGNO))]
- "DEFAULT_ABI == ABI_AIX || DEFAULT_ABI == ABI_ELFv2"
-{
- if (rs6000_pcrel_p (cfun))
- return "bl %z0@notoc";
- return "bl %z0";
-}
- [(set_attr "type" "branch")])
-
-(define_insn "*call_value_local_aix<mode>"
- [(set (match_operand 0 "" "")
- (call (mem:SI (match_operand:P 1 "current_file_function_operand" "s"))
- (match_operand 2)))
- (clobber (reg:P LR_REGNO))]
- "DEFAULT_ABI == ABI_AIX || DEFAULT_ABI == ABI_ELFv2"
-{
- if (rs6000_pcrel_p (cfun))
- return "bl %z1@notoc";
- return "bl %z1";
-}
- [(set_attr "type" "branch")])
-
;; Call to AIX abi function which may be in another module.
;; Restore the TOC pointer (r2) after the call.
(define_insn "*call_nonlocal_aix<mode>"
[(call (mem:SI (match_operand:P 0 "symbol_ref_operand" "s"))
(match_operand 1))
+ (use (match_operand:SI 2 "immediate_operand" "n"))
(clobber (reg:P LR_REGNO))]
- "DEFAULT_ABI == ABI_AIX || DEFAULT_ABI == ABI_ELFv2"
+ "(DEFAULT_ABI == ABI_AIX || DEFAULT_ABI == ABI_ELFv2)
+ && (INTVAL (operands[2]) & CALL_LONG) == 0"
{
return rs6000_call_template (operands, 0);
}
[(set (match_operand 0 "" "")
(call (mem:SI (match_operand:P 1 "symbol_ref_operand" "s"))
(match_operand:P 2 "unspec_tls" "")))
+ (use (match_operand:SI 3 "immediate_operand" "n"))
(clobber (reg:P LR_REGNO))]
- "DEFAULT_ABI == ABI_AIX || DEFAULT_ABI == ABI_ELFv2"
+ "(DEFAULT_ABI == ABI_AIX || DEFAULT_ABI == ABI_ELFv2)
+ && (INTVAL (operands[3]) & CALL_LONG) == 0"
{
return rs6000_call_template (operands, 1);
}
;; Call to indirect functions with the AIX abi using a 3 word descriptor.
;; Operand0 is the addresss of the function to call
-;; Operand2 is the location in the function descriptor to load r2 from
-;; Operand3 is the offset of the stack location holding the current TOC pointer
+;; Operand3 is the location in the function descriptor to load r2 from
+;; Operand4 is the offset of the stack location holding the current TOC pointer
(define_insn "*call_indirect_aix<mode>"
[(call (mem:SI (match_operand:P 0 "indirect_call_operand" "c,*l,X"))
(match_operand 1))
- (use (match_operand:P 2 "memory_operand" "<ptrm>,<ptrm>,<ptrm>"))
- (set (reg:P TOC_REGNUM) (unspec:P [(match_operand:P 3 "const_int_operand" "n,n,n")] UNSPEC_TOCSLOT))
+ (use (match_operand:SI 2 "immediate_operand" "n,n,n"))
+ (use (match_operand:P 3 "memory_operand" "<ptrm>,<ptrm>,<ptrm>"))
+ (set (reg:P TOC_REGNUM) (unspec:P [(match_operand:P 4 "const_int_operand" "n,n,n")] UNSPEC_TOCSLOT))
(clobber (reg:P LR_REGNO))]
"DEFAULT_ABI == ABI_AIX"
{
[(set (match_operand 0 "" "")
(call (mem:SI (match_operand:P 1 "indirect_call_operand" "c,*l,X"))
(match_operand:P 2 "unspec_tls" "")))
- (use (match_operand:P 3 "memory_operand" "<ptrm>,<ptrm>,<ptrm>"))
+ (use (match_operand:SI 3 "immediate_operand" "n,n,n"))
+ (use (match_operand:P 4 "memory_operand" "<ptrm>,<ptrm>,<ptrm>"))
(set (reg:P TOC_REGNUM)
- (unspec:P [(match_operand:P 4 "const_int_operand" "n,n,n")]
+ (unspec:P [(match_operand:P 5 "const_int_operand" "n,n,n")]
UNSPEC_TOCSLOT))
(clobber (reg:P LR_REGNO))]
"DEFAULT_ABI == ABI_AIX"
;; Call to indirect functions with the ELFv2 ABI.
;; Operand0 is the addresss of the function to call
-;; Operand2 is the offset of the stack location holding the current TOC pointer
+;; Operand3 is the offset of the stack location holding the current TOC pointer
(define_insn "*call_indirect_elfv2<mode>"
[(call (mem:SI (match_operand:P 0 "indirect_call_operand" "c,*l,X"))
(match_operand 1))
- (set (reg:P TOC_REGNUM) (unspec:P [(match_operand:P 2 "const_int_operand" "n,n,n")] UNSPEC_TOCSLOT))
+ (use (match_operand:SI 2 "immediate_operand" "n,n,n"))
+ (set (reg:P TOC_REGNUM) (unspec:P [(match_operand:P 3 "const_int_operand" "n,n,n")] UNSPEC_TOCSLOT))
(clobber (reg:P LR_REGNO))]
"DEFAULT_ABI == ABI_ELFv2"
{
(define_insn "*call_indirect_pcrel<mode>"
[(call (mem:SI (match_operand:P 0 "indirect_call_operand" "c,*l,X"))
(match_operand 1))
+ (use (match_operand:SI 2 "immediate_operand" "n,n,n"))
(clobber (reg:P LR_REGNO))]
"rs6000_pcrel_p (cfun)"
{
[(set (match_operand 0 "" "")
(call (mem:SI (match_operand:P 1 "indirect_call_operand" "c,*l,X"))
(match_operand:P 2 "unspec_tls" "")))
+ (use (match_operand:SI 3 "immediate_operand" "n,n,n"))
(set (reg:P TOC_REGNUM)
- (unspec:P [(match_operand:P 3 "const_int_operand" "n,n,n")]
+ (unspec:P [(match_operand:P 4 "const_int_operand" "n,n,n")]
UNSPEC_TOCSLOT))
(clobber (reg:P LR_REGNO))]
"DEFAULT_ABI == ABI_ELFv2"
[(set (match_operand 0 "" "")
(call (mem:SI (match_operand:P 1 "indirect_call_operand" "c,*l,X"))
(match_operand:P 2 "unspec_tls" "")))
+ (use (match_operand:SI 3 "immediate_operand" "n,n,n"))
(clobber (reg:P LR_REGNO))]
"rs6000_pcrel_p (cfun)"
{