osprey/kg++fe/gnu/genrecog.c File Reference

#include "hconfig.h"
#include "system.h"
#include "rtl.h"
#include "errors.h"
#include "gensupport.h"

Include dependency graph for genrecog.c:

Go to the source code of this file.

Data Types

type  decision_head
type  decision_test
type  decision
type  pred_table

Defines

#define OUTPUT_LABEL(INDENT_STRING, LABEL_NUMBER)   printf("%sL%d: ATTRIBUTE_UNUSED_LABEL\n", (INDENT_STRING), (LABEL_NUMBER))
#define SUBROUTINE_THRESHOLD   100
#define IS_SPLIT(X)   ((X) != RECOG)
#define NUM_KNOWN_PREDS   ARRAY_SIZE (preds)
#define NUM_SPECIAL_MODE_PREDS   ARRAY_SIZE (special_mode_pred_table)

Enumerations

enum  routine_type {
  RECOG, SPLIT, PEEPHOLE2, RECOG,
  SPLIT, PEEPHOLE2, RECOG, SPLIT,
  PEEPHOLE2, RECOG, SPLIT, PEEPHOLE2
}

Functions/Subroutines

static struct decision
*new_decision 
PARAMS ((const char *, struct decision_head *))
static struct decision_test
*new_decision_test 
PARAMS ((enum decision_type, struct decision_test ***))
static rtx find_operand PARAMS ((rtx, int))
static void validate_pattern PARAMS ((rtx, rtx, rtx, int))
static struct decision
*add_to_sequence 
PARAMS ((rtx, struct decision_head *, const char *, enum routine_type, int))
static int maybe_both_true_2 PARAMS ((struct decision_test *, struct decision_test *))
static int maybe_both_true PARAMS ((struct decision *, struct decision *, int))
static int nodes_identical PARAMS ((struct decision *, struct decision *))
static void merge_trees PARAMS ((struct decision_head *, struct decision_head *))
static void factor_tests PARAMS ((struct decision_head *))
static int break_out_subroutines PARAMS ((struct decision_head *, int))
static void find_afterward PARAMS ((struct decision_head *, struct decision *))
static void change_state PARAMS ((const char *, const char *, struct decision *, const char *))
static void print_code PARAMS ((enum rtx_code))
static void write_afterward PARAMS ((struct decision *, struct decision *, const char *))
static struct decision
*write_switch 
PARAMS ((struct decision *, int))
static void write_cond PARAMS ((struct decision_test *, int, enum routine_type))
static void write_action PARAMS ((struct decision *, struct decision_test *, int, int, struct decision *, enum routine_type))
static int is_unconditional PARAMS ((struct decision_test *, enum routine_type))
static int write_node PARAMS ((struct decision *, int, enum routine_type))
static void write_tree_1 PARAMS ((struct decision_head *, int, enum routine_type))
static void write_tree PARAMS ((struct decision_head *, const char *, enum routine_type, int))
static void write_subroutine PARAMS ((struct decision_head *, enum routine_type))
static void write_header PARAMS ((void))
static struct decision_head
make_insn_sequence 
PARAMS ((rtx, enum routine_type))
static void record_insn_name PARAMS ((int, const char *))
static void debug_decision_0 PARAMS ((struct decision *, int, int))
static void debug_decision_2 PARAMS ((struct decision_test *))
void debug_decision PARAMS ((struct decision *))
static struct decisionnew_decision (char *position, struct decision_head *last) const
static struct decision_testnew_decision_test (enum decision_type type, struct decision_test ***pplace)
static rtx find_operand (rtx pattern, int n)
static rtx find_matching_operand (rtx pattern, int n)
static void validate_pattern (rtx pattern, rtx insn, rtx set, int set_code)
static struct decisionadd_to_sequence (rtx pattern, struct decision_head *last, const char *position, enum routine_type insn_type, int top)
static int maybe_both_true_2 (struct decision_test *d1, struct decision_test *d2)
static int maybe_both_true_1 (struct decision_test *d1, struct decision_test *d2)
static int maybe_both_true (struct decision *d1, struct decision *d2, int toplevel)
static int nodes_identical_1 (struct decision_test *d1, struct decision_test *d2)
static int nodes_identical (struct decision *d1, struct decision *d2)
static void merge_accept_insn (struct decision *oldd, struct decision *addd)
static void merge_trees (struct decision_head *oldh, struct decision_head *addh)
static void factor_tests (struct decision_head *head)
static void simplify_tests (struct decision_head *head)
static int break_out_subroutines (struct decision_head *head, int initial)
static void find_afterward (struct decision_head *head, struct decision *real_afterward)
static void change_state (char *oldpos, const char *newpos, struct decision *afterward, const char *indent) const
static void print_code (enum rtx_code code)
static void write_afterward (struct decision *start, struct decision *afterward, const char *indent)
static struct decisionwrite_switch (struct decision *start, int depth)
static void write_cond (struct decision_test *p, int depth, enum routine_type subroutine_type)
static void write_action (struct decision *p, struct decision_test *test, int depth, int uncond, struct decision *success, enum routine_type subroutine_type)
static int is_unconditional (struct decision_test *t, enum routine_type subroutine_type)
static int write_node (struct decision *p, int depth, enum routine_type subroutine_type)
static void write_tree_1 (struct decision_head *head, int depth, enum routine_type subroutine_type)
static void write_tree (struct decision_head *head, const char *prevpos, enum routine_type type, int initial)
static void write_subroutine (struct decision_head *head, enum routine_type type)
static void write_subroutines (struct decision_head *head, enum routine_type type)
static void write_header ()
static struct decision_head make_insn_sequence (rtx insn, enum routine_type type)
static void process_tree (struct decision_head *head, enum routine_type subroutine_type)
int main PARAMS ((int, char **))
int main (int argc, char **argv)
const char * get_insn_name (int code)
static void record_insn_name (int code, const char *name)
static void debug_decision_2 (struct decision_test *test)
static void debug_decision_1 (struct decision *d, int indent)
static void debug_decision_0 (struct decision *d, int indent, int maxdepth)
void debug_decision (struct decision *d)
void debug_decision_list (struct decision *d)

Variables

static char ** insn_name_ptr = 0
static int insn_name_ptr_size = 0
static int next_subroutine_number
static int next_number
static int next_insn_code
static int next_index
static int max_depth
static int pattern_lineno
static int error_count
static struct pred_table preds []
static const char *const special_mode_pred_table []


Define Documentation

#define IS_SPLIT ( X   )     ((X) != RECOG)

Definition at line 156 of file genrecog.c.

Referenced by write_subroutine(), and write_tree().

#define NUM_KNOWN_PREDS   ARRAY_SIZE (preds)

Definition at line 222 of file genrecog.c.

Referenced by add_to_sequence(), and validate_pattern().

#define NUM_SPECIAL_MODE_PREDS   ARRAY_SIZE (special_mode_pred_table)

Definition at line 231 of file genrecog.c.

Referenced by validate_pattern().

#define OUTPUT_LABEL ( INDENT_STRING,
LABEL_NUMBER   )     printf("%sL%d: ATTRIBUTE_UNUSED_LABEL\n", (INDENT_STRING), (LABEL_NUMBER))

Definition at line 64 of file genrecog.c.

Referenced by write_tree(), and write_tree_1().

#define SUBROUTINE_THRESHOLD   100

Definition at line 144 of file genrecog.c.

Referenced by break_out_subroutines().


Enumeration Type Documentation

Enumerator:
RECOG 
SPLIT 
PEEPHOLE2 
RECOG 
SPLIT 
PEEPHOLE2 
RECOG 
SPLIT 
PEEPHOLE2 
RECOG 
SPLIT 
PEEPHOLE2 

Definition at line 152 of file genrecog.c.


Function Documentation

static struct decision* add_to_sequence ( rtx  pattern,
struct decision_head last,
const char *  position,
enum routine_type  insn_type,
int  top 
) [static, read]

static int break_out_subroutines ( struct decision_head head,
int  initial 
) [static]

static void change_state ( char *  oldpos,
const char *  newpos,
struct decision afterward,
const char *  indent 
) const [static]

Definition at line 1692 of file genrecog.c.

References ISLOWER, ISUPPER, decision::number, printf(), strlen(), and strncmp().

Referenced by write_afterward(), and write_tree().

void debug_decision ( struct decision d  ) 

Definition at line 2886 of file genrecog.c.

static void debug_decision_0 ( struct decision d,
int  indent,
int  maxdepth 
) [static]

static void debug_decision_1 ( struct decision d,
int  indent 
) [static]

Definition at line 2828 of file genrecog.c.

References debug_decision_2(), fprintf(), fputs(), decision_test::next, NULL, and putc().

Referenced by debug_decision_0().

static void debug_decision_2 ( struct decision_test test  )  [static]

Definition at line 2768 of file genrecog.c.

References abort, fprintf(), GET_MODE_NAME, GET_RTX_NAME, HOST_WIDE_INT_PRINT_DEC, memcpy, strncpy(), and sub.

Referenced by debug_decision_1().

void debug_decision_list ( struct decision d  ) 

Definition at line 2893 of file genrecog.c.

static void factor_tests ( struct decision_head head  )  [static]

static void find_afterward ( struct decision_head head,
struct decision real_afterward 
) [static]

static rtx find_matching_operand ( rtx  pattern,
int  n 
) [static]

Definition at line 416 of file genrecog.c.

References abort, GET_CODE, GET_RTX_FORMAT, GET_RTX_LENGTH, i, len, NULL, r, RTX_CODE, XEXP, XSTR, XVEC, XVECEXP, and XVECLEN.

Referenced by find_matching_operand(), and validate_pattern().

static rtx find_operand ( rtx  pattern,
int  n 
) [static]

Definition at line 361 of file genrecog.c.

References abort, GET_CODE, GET_RTX_FORMAT, GET_RTX_LENGTH, i, len, NULL, NULL_RTX, r, RTX_CODE, XEXP, XINT, XVEC, XVECEXP, and XVECLEN.

Referenced by find_operand(), and validate_pattern().

const char* get_insn_name ( int code   ) 

Definition at line 2724 of file genrecog.c.

References insn_name_ptr, insn_name_ptr_size, and NULL.

static int is_unconditional ( struct decision_test t,
enum routine_type  subroutine_type 
) [static]

Definition at line 2147 of file genrecog.c.

References abort, PEEPHOLE2, RECOG, and SPLIT.

Referenced by write_node().

int main ( int argc  ,
char **  argv 
)

static struct decision_head make_insn_sequence ( rtx  insn,
enum routine_type  type 
) [static, read]

Definition at line 2455 of file genrecog.c.

References insn.

Referenced by main().

static int maybe_both_true ( struct decision d1,
struct decision d2,
int  toplevel 
) [static]

static int maybe_both_true_1 ( struct decision_test d1,
struct decision_test d2 
) [static]

Definition at line 1178 of file genrecog.c.

References decision_test::DT_accept_op, maybe_both_true_2(), decision_test::next, t1, and t2.

Referenced by maybe_both_true().

static int maybe_both_true_2 ( struct decision_test d1,
struct decision_test d2 
) [static]

static void merge_accept_insn ( struct decision oldd,
struct decision addd 
) [static]

static void merge_trees ( struct decision_head oldh,
struct decision_head addh 
) [static]

static struct decision* new_decision ( char *  position,
struct decision_head last 
) const [static, read]

static struct decision_test* new_decision_test ( enum decision_type  type,
struct decision_test ***  pplace 
) [static, read]

Definition at line 340 of file genrecog.c.

References decision_test::next, decision_test::type, and xmalloc().

Referenced by add_to_sequence(), and make_insn_sequence().

static int nodes_identical ( struct decision d1,
struct decision d2 
) [static]

Definition at line 1330 of file genrecog.c.

References decision_test::next, nodes_identical_1(), strcmp(), t1, t2, and decision_test::type.

Referenced by merge_trees().

static int nodes_identical_1 ( struct decision_test d1,
struct decision_test d2 
) [static]

Definition at line 1282 of file genrecog.c.

References abort, and strcmp().

Referenced by nodes_identical(), and write_switch().

int main PARAMS ( (int, char **)   ) 

void debug_decision PARAMS ( (struct decision *)   ) 

static void debug_decision_2 PARAMS ( (struct decision_test *)   )  [static]

static void debug_decision_0 PARAMS ( (struct decision *, int, int)   )  [static]

static void record_insn_name PARAMS ( (int, const char *)   )  [static]

static struct decision_head make_insn_sequence PARAMS ( (rtx, enum routine_type  )  [static, read]

static void write_header PARAMS ( (void  )  [static, read]

Definition at line 77 of file cplus-dem.c.

static void write_subroutine PARAMS ( (struct decision_head *, enum routine_type  )  [static]

static void write_tree PARAMS ( (struct decision_head *, const char *, enum routine_type, int)   )  [static]

static void write_tree_1 PARAMS ( (struct decision_head *, int, enum routine_type  )  [static]

static int write_node PARAMS ( (struct decision *, int, enum routine_type  )  [static]

static int is_unconditional PARAMS ( (struct decision_test *, enum routine_type  )  [static]

static void write_action PARAMS ( (struct decision *, struct decision_test *, int, int, struct decision *, enum routine_type  )  [static]

static void write_cond PARAMS ( (struct decision_test *, int, enum routine_type  )  [static]

static struct decision* write_switch PARAMS ( (struct decision *, int)   )  [static, read]

static void write_afterward PARAMS ( (struct decision *, struct decision *, const char *)   )  [static]

static void print_code PARAMS ( (enum rtx_code  )  [static]

static void change_state PARAMS ( (const char *, const char *, struct decision *, const char *)   )  [static]

static void find_afterward PARAMS ( (struct decision_head *, struct decision *)   )  [static]

static int break_out_subroutines PARAMS ( (struct decision_head *, int)   )  [static]

static void factor_tests PARAMS ( (struct decision_head *)   )  [static]

static void merge_trees PARAMS ( (struct decision_head *, struct decision_head *)   )  [static]

static int nodes_identical PARAMS ( (struct decision *, struct decision *)   )  [static]

static int maybe_both_true PARAMS ( (struct decision *, struct decision *, int)   )  [static]

static int maybe_both_true_2 PARAMS ( (struct decision_test *, struct decision_test *)   )  [static]

static struct decision* add_to_sequence PARAMS ( (rtx, struct decision_head *, const char *, enum routine_type, int)   )  [static, read]

static void validate_pattern PARAMS ( (rtx, rtx, rtx, int)   )  [static]

static rtx find_operand PARAMS ( (rtx, int)   )  [static]

static struct decision_test* new_decision_test PARAMS ( (enum decision_type, struct decision_test ***)   )  [static, read]

static struct decision* new_decision PARAMS ( (const char *, struct decision_head *)   )  [static, read]

static void print_code ( enum rtx_code  code  )  [static]

Definition at line 1753 of file genrecog.c.

References GET_RTX_NAME, p, putchar(), and TOUPPER.

static void process_tree ( struct decision_head head,
enum routine_type  subroutine_type 
) [static]

static void record_insn_name ( int  code,
const char *  name 
) [static]

static void simplify_tests ( struct decision_head head  )  [static]

static void validate_pattern ( rtx  pattern,
rtx  insn,
rtx  set,
int  set_code 
) [static]

static void write_action ( struct decision p,
struct decision_test test,
int  depth,
int  uncond,
struct decision success,
enum routine_type  subroutine_type 
) [static]

static void write_afterward ( struct decision start,
struct decision afterward,
const char *  indent 
) [static]

static void write_cond ( struct decision_test p,
int  depth,
enum routine_type  subroutine_type 
) [static]

Definition at line 1981 of file genrecog.c.

References abort, GET_MODE_NAME, HOST_WIDE_INT_PRINT_DEC_C, print_code(), printf(), and RECOG.

Referenced by write_node().

static void write_header ( void   )  [static]

Definition at line 2395 of file genrecog.c.

References puts().

static int write_node ( struct decision p,
int  depth,
enum routine_type  subroutine_type 
) [static]

Definition at line 2176 of file genrecog.c.

References is_unconditional(), decision_test::next, NULL, printf(), write_action(), and write_cond().

Referenced by write_tree_1().

static void write_subroutine ( struct decision_head head,
enum routine_type  type 
) [static]

Definition at line 2311 of file genrecog.c.

References i, IS_SPLIT, max_depth, PEEPHOLE2, printf(), RECOG, SPLIT, sprintf(), strcpy, and write_tree().

Referenced by process_tree(), and write_subroutines().

static void write_subroutines ( struct decision_head head,
enum routine_type  type 
) [static]

Definition at line 2378 of file genrecog.c.

References decision_head::first, decision::next, p, decision::success, and write_subroutine().

Referenced by process_tree(), and write_subroutines().

static struct decision* write_switch ( struct decision start,
int  depth 
) [static, read]

static void write_tree ( struct decision_head head,
const char *  prevpos,
enum routine_type  type,
int  initial 
) [static]

static void write_tree_1 ( struct decision_head head,
int  depth,
enum routine_type  subroutine_type 
) [static]


Variable Documentation

int error_count [static]

Definition at line 180 of file genrecog.c.

char** insn_name_ptr = 0 [static]

Definition at line 68 of file genrecog.c.

int insn_name_ptr_size = 0 [static]

Definition at line 69 of file genrecog.c.

int max_depth [static]

int next_index [static]

Definition at line 169 of file genrecog.c.

int next_insn_code [static]

Definition at line 164 of file genrecog.c.

Referenced by main(), and make_insn_sequence().

int next_number [static]

Definition at line 160 of file genrecog.c.

Referenced by new_decision().

int next_subroutine_number [static]

Definition at line 146 of file genrecog.c.

Referenced by break_out_subroutines(), and process_tree().

int pattern_lineno [static]

struct pred_table preds[] [static]

const char* const special_mode_pred_table[] [static]

Initial value:

 {



  "pmode_register_operand"
}

Definition at line 224 of file genrecog.c.

Referenced by validate_pattern().


Generated on Wed Apr 8 15:34:19 2009 for Open64 by  doxygen 1.5.6