;; Machine description for RISC-V Zc extension.
;; Copyright (C) 2023-2024 Free Software Foundation, Inc.
;; Contributed by Fei Gao (gaofei@eswincomputing.com).
;; This file is part of GCC.
;; GCC is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation; either version 3, or (at your option)
;; any later version.
;; GCC is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU General Public License for more details.
;; You should have received a copy of the GNU General Public License
;; along with GCC; see the file COPYING3. If not see
;; .
(define_insn "@gpr_multi_pop_up_to_ra_"
[(set (reg:X SP_REGNUM)
(plus:X (reg:X SP_REGNUM)
(match_operand 0 "stack_pop_up_to_ra_operand" "I")))
(set (reg:X RETURN_ADDR_REGNUM)
(mem:X (plus:X (reg:X SP_REGNUM)
(const_int ))))]
"TARGET_ZCMP"
"cm.pop {ra}, %0"
[(set_attr "type" "load")])
(define_insn "@gpr_multi_pop_up_to_s0_"
[(set (reg:X SP_REGNUM)
(plus:X (reg:X SP_REGNUM)
(match_operand 0 "stack_pop_up_to_s0_operand" "I")))
(set (reg:X S0_REGNUM)
(mem:X (plus:X (reg:X SP_REGNUM)
(const_int ))))
(set (reg:X RETURN_ADDR_REGNUM)
(mem:X (plus:X (reg:X SP_REGNUM)
(const_int ))))]
"TARGET_ZCMP"
"cm.pop {ra, s0}, %0"
[(set_attr "type" "load")])
(define_insn "@gpr_multi_pop_up_to_s1_"
[(set (reg:X SP_REGNUM)
(plus:X (reg:X SP_REGNUM)
(match_operand 0 "stack_pop_up_to_s1_operand" "I")))
(set (reg:X S1_REGNUM)
(mem:X (plus:X (reg:X SP_REGNUM)
(const_int ))))
(set (reg:X S0_REGNUM)
(mem:X (plus:X (reg:X SP_REGNUM)
(const_int ))))
(set (reg:X RETURN_ADDR_REGNUM)
(mem:X (plus:X (reg:X SP_REGNUM)
(const_int ))))]
"TARGET_ZCMP"
"cm.pop {ra, s0-s1}, %0"
[(set_attr "type" "load")])
(define_insn "@gpr_multi_pop_up_to_s2_"
[(set (reg:X SP_REGNUM)
(plus:X (reg:X SP_REGNUM)
(match_operand 0 "stack_pop_up_to_s2_operand" "I")))
(set (reg:X S2_REGNUM)
(mem:X (plus:X (reg:X SP_REGNUM)
(const_int ))))
(set (reg:X S1_REGNUM)
(mem:X (plus:X (reg:X SP_REGNUM)
(const_int ))))
(set (reg:X S0_REGNUM)
(mem:X (plus:X (reg:X SP_REGNUM)
(const_int ))))
(set (reg:X RETURN_ADDR_REGNUM)
(mem:X (plus:X (reg:X SP_REGNUM)
(const_int ))))]
"TARGET_ZCMP"
"cm.pop {ra, s0-s2}, %0"
[(set_attr "type" "load")])
(define_insn "@gpr_multi_pop_up_to_s3_"
[(set (reg:X SP_REGNUM)
(plus:X (reg:X SP_REGNUM)
(match_operand 0 "stack_pop_up_to_s3_operand" "I")))
(set (reg:X S3_REGNUM)
(mem:X (plus:X (reg:X SP_REGNUM)
(const_int ))))
(set (reg:X S2_REGNUM)
(mem:X (plus:X (reg:X SP_REGNUM)
(const_int ))))
(set (reg:X S1_REGNUM)
(mem:X (plus:X (reg:X SP_REGNUM)
(const_int ))))
(set (reg:X S0_REGNUM)
(mem:X (plus:X (reg:X SP_REGNUM)
(const_int ))))
(set (reg:X RETURN_ADDR_REGNUM)
(mem:X (plus:X (reg:X SP_REGNUM)
(const_int ))))]
"TARGET_ZCMP"
"cm.pop {ra, s0-s3}, %0"
[(set_attr "type" "load")])
(define_insn "@gpr_multi_pop_up_to_s4_"
[(set (reg:X SP_REGNUM)
(plus:X (reg:X SP_REGNUM)
(match_operand 0 "stack_pop_up_to_s4_operand" "I")))
(set (reg:X S4_REGNUM)
(mem:X (plus:X (reg:X SP_REGNUM)
(const_int ))))
(set (reg:X S3_REGNUM)
(mem:X (plus:X (reg:X SP_REGNUM)
(const_int ))))
(set (reg:X S2_REGNUM)
(mem:X (plus:X (reg:X SP_REGNUM)
(const_int ))))
(set (reg:X S1_REGNUM)
(mem:X (plus:X (reg:X SP_REGNUM)
(const_int ))))
(set (reg:X S0_REGNUM)
(mem:X (plus:X (reg:X SP_REGNUM)
(const_int ))))
(set (reg:X RETURN_ADDR_REGNUM)
(mem:X (plus:X (reg:X SP_REGNUM)
(const_int ))))]
"TARGET_ZCMP"
"cm.pop {ra, s0-s4}, %0"
[(set_attr "type" "load")])
(define_insn "@gpr_multi_pop_up_to_s5_"
[(set (reg:X SP_REGNUM)
(plus:X (reg:X SP_REGNUM)
(match_operand 0 "stack_pop_up_to_s5_operand" "I")))
(set (reg:X S5_REGNUM)
(mem:X (plus:X (reg:X SP_REGNUM)
(const_int ))))
(set (reg:X S4_REGNUM)
(mem:X (plus:X (reg:X SP_REGNUM)
(const_int ))))
(set (reg:X S3_REGNUM)
(mem:X (plus:X (reg:X SP_REGNUM)
(const_int ))))
(set (reg:X S2_REGNUM)
(mem:X (plus:X (reg:X SP_REGNUM)
(const_int ))))
(set (reg:X S1_REGNUM)
(mem:X (plus:X (reg:X SP_REGNUM)
(const_int ))))
(set (reg:X S0_REGNUM)
(mem:X (plus:X (reg:X SP_REGNUM)
(const_int ))))
(set (reg:X RETURN_ADDR_REGNUM)
(mem:X (plus:X (reg:X SP_REGNUM)
(const_int ))))]
"TARGET_ZCMP"
"cm.pop {ra, s0-s5}, %0"
[(set_attr "type" "load")])
(define_insn "@gpr_multi_pop_up_to_s6_"
[(set (reg:X SP_REGNUM)
(plus:X (reg:X SP_REGNUM)
(match_operand 0 "stack_pop_up_to_s6_operand" "I")))
(set (reg:X S6_REGNUM)
(mem:X (plus:X (reg:X SP_REGNUM)
(const_int ))))
(set (reg:X S5_REGNUM)
(mem:X (plus:X (reg:X SP_REGNUM)
(const_int ))))
(set (reg:X S4_REGNUM)
(mem:X (plus:X (reg:X SP_REGNUM)
(const_int ))))
(set (reg:X S3_REGNUM)
(mem:X (plus:X (reg:X SP_REGNUM)
(const_int ))))
(set (reg:X S2_REGNUM)
(mem:X (plus:X (reg:X SP_REGNUM)
(const_int ))))
(set (reg:X S1_REGNUM)
(mem:X (plus:X (reg:X SP_REGNUM)
(const_int ))))
(set (reg:X S0_REGNUM)
(mem:X (plus:X (reg:X SP_REGNUM)
(const_int ))))
(set (reg:X RETURN_ADDR_REGNUM)
(mem:X (plus:X (reg:X SP_REGNUM)
(const_int ))))]
"TARGET_ZCMP"
"cm.pop {ra, s0-s6}, %0"
[(set_attr "type" "load")])
(define_insn "@gpr_multi_pop_up_to_s7_"
[(set (reg:X SP_REGNUM)
(plus:X (reg:X SP_REGNUM)
(match_operand 0 "stack_pop_up_to_s7_operand" "I")))
(set (reg:X S7_REGNUM)
(mem:X (plus:X (reg:X SP_REGNUM)
(const_int ))))
(set (reg:X S6_REGNUM)
(mem:X (plus:X (reg:X SP_REGNUM)
(const_int ))))
(set (reg:X S5_REGNUM)
(mem:X (plus:X (reg:X SP_REGNUM)
(const_int ))))
(set (reg:X S4_REGNUM)
(mem:X (plus:X (reg:X SP_REGNUM)
(const_int ))))
(set (reg:X S3_REGNUM)
(mem:X (plus:X (reg:X SP_REGNUM)
(const_int ))))
(set (reg:X S2_REGNUM)
(mem:X (plus:X (reg:X SP_REGNUM)
(const_int ))))
(set (reg:X S1_REGNUM)
(mem:X (plus:X (reg:X SP_REGNUM)
(const_int ))))
(set (reg:X S0_REGNUM)
(mem:X (plus:X (reg:X SP_REGNUM)
(const_int ))))
(set (reg:X RETURN_ADDR_REGNUM)
(mem:X (plus:X (reg:X SP_REGNUM)
(const_int ))))]
"TARGET_ZCMP"
"cm.pop {ra, s0-s7}, %0"
[(set_attr "type" "load")])
(define_insn "@gpr_multi_pop_up_to_s8_"
[(set (reg:X SP_REGNUM)
(plus:X (reg:X SP_REGNUM)
(match_operand 0 "stack_pop_up_to_s8_operand" "I")))
(set (reg:X S8_REGNUM)
(mem:X (plus:X (reg:X SP_REGNUM)
(const_int ))))
(set (reg:X S7_REGNUM)
(mem:X (plus:X (reg:X SP_REGNUM)
(const_int ))))
(set (reg:X S6_REGNUM)
(mem:X (plus:X (reg:X SP_REGNUM)
(const_int ))))
(set (reg:X S5_REGNUM)
(mem:X (plus:X (reg:X SP_REGNUM)
(const_int ))))
(set (reg:X S4_REGNUM)
(mem:X (plus:X (reg:X SP_REGNUM)
(const_int ))))
(set (reg:X S3_REGNUM)
(mem:X (plus:X (reg:X SP_REGNUM)
(const_int ))))
(set (reg:X S2_REGNUM)
(mem:X (plus:X (reg:X SP_REGNUM)
(const_int ))))
(set (reg:X S1_REGNUM)
(mem:X (plus:X (reg:X SP_REGNUM)
(const_int ))))
(set (reg:X S0_REGNUM)
(mem:X (plus:X (reg:X SP_REGNUM)
(const_int ))))
(set (reg:X RETURN_ADDR_REGNUM)
(mem:X (plus:X (reg:X SP_REGNUM)
(const_int ))))]
"TARGET_ZCMP"
"cm.pop {ra, s0-s8}, %0"
[(set_attr "type" "load")])
(define_insn "@gpr_multi_pop_up_to_s9_"
[(set (reg:X SP_REGNUM)
(plus:X (reg:X SP_REGNUM)
(match_operand 0 "stack_pop_up_to_s9_operand" "I")))
(set (reg:X S9_REGNUM)
(mem:X (plus:X (reg:X SP_REGNUM)
(const_int ))))
(set (reg:X S8_REGNUM)
(mem:X (plus:X (reg:X SP_REGNUM)
(const_int ))))
(set (reg:X S7_REGNUM)
(mem:X (plus:X (reg:X SP_REGNUM)
(const_int ))))
(set (reg:X S6_REGNUM)
(mem:X (plus:X (reg:X SP_REGNUM)
(const_int ))))
(set (reg:X S5_REGNUM)
(mem:X (plus:X (reg:X SP_REGNUM)
(const_int ))))
(set (reg:X S4_REGNUM)
(mem:X (plus:X (reg:X SP_REGNUM)
(const_int ))))
(set (reg:X S3_REGNUM)
(mem:X (plus:X (reg:X SP_REGNUM)
(const_int ))))
(set (reg:X S2_REGNUM)
(mem:X (plus:X (reg:X SP_REGNUM)
(const_int ))))
(set (reg:X S1_REGNUM)
(mem:X (plus:X (reg:X SP_REGNUM)
(const_int ))))
(set (reg:X S0_REGNUM)
(mem:X (plus:X (reg:X SP_REGNUM)
(const_int ))))
(set (reg:X RETURN_ADDR_REGNUM)
(mem:X (plus:X (reg:X SP_REGNUM)
(const_int ))))]
"TARGET_ZCMP"
"cm.pop {ra, s0-s9}, %0"
[(set_attr "type" "load")])
(define_insn "@gpr_multi_pop_up_to_s11_"
[(set (reg:X SP_REGNUM)
(plus:X (reg:X SP_REGNUM)
(match_operand 0 "stack_pop_up_to_s11_operand" "I")))
(set (reg:X S11_REGNUM)
(mem:X (plus:X (reg:X SP_REGNUM)
(const_int ))))
(set (reg:X S10_REGNUM)
(mem:X (plus:X (reg:X SP_REGNUM)
(const_int ))))
(set (reg:X S9_REGNUM)
(mem:X (plus:X (reg:X SP_REGNUM)
(const_int ))))
(set (reg:X S8_REGNUM)
(mem:X (plus:X (reg:X SP_REGNUM)
(const_int ))))
(set (reg:X S7_REGNUM)
(mem:X (plus:X (reg:X SP_REGNUM)
(const_int ))))
(set (reg:X S6_REGNUM)
(mem:X (plus:X (reg:X SP_REGNUM)
(const_int ))))
(set (reg:X S5_REGNUM)
(mem:X (plus:X (reg:X SP_REGNUM)
(const_int ))))
(set (reg:X S4_REGNUM)
(mem:X (plus:X (reg:X SP_REGNUM)
(const_int ))))
(set (reg:X S3_REGNUM)
(mem:X (plus:X (reg:X SP_REGNUM)
(const_int ))))
(set (reg:X S2_REGNUM)
(mem:X (plus:X (reg:X SP_REGNUM)
(const_int ))))
(set (reg:X S1_REGNUM)
(mem:X (plus:X (reg:X SP_REGNUM)
(const_int ))))
(set (reg:X S0_REGNUM)
(mem:X (plus:X (reg:X SP_REGNUM)
(const_int ))))
(set (reg:X RETURN_ADDR_REGNUM)
(mem:X (plus:X (reg:X SP_REGNUM)
(const_int ))))]
"TARGET_ZCMP"
"cm.pop {ra, s0-s11}, %0"
[(set_attr "type" "load")])
(define_insn "@gpr_multi_popret_up_to_ra_"
[(set (reg:X SP_REGNUM)
(plus:X (reg:X SP_REGNUM)
(match_operand 0 "stack_pop_up_to_ra_operand" "I")))
(set (reg:X RETURN_ADDR_REGNUM)
(mem:X (plus:X (reg:X SP_REGNUM)
(const_int ))))
(return)
(use (reg:SI RETURN_ADDR_REGNUM))]
"TARGET_ZCMP"
"cm.popret {ra}, %0"
[(set_attr "type" "load")])
(define_insn "@gpr_multi_popret_up_to_s0_"
[(set (reg:X SP_REGNUM)
(plus:X (reg:X SP_REGNUM)
(match_operand 0 "stack_pop_up_to_s0_operand" "I")))
(set (reg:X S0_REGNUM)
(mem:X (plus:X (reg:X SP_REGNUM)
(const_int ))))
(set (reg:X RETURN_ADDR_REGNUM)
(mem:X (plus:X (reg:X SP_REGNUM)
(const_int ))))
(return)
(use (reg:SI RETURN_ADDR_REGNUM))]
"TARGET_ZCMP"
"cm.popret {ra, s0}, %0"
[(set_attr "type" "load")])
(define_insn "@gpr_multi_popret_up_to_s1_"
[(set (reg:X SP_REGNUM)
(plus:X (reg:X SP_REGNUM)
(match_operand 0 "stack_pop_up_to_s1_operand" "I")))
(set (reg:X S1_REGNUM)
(mem:X (plus:X (reg:X SP_REGNUM)
(const_int ))))
(set (reg:X S0_REGNUM)
(mem:X (plus:X (reg:X SP_REGNUM)
(const_int ))))
(set (reg:X RETURN_ADDR_REGNUM)
(mem:X (plus:X (reg:X SP_REGNUM)
(const_int ))))
(return)
(use (reg:SI RETURN_ADDR_REGNUM))]
"TARGET_ZCMP"
"cm.popret {ra, s0-s1}, %0"
[(set_attr "type" "load")])
(define_insn "@gpr_multi_popret_up_to_s2_"
[(set (reg:X SP_REGNUM)
(plus:X (reg:X SP_REGNUM)
(match_operand 0 "stack_pop_up_to_s2_operand" "I")))
(set (reg:X S2_REGNUM)
(mem:X (plus:X (reg:X SP_REGNUM)
(const_int ))))
(set (reg:X S1_REGNUM)
(mem:X (plus:X (reg:X SP_REGNUM)
(const_int ))))
(set (reg:X S0_REGNUM)
(mem:X (plus:X (reg:X SP_REGNUM)
(const_int ))))
(set (reg:X RETURN_ADDR_REGNUM)
(mem:X (plus:X (reg:X SP_REGNUM)
(const_int ))))
(return)
(use (reg:SI RETURN_ADDR_REGNUM))]
"TARGET_ZCMP"
"cm.popret {ra, s0-s2}, %0"
[(set_attr "type" "load")])
(define_insn "@gpr_multi_popret_up_to_s3_"
[(set (reg:X SP_REGNUM)
(plus:X (reg:X SP_REGNUM)
(match_operand 0 "stack_pop_up_to_s3_operand" "I")))
(set (reg:X S3_REGNUM)
(mem:X (plus:X (reg:X SP_REGNUM)
(const_int ))))
(set (reg:X S2_REGNUM)
(mem:X (plus:X (reg:X SP_REGNUM)
(const_int ))))
(set (reg:X S1_REGNUM)
(mem:X (plus:X (reg:X SP_REGNUM)
(const_int ))))
(set (reg:X S0_REGNUM)
(mem:X (plus:X (reg:X SP_REGNUM)
(const_int ))))
(set (reg:X RETURN_ADDR_REGNUM)
(mem:X (plus:X (reg:X SP_REGNUM)
(const_int ))))
(return)
(use (reg:SI RETURN_ADDR_REGNUM))]
"TARGET_ZCMP"
"cm.popret {ra, s0-s3}, %0"
[(set_attr "type" "load")])
(define_insn "@gpr_multi_popret_up_to_s4_"
[(set (reg:X SP_REGNUM)
(plus:X (reg:X SP_REGNUM)
(match_operand 0 "stack_pop_up_to_s4_operand" "I")))
(set (reg:X S4_REGNUM)
(mem:X (plus:X (reg:X SP_REGNUM)
(const_int ))))
(set (reg:X S3_REGNUM)
(mem:X (plus:X (reg:X SP_REGNUM)
(const_int ))))
(set (reg:X S2_REGNUM)
(mem:X (plus:X (reg:X SP_REGNUM)
(const_int ))))
(set (reg:X S1_REGNUM)
(mem:X (plus:X (reg:X SP_REGNUM)
(const_int ))))
(set (reg:X S0_REGNUM)
(mem:X (plus:X (reg:X SP_REGNUM)
(const_int ))))
(set (reg:X RETURN_ADDR_REGNUM)
(mem:X (plus:X (reg:X SP_REGNUM)
(const_int ))))
(return)
(use (reg:SI RETURN_ADDR_REGNUM))]
"TARGET_ZCMP"
"cm.popret {ra, s0-s4}, %0"
[(set_attr "type" "load")])
(define_insn "@gpr_multi_popret_up_to_s5_"
[(set (reg:X SP_REGNUM)
(plus:X (reg:X SP_REGNUM)
(match_operand 0 "stack_pop_up_to_s5_operand" "I")))
(set (reg:X S5_REGNUM)
(mem:X (plus:X (reg:X SP_REGNUM)
(const_int ))))
(set (reg:X S4_REGNUM)
(mem:X (plus:X (reg:X SP_REGNUM)
(const_int ))))
(set (reg:X S3_REGNUM)
(mem:X (plus:X (reg:X SP_REGNUM)
(const_int ))))
(set (reg:X S2_REGNUM)
(mem:X (plus:X (reg:X SP_REGNUM)
(const_int ))))
(set (reg:X S1_REGNUM)
(mem:X (plus:X (reg:X SP_REGNUM)
(const_int ))))
(set (reg:X S0_REGNUM)
(mem:X (plus:X (reg:X SP_REGNUM)
(const_int ))))
(set (reg:X RETURN_ADDR_REGNUM)
(mem:X (plus:X (reg:X SP_REGNUM)
(const_int ))))
(return)
(use (reg:SI RETURN_ADDR_REGNUM))]
"TARGET_ZCMP"
"cm.popret {ra, s0-s5}, %0"
[(set_attr "type" "load")])
(define_insn "@gpr_multi_popret_up_to_s6_"
[(set (reg:X SP_REGNUM)
(plus:X (reg:X SP_REGNUM)
(match_operand 0 "stack_pop_up_to_s6_operand" "I")))
(set (reg:X S6_REGNUM)
(mem:X (plus:X (reg:X SP_REGNUM)
(const_int ))))
(set (reg:X S5_REGNUM)
(mem:X (plus:X (reg:X SP_REGNUM)
(const_int ))))
(set (reg:X S4_REGNUM)
(mem:X (plus:X (reg:X SP_REGNUM)
(const_int ))))
(set (reg:X S3_REGNUM)
(mem:X (plus:X (reg:X SP_REGNUM)
(const_int ))))
(set (reg:X S2_REGNUM)
(mem:X (plus:X (reg:X SP_REGNUM)
(const_int ))))
(set (reg:X S1_REGNUM)
(mem:X (plus:X (reg:X SP_REGNUM)
(const_int ))))
(set (reg:X S0_REGNUM)
(mem:X (plus:X (reg:X SP_REGNUM)
(const_int ))))
(set (reg:X RETURN_ADDR_REGNUM)
(mem:X (plus:X (reg:X SP_REGNUM)
(const_int ))))
(return)
(use (reg:SI RETURN_ADDR_REGNUM))]
"TARGET_ZCMP"
"cm.popret {ra, s0-s6}, %0"
[(set_attr "type" "load")])
(define_insn "@gpr_multi_popret_up_to_s7_"
[(set (reg:X SP_REGNUM)
(plus:X (reg:X SP_REGNUM)
(match_operand 0 "stack_pop_up_to_s7_operand" "I")))
(set (reg:X S7_REGNUM)
(mem:X (plus:X (reg:X SP_REGNUM)
(const_int ))))
(set (reg:X S6_REGNUM)
(mem:X (plus:X (reg:X SP_REGNUM)
(const_int ))))
(set (reg:X S5_REGNUM)
(mem:X (plus:X (reg:X SP_REGNUM)
(const_int ))))
(set (reg:X S4_REGNUM)
(mem:X (plus:X (reg:X SP_REGNUM)
(const_int ))))
(set (reg:X S3_REGNUM)
(mem:X (plus:X (reg:X SP_REGNUM)
(const_int ))))
(set (reg:X S2_REGNUM)
(mem:X (plus:X (reg:X SP_REGNUM)
(const_int ))))
(set (reg:X S1_REGNUM)
(mem:X (plus:X (reg:X SP_REGNUM)
(const_int ))))
(set (reg:X S0_REGNUM)
(mem:X (plus:X (reg:X SP_REGNUM)
(const_int ))))
(set (reg:X RETURN_ADDR_REGNUM)
(mem:X (plus:X (reg:X SP_REGNUM)
(const_int ))))
(return)
(use (reg:SI RETURN_ADDR_REGNUM))]
"TARGET_ZCMP"
"cm.popret {ra, s0-s7}, %0"
[(set_attr "type" "load")])
(define_insn "@gpr_multi_popret_up_to_s8_"
[(set (reg:X SP_REGNUM)
(plus:X (reg:X SP_REGNUM)
(match_operand 0 "stack_pop_up_to_s8_operand" "I")))
(set (reg:X S8_REGNUM)
(mem:X (plus:X (reg:X SP_REGNUM)
(const_int ))))
(set (reg:X S7_REGNUM)
(mem:X (plus:X (reg:X SP_REGNUM)
(const_int ))))
(set (reg:X S6_REGNUM)
(mem:X (plus:X (reg:X SP_REGNUM)
(const_int ))))
(set (reg:X S5_REGNUM)
(mem:X (plus:X (reg:X SP_REGNUM)
(const_int ))))
(set (reg:X S4_REGNUM)
(mem:X (plus:X (reg:X SP_REGNUM)
(const_int ))))
(set (reg:X S3_REGNUM)
(mem:X (plus:X (reg:X SP_REGNUM)
(const_int ))))
(set (reg:X S2_REGNUM)
(mem:X (plus:X (reg:X SP_REGNUM)
(const_int ))))
(set (reg:X S1_REGNUM)
(mem:X (plus:X (reg:X SP_REGNUM)
(const_int ))))
(set (reg:X S0_REGNUM)
(mem:X (plus:X (reg:X SP_REGNUM)
(const_int ))))
(set (reg:X RETURN_ADDR_REGNUM)
(mem:X (plus:X (reg:X SP_REGNUM)
(const_int ))))
(return)
(use (reg:SI RETURN_ADDR_REGNUM))]
"TARGET_ZCMP"
"cm.popret {ra, s0-s8}, %0"
[(set_attr "type" "load")])
(define_insn "@gpr_multi_popret_up_to_s9_"
[(set (reg:X SP_REGNUM)
(plus:X (reg:X SP_REGNUM)
(match_operand 0 "stack_pop_up_to_s9_operand" "I")))
(set (reg:X S9_REGNUM)
(mem:X (plus:X (reg:X SP_REGNUM)
(const_int ))))
(set (reg:X S8_REGNUM)
(mem:X (plus:X (reg:X SP_REGNUM)
(const_int ))))
(set (reg:X S7_REGNUM)
(mem:X (plus:X (reg:X SP_REGNUM)
(const_int ))))
(set (reg:X S6_REGNUM)
(mem:X (plus:X (reg:X SP_REGNUM)
(const_int ))))
(set (reg:X S5_REGNUM)
(mem:X (plus:X (reg:X SP_REGNUM)
(const_int ))))
(set (reg:X S4_REGNUM)
(mem:X (plus:X (reg:X SP_REGNUM)
(const_int ))))
(set (reg:X S3_REGNUM)
(mem:X (plus:X (reg:X SP_REGNUM)
(const_int ))))
(set (reg:X S2_REGNUM)
(mem:X (plus:X (reg:X SP_REGNUM)
(const_int ))))
(set (reg:X S1_REGNUM)
(mem:X (plus:X (reg:X SP_REGNUM)
(const_int ))))
(set (reg:X S0_REGNUM)
(mem:X (plus:X (reg:X SP_REGNUM)
(const_int ))))
(set (reg:X RETURN_ADDR_REGNUM)
(mem:X (plus:X (reg:X SP_REGNUM)
(const_int ))))
(return)
(use (reg:SI RETURN_ADDR_REGNUM))]
"TARGET_ZCMP"
"cm.popret {ra, s0-s9}, %0"
[(set_attr "type" "load")])
(define_insn "@gpr_multi_popret_up_to_s11_"
[(set (reg:X SP_REGNUM)
(plus:X (reg:X SP_REGNUM)
(match_operand 0 "stack_pop_up_to_s11_operand" "I")))
(set (reg:X S11_REGNUM)
(mem:X (plus:X (reg:X SP_REGNUM)
(const_int ))))
(set (reg:X S10_REGNUM)
(mem:X (plus:X (reg:X SP_REGNUM)
(const_int ))))
(set (reg:X S9_REGNUM)
(mem:X (plus:X (reg:X SP_REGNUM)
(const_int ))))
(set (reg:X S8_REGNUM)
(mem:X (plus:X (reg:X SP_REGNUM)
(const_int ))))
(set (reg:X S7_REGNUM)
(mem:X (plus:X (reg:X SP_REGNUM)
(const_int ))))
(set (reg:X S6_REGNUM)
(mem:X (plus:X (reg:X SP_REGNUM)
(const_int ))))
(set (reg:X S5_REGNUM)
(mem:X (plus:X (reg:X SP_REGNUM)
(const_int ))))
(set (reg:X S4_REGNUM)
(mem:X (plus:X (reg:X SP_REGNUM)
(const_int ))))
(set (reg:X S3_REGNUM)
(mem:X (plus:X (reg:X SP_REGNUM)
(const_int ))))
(set (reg:X S2_REGNUM)
(mem:X (plus:X (reg:X SP_REGNUM)
(const_int ))))
(set (reg:X S1_REGNUM)
(mem:X (plus:X (reg:X SP_REGNUM)
(const_int ))))
(set (reg:X S0_REGNUM)
(mem:X (plus:X (reg:X SP_REGNUM)
(const_int ))))
(set (reg:X RETURN_ADDR_REGNUM)
(mem:X (plus:X (reg:X SP_REGNUM)
(const_int ))))
(return)
(use (reg:SI RETURN_ADDR_REGNUM))]
"TARGET_ZCMP"
"cm.popret {ra, s0-s11}, %0"
[(set_attr "type" "load")])
(define_insn "@gpr_multi_popretz_up_to_ra_"
[(set (reg:X SP_REGNUM)
(plus:X (reg:X SP_REGNUM)
(match_operand 0 "stack_pop_up_to_ra_operand" "I")))
(set (reg:X RETURN_ADDR_REGNUM)
(mem:X (plus:X (reg:X SP_REGNUM)
(const_int ))))
(set (reg:X A0_REGNUM)
(const_int 0))
(use (reg:X A0_REGNUM))
(return)
(use (reg:SI RETURN_ADDR_REGNUM))]
"TARGET_ZCMP"
"cm.popretz {ra}, %0"
[(set_attr "type" "load")])
(define_insn "@gpr_multi_popretz_up_to_s0_"
[(set (reg:X SP_REGNUM)
(plus:X (reg:X SP_REGNUM)
(match_operand 0 "stack_pop_up_to_s0_operand" "I")))
(set (reg:X S0_REGNUM)
(mem:X (plus:X (reg:X SP_REGNUM)
(const_int ))))
(set (reg:X RETURN_ADDR_REGNUM)
(mem:X (plus:X (reg:X SP_REGNUM)
(const_int ))))
(set (reg:X A0_REGNUM)
(const_int 0))
(use (reg:X A0_REGNUM))
(return)
(use (reg:SI RETURN_ADDR_REGNUM))]
"TARGET_ZCMP"
"cm.popretz {ra, s0}, %0"
[(set_attr "type" "load")])
(define_insn "@gpr_multi_popretz_up_to_s1_"
[(set (reg:X SP_REGNUM)
(plus:X (reg:X SP_REGNUM)
(match_operand 0 "stack_pop_up_to_s1_operand" "I")))
(set (reg:X S1_REGNUM)
(mem:X (plus:X (reg:X SP_REGNUM)
(const_int ))))
(set (reg:X S0_REGNUM)
(mem:X (plus:X (reg:X SP_REGNUM)
(const_int ))))
(set (reg:X RETURN_ADDR_REGNUM)
(mem:X (plus:X (reg:X SP_REGNUM)
(const_int ))))
(set (reg:X A0_REGNUM)
(const_int 0))
(use (reg:X A0_REGNUM))
(return)
(use (reg:SI RETURN_ADDR_REGNUM))]
"TARGET_ZCMP"
"cm.popretz {ra, s0-s1}, %0"
[(set_attr "type" "load")])
(define_insn "@gpr_multi_popretz_up_to_s2_"
[(set (reg:X SP_REGNUM)
(plus:X (reg:X SP_REGNUM)
(match_operand 0 "stack_pop_up_to_s2_operand" "I")))
(set (reg:X S2_REGNUM)
(mem:X (plus:X (reg:X SP_REGNUM)
(const_int ))))
(set (reg:X S1_REGNUM)
(mem:X (plus:X (reg:X SP_REGNUM)
(const_int ))))
(set (reg:X S0_REGNUM)
(mem:X (plus:X (reg:X SP_REGNUM)
(const_int ))))
(set (reg:X RETURN_ADDR_REGNUM)
(mem:X (plus:X (reg:X SP_REGNUM)
(const_int ))))
(set (reg:X A0_REGNUM)
(const_int 0))
(use (reg:X A0_REGNUM))
(return)
(use (reg:SI RETURN_ADDR_REGNUM))]
"TARGET_ZCMP"
"cm.popretz {ra, s0-s2}, %0"
[(set_attr "type" "load")])
(define_insn "@gpr_multi_popretz_up_to_s3_"
[(set (reg:X SP_REGNUM)
(plus:X (reg:X SP_REGNUM)
(match_operand 0 "stack_pop_up_to_s3_operand" "I")))
(set (reg:X S3_REGNUM)
(mem:X (plus:X (reg:X SP_REGNUM)
(const_int ))))
(set (reg:X S2_REGNUM)
(mem:X (plus:X (reg:X SP_REGNUM)
(const_int ))))
(set (reg:X S1_REGNUM)
(mem:X (plus:X (reg:X SP_REGNUM)
(const_int ))))
(set (reg:X S0_REGNUM)
(mem:X (plus:X (reg:X SP_REGNUM)
(const_int ))))
(set (reg:X RETURN_ADDR_REGNUM)
(mem:X (plus:X (reg:X SP_REGNUM)
(const_int ))))
(set (reg:X A0_REGNUM)
(const_int 0))
(use (reg:X A0_REGNUM))
(return)
(use (reg:SI RETURN_ADDR_REGNUM))]
"TARGET_ZCMP"
"cm.popretz {ra, s0-s3}, %0"
[(set_attr "type" "load")])
(define_insn "@gpr_multi_popretz_up_to_s4_"
[(set (reg:X SP_REGNUM)
(plus:X (reg:X SP_REGNUM)
(match_operand 0 "stack_pop_up_to_s4_operand" "I")))
(set (reg:X S4_REGNUM)
(mem:X (plus:X (reg:X SP_REGNUM)
(const_int ))))
(set (reg:X S3_REGNUM)
(mem:X (plus:X (reg:X SP_REGNUM)
(const_int ))))
(set (reg:X S2_REGNUM)
(mem:X (plus:X (reg:X SP_REGNUM)
(const_int ))))
(set (reg:X S1_REGNUM)
(mem:X (plus:X (reg:X SP_REGNUM)
(const_int ))))
(set (reg:X S0_REGNUM)
(mem:X (plus:X (reg:X SP_REGNUM)
(const_int ))))
(set (reg:X RETURN_ADDR_REGNUM)
(mem:X (plus:X (reg:X SP_REGNUM)
(const_int ))))
(set (reg:X A0_REGNUM)
(const_int 0))
(use (reg:X A0_REGNUM))
(return)
(use (reg:SI RETURN_ADDR_REGNUM))]
"TARGET_ZCMP"
"cm.popretz {ra, s0-s4}, %0"
[(set_attr "type" "load")])
(define_insn "@gpr_multi_popretz_up_to_s5_"
[(set (reg:X SP_REGNUM)
(plus:X (reg:X SP_REGNUM)
(match_operand 0 "stack_pop_up_to_s5_operand" "I")))
(set (reg:X S5_REGNUM)
(mem:X (plus:X (reg:X SP_REGNUM)
(const_int ))))
(set (reg:X S4_REGNUM)
(mem:X (plus:X (reg:X SP_REGNUM)
(const_int ))))
(set (reg:X S3_REGNUM)
(mem:X (plus:X (reg:X SP_REGNUM)
(const_int ))))
(set (reg:X S2_REGNUM)
(mem:X (plus:X (reg:X SP_REGNUM)
(const_int ))))
(set (reg:X S1_REGNUM)
(mem:X (plus:X (reg:X SP_REGNUM)
(const_int ))))
(set (reg:X S0_REGNUM)
(mem:X (plus:X (reg:X SP_REGNUM)
(const_int ))))
(set (reg:X RETURN_ADDR_REGNUM)
(mem:X (plus:X (reg:X SP_REGNUM)
(const_int ))))
(set (reg:X A0_REGNUM)
(const_int 0))
(use (reg:X A0_REGNUM))
(return)
(use (reg:SI RETURN_ADDR_REGNUM))]
"TARGET_ZCMP"
"cm.popretz {ra, s0-s5}, %0"
[(set_attr "type" "load")])
(define_insn "@gpr_multi_popretz_up_to_s6_"
[(set (reg:X SP_REGNUM)
(plus:X (reg:X SP_REGNUM)
(match_operand 0 "stack_pop_up_to_s6_operand" "I")))
(set (reg:X S6_REGNUM)
(mem:X (plus:X (reg:X SP_REGNUM)
(const_int ))))
(set (reg:X S5_REGNUM)
(mem:X (plus:X (reg:X SP_REGNUM)
(const_int ))))
(set (reg:X S4_REGNUM)
(mem:X (plus:X (reg:X SP_REGNUM)
(const_int ))))
(set (reg:X S3_REGNUM)
(mem:X (plus:X (reg:X SP_REGNUM)
(const_int ))))
(set (reg:X S2_REGNUM)
(mem:X (plus:X (reg:X SP_REGNUM)
(const_int ))))
(set (reg:X S1_REGNUM)
(mem:X (plus:X (reg:X SP_REGNUM)
(const_int ))))
(set (reg:X S0_REGNUM)
(mem:X (plus:X (reg:X SP_REGNUM)
(const_int ))))
(set (reg:X RETURN_ADDR_REGNUM)
(mem:X (plus:X (reg:X SP_REGNUM)
(const_int ))))
(set (reg:X A0_REGNUM)
(const_int 0))
(use (reg:X A0_REGNUM))
(return)
(use (reg:SI RETURN_ADDR_REGNUM))]
"TARGET_ZCMP"
"cm.popretz {ra, s0-s6}, %0"
[(set_attr "type" "load")])
(define_insn "@gpr_multi_popretz_up_to_s7_"
[(set (reg:X SP_REGNUM)
(plus:X (reg:X SP_REGNUM)
(match_operand 0 "stack_pop_up_to_s7_operand" "I")))
(set (reg:X S7_REGNUM)
(mem:X (plus:X (reg:X SP_REGNUM)
(const_int ))))
(set (reg:X S6_REGNUM)
(mem:X (plus:X (reg:X SP_REGNUM)
(const_int ))))
(set (reg:X S5_REGNUM)
(mem:X (plus:X (reg:X SP_REGNUM)
(const_int ))))
(set (reg:X S4_REGNUM)
(mem:X (plus:X (reg:X SP_REGNUM)
(const_int ))))
(set (reg:X S3_REGNUM)
(mem:X (plus:X (reg:X SP_REGNUM)
(const_int ))))
(set (reg:X S2_REGNUM)
(mem:X (plus:X (reg:X SP_REGNUM)
(const_int ))))
(set (reg:X S1_REGNUM)
(mem:X (plus:X (reg:X SP_REGNUM)
(const_int ))))
(set (reg:X S0_REGNUM)
(mem:X (plus:X (reg:X SP_REGNUM)
(const_int ))))
(set (reg:X RETURN_ADDR_REGNUM)
(mem:X (plus:X (reg:X SP_REGNUM)
(const_int ))))
(set (reg:X A0_REGNUM)
(const_int 0))
(use (reg:X A0_REGNUM))
(return)
(use (reg:SI RETURN_ADDR_REGNUM))]
"TARGET_ZCMP"
"cm.popretz {ra, s0-s7}, %0"
[(set_attr "type" "load")])
(define_insn "@gpr_multi_popretz_up_to_s8_"
[(set (reg:X SP_REGNUM)
(plus:X (reg:X SP_REGNUM)
(match_operand 0 "stack_pop_up_to_s8_operand" "I")))
(set (reg:X S8_REGNUM)
(mem:X (plus:X (reg:X SP_REGNUM)
(const_int ))))
(set (reg:X S7_REGNUM)
(mem:X (plus:X (reg:X SP_REGNUM)
(const_int ))))
(set (reg:X S6_REGNUM)
(mem:X (plus:X (reg:X SP_REGNUM)
(const_int ))))
(set (reg:X S5_REGNUM)
(mem:X (plus:X (reg:X SP_REGNUM)
(const_int ))))
(set (reg:X S4_REGNUM)
(mem:X (plus:X (reg:X SP_REGNUM)
(const_int ))))
(set (reg:X S3_REGNUM)
(mem:X (plus:X (reg:X SP_REGNUM)
(const_int ))))
(set (reg:X S2_REGNUM)
(mem:X (plus:X (reg:X SP_REGNUM)
(const_int ))))
(set (reg:X S1_REGNUM)
(mem:X (plus:X (reg:X SP_REGNUM)
(const_int ))))
(set (reg:X S0_REGNUM)
(mem:X (plus:X (reg:X SP_REGNUM)
(const_int ))))
(set (reg:X RETURN_ADDR_REGNUM)
(mem:X (plus:X (reg:X SP_REGNUM)
(const_int ))))
(set (reg:X A0_REGNUM)
(const_int 0))
(use (reg:X A0_REGNUM))
(return)
(use (reg:SI RETURN_ADDR_REGNUM))]
"TARGET_ZCMP"
"cm.popretz {ra, s0-s8}, %0"
[(set_attr "type" "load")])
(define_insn "@gpr_multi_popretz_up_to_s9_"
[(set (reg:X SP_REGNUM)
(plus:X (reg:X SP_REGNUM)
(match_operand 0 "stack_pop_up_to_s9_operand" "I")))
(set (reg:X S9_REGNUM)
(mem:X (plus:X (reg:X SP_REGNUM)
(const_int ))))
(set (reg:X S8_REGNUM)
(mem:X (plus:X (reg:X SP_REGNUM)
(const_int ))))
(set (reg:X S7_REGNUM)
(mem:X (plus:X (reg:X SP_REGNUM)
(const_int ))))
(set (reg:X S6_REGNUM)
(mem:X (plus:X (reg:X SP_REGNUM)
(const_int ))))
(set (reg:X S5_REGNUM)
(mem:X (plus:X (reg:X SP_REGNUM)
(const_int ))))
(set (reg:X S4_REGNUM)
(mem:X (plus:X (reg:X SP_REGNUM)
(const_int ))))
(set (reg:X S3_REGNUM)
(mem:X (plus:X (reg:X SP_REGNUM)
(const_int