;; Operand2 is the location in the function descriptor to load r2 from
;; Operand3 is the stack location to hold the current TOC pointer
-(define_insn_and_split "call_indirect_aix<ptrsize>"
+(define_insn "call_indirect_aix<ptrsize>"
[(call (mem:SI (match_operand:P 0 "register_operand" "c,*l"))
(match_operand 1 "" "g,g"))
(use (match_operand:P 2 "memory_operand" "m,m"))
- (use (match_operand:P 3 "memory_operand" "m,m"))
+ (set (reg:P TOC_REGNUM) (match_operand:P 3 "memory_operand" "m,m"))
(use (reg:P STATIC_CHAIN_REGNUM))
(clobber (reg:P LR_REGNO))]
"DEFAULT_ABI == ABI_AIX && TARGET_POINTERS_TO_NESTED_FUNCTIONS"
- "#"
- "&& reload_completed"
- [(set (reg:P TOC_REGNUM) (match_dup 2))
- (parallel [(call (mem:SI (match_dup 0))
- (match_dup 1))
- (use (reg:P TOC_REGNUM))
- (use (reg:P STATIC_CHAIN_REGNUM))
- (use (match_dup 3))
- (set (reg:P TOC_REGNUM) (match_dup 3))
- (clobber (reg:P LR_REGNO))])]
- ""
+ "<ptrload> 2,%2\;b%T0l\;<ptrload> 2,%3"
[(set_attr "type" "jmpreg")
(set_attr "length" "12")])
-(define_insn "*call_indirect_aix<ptrsize>_internal"
- [(call (mem:SI (match_operand:P 0 "register_operand" "c,*l"))
- (match_operand 1 "" "g,g"))
- (use (reg:P TOC_REGNUM))
- (use (reg:P STATIC_CHAIN_REGNUM))
- (use (match_operand:P 2 "memory_operand" "m,m"))
- (set (reg:P TOC_REGNUM) (match_dup 2))
- (clobber (reg:P LR_REGNO))]
- "DEFAULT_ABI == ABI_AIX && reload_completed
- && TARGET_POINTERS_TO_NESTED_FUNCTIONS"
- "b%T0l\;<ptrload> 2,%2"
- [(set_attr "type" "jmpreg")
- (set_attr "length" "8")])
-
-;; Like call_indirect_aix<ptrsize>, except don't load the static chain
+;; Like call_indirect_aix<ptrsize>, but no use of the static chain
;; Operand0 is the addresss of the function to call
;; Operand1 is the flag for System V.4 for unprototyped or FP registers
;; Operand2 is the location in the function descriptor to load r2 from
;; Operand3 is the stack location to hold the current TOC pointer
-(define_insn_and_split "call_indirect_aix<ptrsize>_nor11"
+(define_insn "call_indirect_aix<ptrsize>_nor11"
[(call (mem:SI (match_operand:P 0 "register_operand" "c,*l"))
(match_operand 1 "" "g,g"))
(use (match_operand:P 2 "memory_operand" "m,m"))
- (use (match_operand:P 3 "memory_operand" "m,m"))
+ (set (reg:P TOC_REGNUM) (match_operand:P 3 "memory_operand" "m,m"))
(clobber (reg:P LR_REGNO))]
"DEFAULT_ABI == ABI_AIX && !TARGET_POINTERS_TO_NESTED_FUNCTIONS"
- "#"
- "&& reload_completed"
- [(set (reg:P TOC_REGNUM) (match_dup 2))
- (parallel [(call (mem:SI (match_dup 0))
- (match_dup 1))
- (use (reg:P TOC_REGNUM))
- (use (match_dup 3))
- (set (reg:P TOC_REGNUM) (match_dup 3))
- (clobber (reg:P LR_REGNO))])]
- ""
+ "<ptrload> 2,%2\;b%T0l\;<ptrload> 2,%3"
[(set_attr "type" "jmpreg")
(set_attr "length" "12")])
-(define_insn "*call_indirect_aix<ptrsize>_internal2"
- [(call (mem:SI (match_operand:P 0 "register_operand" "c,*l"))
- (match_operand 1 "" "g,g"))
- (use (reg:P TOC_REGNUM))
- (use (match_operand:P 2 "memory_operand" "m,m"))
- (set (reg:P TOC_REGNUM) (match_dup 2))
- (clobber (reg:P LR_REGNO))]
- "DEFAULT_ABI == ABI_AIX && reload_completed
- && !TARGET_POINTERS_TO_NESTED_FUNCTIONS"
- "b%T0l\;<ptrload> 2,%2"
- [(set_attr "type" "jmpreg")
- (set_attr "length" "8")])
-
;; Operand0 is the return result of the function
;; Operand1 is the addresss of the function to call
;; Operand2 is the flag for System V.4 for unprototyped or FP registers
;; Operand3 is the location in the function descriptor to load r2 from
;; Operand4 is the stack location to hold the current TOC pointer
-(define_insn_and_split "call_value_indirect_aix<ptrsize>"
+(define_insn "call_value_indirect_aix<ptrsize>"
[(set (match_operand 0 "" "")
(call (mem:SI (match_operand:P 1 "register_operand" "c,*l"))
(match_operand 2 "" "g,g")))
(use (match_operand:P 3 "memory_operand" "m,m"))
- (use (match_operand:P 4 "memory_operand" "m,m"))
+ (set (reg:P TOC_REGNUM) (match_operand:P 4 "memory_operand" "m,m"))
(use (reg:P STATIC_CHAIN_REGNUM))
(clobber (reg:P LR_REGNO))]
"DEFAULT_ABI == ABI_AIX && TARGET_POINTERS_TO_NESTED_FUNCTIONS"
- "#"
- "&& reload_completed"
- [(set (reg:P TOC_REGNUM) (match_dup 3))
- (parallel [(set (match_dup 0)
- (call (mem:SI (match_dup 1))
- (match_dup 2)))
- (use (reg:P TOC_REGNUM))
- (use (reg:P STATIC_CHAIN_REGNUM))
- (use (match_dup 4))
- (set (reg:P TOC_REGNUM) (match_dup 4))
- (clobber (reg:P LR_REGNO))])]
- ""
+ "<ptrload> 2,%3\;b%T1l\;<ptrload> 2,%4"
[(set_attr "type" "jmpreg")
(set_attr "length" "12")])
-(define_insn "*call_value_indirect_aix<ptrsize>_internal"
- [(set (match_operand 0 "" "")
- (call (mem:SI (match_operand:P 1 "register_operand" "c,*l"))
- (match_operand 2 "" "g,g")))
- (use (reg:P TOC_REGNUM))
- (use (reg:P STATIC_CHAIN_REGNUM))
- (use (match_operand:P 3 "memory_operand" "m,m"))
- (set (reg:P TOC_REGNUM) (match_dup 3))
- (clobber (reg:P LR_REGNO))]
- "DEFAULT_ABI == ABI_AIX && reload_completed
- && TARGET_POINTERS_TO_NESTED_FUNCTIONS"
- "b%T1l\;<ptrload> 2,%3"
- [(set_attr "type" "jmpreg")
- (set_attr "length" "8")])
-
-;; Like call_value_indirect_aix<ptrsize>, but don't load the static chain
+;; Like call_value_indirect_aix<ptrsize>, but no use of the static chain
;; Operand0 is the return result of the function
;; Operand1 is the addresss of the function to call
;; Operand2 is the flag for System V.4 for unprototyped or FP registers
;; Operand3 is the location in the function descriptor to load r2 from
;; Operand4 is the stack location to hold the current TOC pointer
-(define_insn_and_split "call_value_indirect_aix<ptrsize>_nor11"
+(define_insn "call_value_indirect_aix<ptrsize>_nor11"
[(set (match_operand 0 "" "")
(call (mem:SI (match_operand:P 1 "register_operand" "c,*l"))
(match_operand 2 "" "g,g")))
(use (match_operand:P 3 "memory_operand" "m,m"))
- (use (match_operand:P 4 "memory_operand" "m,m"))
+ (set (reg:P TOC_REGNUM) (match_operand:P 4 "memory_operand" "m,m"))
(clobber (reg:P LR_REGNO))]
"DEFAULT_ABI == ABI_AIX && !TARGET_POINTERS_TO_NESTED_FUNCTIONS"
- "#"
- "&& reload_completed"
- [(set (reg:P TOC_REGNUM) (match_dup 3))
- (parallel [(set (match_dup 0)
- (call (mem:SI (match_dup 1))
- (match_dup 2)))
- (use (reg:P TOC_REGNUM))
- (use (match_dup 4))
- (set (reg:P TOC_REGNUM) (match_dup 4))
- (clobber (reg:P LR_REGNO))])]
- ""
+ "<ptrload> 2,%3\;b%T1l\;<ptrload> 2,%4"
[(set_attr "type" "jmpreg")
(set_attr "length" "12")])
-(define_insn "*call_value_indirect_aix<ptrsize>_internal2"
- [(set (match_operand 0 "" "")
- (call (mem:SI (match_operand:P 1 "register_operand" "c,*l"))
- (match_operand 2 "" "g,g")))
- (use (reg:P TOC_REGNUM))
- (use (match_operand:P 3 "memory_operand" "m,m"))
- (set (reg:P TOC_REGNUM) (match_dup 3))
- (clobber (reg:P LR_REGNO))]
- "DEFAULT_ABI == ABI_AIX && reload_completed
- && !TARGET_POINTERS_TO_NESTED_FUNCTIONS"
- "b%T1l\;<ptrload> 2,%3"
- [(set_attr "type" "jmpreg")
- (set_attr "length" "8")])
-
;; Call to function which may be in another module. Restore the TOC
;; pointer (r2) after the call unless this is System V.
;; Operand2 is nonzero if we are using the V.4 calling sequence and