- if (arch_register_req_is(&(irn_req->req), should_be_same) ||
- arch_register_req_is(&(irn_req->req), should_be_different)) {
- assert(irn_req->pos >= 0 && "should be same/different constraint for in -> out NYI");
- req->other = get_irn_n(irn, irn_req->pos);
- }
- }
- /* get requirements for FIRM nodes */
- else {
- /* treat Phi like Const with default requirements */
- if (is_Phi(irn)) {
- DB((mod, LEVEL_1, "returning standard reqs for %+F\n", irn));
-
- if (mode_is_float(mode)) {
- memcpy(req, &(TEMPLATE_default_req_TEMPLATE_floating_point.req), sizeof(*req));
- }
- else if (mode_is_int(mode) || mode_is_reference(mode)) {
- memcpy(req, &(TEMPLATE_default_req_TEMPLATE_general_purpose.req), sizeof(*req));
- }
- else if (mode == mode_T || mode == mode_M) {
- DBG((mod, LEVEL_1, "ignoring Phi node %+F\n", irn));
- return NULL;
- }
- else {
- assert(0 && "unsupported Phi-Mode");
- }
- }
- else if ((get_irn_op(irn) == op_Return) && pos > 0) {
- /* pos == 0 is Memory -> no requirements */
- DB((mod, LEVEL_1, "giving return (%+F) requirements\n", irn));
-
- if (pos == 1) {
- /* pos == 1 is Stackpointer */
- memcpy(req, &(TEMPLATE_default_req_TEMPLATE_general_purpose_r6.req), sizeof(*req));
- }
- else {
- if (mode_is_float(get_irn_mode(get_Return_res(irn, pos)))) {
- /* fp result */
- memcpy(req, &(TEMPLATE_default_req_TEMPLATE_floating_point_f0.req), sizeof(*req));
- }
- else {
- /* integer result, 64bit results are returned as two 32bit values */
- if (pos == 2) {
- memcpy(req, &(TEMPLATE_default_req_TEMPLATE_general_purpose_r0.req), sizeof(*req));
- }
- else {
- memcpy(req, &(TEMPLATE_default_req_TEMPLATE_general_purpose_r1.req), sizeof(*req));
- }
- }
- }
- }
- else {
- DB((mod, LEVEL_1, "returning NULL for %+F (node not supported)\n", irn));
- req = NULL;
- }