Lines Matching defs:test

74 /* A single test.  The two accept types aren't tests per-se, but
83 /* These types are roughly in the order in which we'd like to test them. */
98 RTX_CODE code; /* Code to test. */
108 const char *c_test; /* Additional test to perform. */
126 struct decision_head success; /* Nodes to test on success. */
127 struct decision *next; /* Node to test on failure. */
129 struct decision *afterward; /* Node to test on success,
509 /* Create a new test and link it in at PLACE. */
515 struct decision_test *test;
517 test = XNEW (struct decision_test);
518 test->next = *place;
519 test->type = type;
520 *place = test;
522 place = &test->next;
525 return test;
903 struct decision_test *test;
939 test = new_decision_test (DT_num_insns, &place);
940 test->u.num_insns = num_insns;
971 test = new_decision_test (DT_veclen_ge, &place);
972 test->u.veclen = XVECLEN (pattern, 2);
1001 test = new_decision_test (DT_pred, &place);
1002 test->u.pred.name = pred_name;
1003 test->u.pred.mode = mode;
1015 test->u.pred.data = pred;
1036 test = new_decision_test (DT_accept_op, &place);
1037 test->u.opno = XINT (pattern, 0);
1055 test = new_decision_test (DT_dup, &place);
1056 test->u.dup = XINT (pattern, 0);
1058 test = new_decision_test (DT_accept_op, &place);
1059 test->u.opno = XINT (pattern, 0);
1073 test = new_decision_test (DT_dup, &place);
1074 test->u.dup = XINT (pattern, 0);
1097 test = new_decision_test (DT_elt_zero_int, &place);
1098 test->u.intval = XINT (pattern, i);
1102 test = new_decision_test (DT_elt_one_int, &place);
1103 test->u.intval = XINT (pattern, i);
1116 test = new_decision_test (type, &place);
1117 test->u.intval = XWINT (pattern, i);
1123 test = new_decision_test (DT_veclen, &place);
1124 test->u.veclen = XVECLEN (pattern, i);
1128 /* Now test our sub-patterns. */
1168 test = new_decision_test (DT_code, &place);
1169 test->u.code = code;
1175 test = new_decision_test (DT_mode, &place);
1176 test->u.mode = mode;
1188 /* A subroutine of maybe_both_true; examines only one test.
1302 this by the existence of a lone DT_accept_op test. */
1577 /* Insert the nodes in DT test type order, which is roughly
1578 how expensive/important the test is. Given that the tests
1608 Factor out the common test into a new node. This enables us
1609 (depending on the test type) to emit switch statements later. */
1638 /* If we'd been performing more than one test, create a new node
1639 below our first test. */
1647 /* Crop the node tree off after our first test. */
1652 /* For each compatible test, adjust to perform only one test in
1690 by having only a single test on a node -- we'll be manipulating
1892 /* If we have two or more nodes in sequence that test the same one
1939 we don't actually write the test here, as it gets kinda messy.
2080 /* Emit code for one test. */
2157 write_action (struct decision *p, struct decision_test *test,
2166 else if (test->type == DT_accept_op || test->type == DT_accept_insn)
2175 if (test->type == DT_accept_op)
2177 printf("%soperands[%d] = x%d;\n", indent, test->u.opno, depth);
2180 if (test->next)
2182 test = test->next;
2183 gcc_assert (test->type == DT_accept_insn);
2188 gcc_assert (!test->next);
2190 if (test->type == DT_accept_insn)
2195 if (test->u.insn.num_clobbers_to_add != 0)
2197 indent, test->u.insn.num_clobbers_to_add);
2199 test->u.insn.code_number,
2200 get_insn_name (test->u.insn.code_number));
2205 indent, test->u.insn.code_number);
2220 indent, test->u.insn.code_number);
2239 /* Return 1 if the test is always true and has no fallthru path. Return -1
2240 if the test does have a fallthru path, but requires that the condition be
2241 terminated. Otherwise return 0 for a normal test. */
2275 struct decision_test *test, *last_test;
2280 for (test = p->tests; test; test = test->next)
2282 if (test->type == DT_code
2283 && test->u.code == CONST_INT
2284 && test->next
2285 && test->next->type == DT_elt_zero_wide_safe
2286 && -MAX_SAVED_CONST_INT <= test->next->u.intval
2287 && test->next->u.intval <= MAX_SAVED_CONST_INT)
2289 test->type = DT_const_int;
2290 test->u.intval = test->next->u.intval;
2291 test->next = test->next->next;
2295 last_test = test = p->tests;
2296 uncond = is_unconditional (test, subroutine_type);
2300 write_cond (test, depth, subroutine_type);
2302 while ((test = test->next) != NULL)
2304 last_test = test;
2305 if (is_unconditional (test, subroutine_type))
2309 write_cond (test, depth, subroutine_type);
2377 Call it, test the result, and branch accordingly. */
2554 struct decision_test *test, **place;
2558 /* We should never see an insn whose C test is false at compile time. */
2601 /* Find the end of the test chain on the last node. */
2602 for (test = last->tests; test->next; test = test->next)
2604 place = &test->next;
2606 /* Skip the C test if it's known to be true at compile time. */
2609 /* Need a new node if we have another test to add. */
2610 if (test->type == DT_accept_op)
2615 test = new_decision_test (DT_c_test, &place);
2616 test->u.c_test = c_test;
2619 test = new_decision_test (DT_accept_insn, &place);
2620 test->u.insn.code_number = next_insn_code;
2621 test->u.insn.lineno = pattern_lineno;
2622 test->u.insn.num_clobbers_to_add = 0;
2667 /* Find the end of the test chain on the last node. */
2668 for (test = last->tests; test->next; test = test->next)
2671 /* We definitely have a new test to add -- create a new
2673 place = &test->next;
2674 if (test->type == DT_accept_op)
2680 /* Skip the C test if it's known to be true at compile
2684 test = new_decision_test (DT_c_test, &place);
2685 test->u.c_test = c_test;
2688 test = new_decision_test (DT_accept_insn, &place);
2689 test->u.insn.code_number = next_insn_code;
2690 test->u.insn.lineno = pattern_lineno;
2691 test->u.insn.num_clobbers_to_add = XVECLEN (x, 0) - i;
2812 debug_decision_2 (struct decision_test *test)
2814 switch (test->type)
2817 fprintf (stderr, "num_insns=%d", test->u.num_insns);
2820 fprintf (stderr, "mode=%s", GET_MODE_NAME (test->u.mode));
2823 fprintf (stderr, "code=%s", GET_RTX_NAME (test->u.code));
2826 fprintf (stderr, "veclen=%d", test->u.veclen);
2829 fprintf (stderr, "elt0_i=%d", (int) test->u.intval);
2832 fprintf (stderr, "elt1_i=%d", (int) test->u.intval);
2835 fprintf (stderr, "elt0_w=" HOST_WIDE_INT_PRINT_DEC, test->u.intval);
2838 fprintf (stderr, "elt0_ws=" HOST_WIDE_INT_PRINT_DEC, test->u.intval);
2841 fprintf (stderr, "veclen>=%d", test->u.veclen);
2844 fprintf (stderr, "dup=%d", test->u.dup);
2848 test->u.pred.name, GET_MODE_NAME(test->u.pred.mode));
2853 strncpy (sub, test->u.c_test, sizeof(sub));
2859 fprintf (stderr, "A_op=%d", test->u.opno);
2863 test->u.insn.code_number, test->u.insn.num_clobbers_to_add);
2875 struct decision_test *test;
2889 test = d->tests;
2890 if (test)
2892 debug_decision_2 (test);
2893 while ((test = test->next) != NULL)
2896 debug_decision_2 (test);