xref: /dflybsd-src/contrib/gcc-8.0/gcc/dojump.h (revision 38fd149817dfbff97799f62fcb70be98c4e32523)
1*38fd1498Szrj /* Export function prototypes from dojump.c.
2*38fd1498Szrj    Copyright (C) 2015-2018 Free Software Foundation, Inc.
3*38fd1498Szrj 
4*38fd1498Szrj This file is part of GCC.
5*38fd1498Szrj 
6*38fd1498Szrj GCC is free software; you can redistribute it and/or modify it under
7*38fd1498Szrj the terms of the GNU General Public License as published by the Free
8*38fd1498Szrj Software Foundation; either version 3, or (at your option) any later
9*38fd1498Szrj version.
10*38fd1498Szrj 
11*38fd1498Szrj GCC is distributed in the hope that it will be useful, but WITHOUT ANY
12*38fd1498Szrj WARRANTY; without even the implied warranty of MERCHANTABILITY or
13*38fd1498Szrj FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
14*38fd1498Szrj for more details.
15*38fd1498Szrj 
16*38fd1498Szrj You should have received a copy of the GNU General Public License
17*38fd1498Szrj along with GCC; see the file COPYING3.  If not see
18*38fd1498Szrj <http://www.gnu.org/licenses/>.  */
19*38fd1498Szrj 
20*38fd1498Szrj #ifndef GCC_DOJUMP_H
21*38fd1498Szrj #define GCC_DOJUMP_H
22*38fd1498Szrj 
23*38fd1498Szrj /* At the start of a function, record that we have no previously-pushed
24*38fd1498Szrj    arguments waiting to be popped.  */
25*38fd1498Szrj extern void init_pending_stack_adjust (void);
26*38fd1498Szrj 
27*38fd1498Szrj /* Discard any pending stack adjustment.  */
28*38fd1498Szrj extern void discard_pending_stack_adjust (void);
29*38fd1498Szrj 
30*38fd1498Szrj /* When exiting from function, if safe, clear out any pending stack adjust
31*38fd1498Szrj    so the adjustment won't get done.  */
32*38fd1498Szrj extern void clear_pending_stack_adjust (void);
33*38fd1498Szrj 
34*38fd1498Szrj /* Pop any previously-pushed arguments that have not been popped yet.  */
35*38fd1498Szrj extern void do_pending_stack_adjust (void);
36*38fd1498Szrj 
37*38fd1498Szrj /* Struct for saving/restoring of pending_stack_adjust/stack_pointer_delta
38*38fd1498Szrj    values.  */
39*38fd1498Szrj 
40*38fd1498Szrj struct saved_pending_stack_adjust
41*38fd1498Szrj {
42*38fd1498Szrj   /* Saved value of pending_stack_adjust.  */
43*38fd1498Szrj   poly_int64 x_pending_stack_adjust;
44*38fd1498Szrj 
45*38fd1498Szrj   /* Saved value of stack_pointer_delta.  */
46*38fd1498Szrj   poly_int64 x_stack_pointer_delta;
47*38fd1498Szrj };
48*38fd1498Szrj 
49*38fd1498Szrj /* Remember pending_stack_adjust/stack_pointer_delta.
50*38fd1498Szrj    To be used around code that may call do_pending_stack_adjust (),
51*38fd1498Szrj    but the generated code could be discarded e.g. using delete_insns_since.  */
52*38fd1498Szrj 
53*38fd1498Szrj extern void save_pending_stack_adjust (saved_pending_stack_adjust *);
54*38fd1498Szrj 
55*38fd1498Szrj /* Restore the saved pending_stack_adjust/stack_pointer_delta.  */
56*38fd1498Szrj 
57*38fd1498Szrj extern void restore_pending_stack_adjust (saved_pending_stack_adjust *);
58*38fd1498Szrj 
59*38fd1498Szrj /* Generate code to evaluate EXP and jump to LABEL if the value is zero.  */
60*38fd1498Szrj extern void jumpifnot (tree exp, rtx_code_label *label,
61*38fd1498Szrj 		       profile_probability prob);
62*38fd1498Szrj extern void jumpifnot_1 (enum tree_code, tree, tree, rtx_code_label *,
63*38fd1498Szrj 			 profile_probability);
64*38fd1498Szrj 
65*38fd1498Szrj /* Generate code to evaluate EXP and jump to LABEL if the value is nonzero.  */
66*38fd1498Szrj extern void jumpif (tree exp, rtx_code_label *label, profile_probability prob);
67*38fd1498Szrj extern void jumpif_1 (enum tree_code, tree, tree, rtx_code_label *,
68*38fd1498Szrj 		      profile_probability);
69*38fd1498Szrj 
70*38fd1498Szrj /* Generate code to evaluate EXP and jump to IF_FALSE_LABEL if
71*38fd1498Szrj    the result is zero, or IF_TRUE_LABEL if the result is one.  */
72*38fd1498Szrj extern void do_jump (tree exp, rtx_code_label *if_false_label,
73*38fd1498Szrj 		     rtx_code_label *if_true_label, profile_probability prob);
74*38fd1498Szrj extern void do_jump_1 (enum tree_code, tree, tree, rtx_code_label *,
75*38fd1498Szrj 		       rtx_code_label *, profile_probability);
76*38fd1498Szrj 
77*38fd1498Szrj extern void do_compare_rtx_and_jump (rtx, rtx, enum rtx_code, int,
78*38fd1498Szrj 				     machine_mode, rtx, rtx_code_label *,
79*38fd1498Szrj 				     rtx_code_label *, profile_probability);
80*38fd1498Szrj 
81*38fd1498Szrj extern bool split_comparison (enum rtx_code, machine_mode,
82*38fd1498Szrj 			      enum rtx_code *, enum rtx_code *);
83*38fd1498Szrj 
84*38fd1498Szrj #endif /* GCC_DOJUMP_H */
85