-/**
- * Return register requirements for a ppc node.
- * If the node returns a tuple (mode_T) then the proj's
- * will be asked for this information.
- */
-static const arch_register_req_t *ppc32_get_irn_reg_req(const ir_node *irn,
- int pos)
-{
- long node_pos = pos == -1 ? 0 : pos;
- ir_mode *mode = get_irn_mode(irn);
- FIRM_DBG_REGISTER(firm_dbg_module_t *mod, DEBUG_MODULE);
-
- if (is_Block(irn) || mode == mode_X || mode == mode_M) {
- DBG((mod, LEVEL_1, "ignoring block, mode_X or mode_M node %+F\n", irn));
- return arch_no_register_req;
- }
-
- if (mode == mode_T && pos < 0) {
- DBG((mod, LEVEL_1, "ignoring request for OUT requirements at %+F", irn));
- return arch_no_register_req;
- }
-
- DBG((mod, LEVEL_1, "get requirements at pos %d for %+F ... ", pos, irn));
-
- if (is_Proj(irn)) {
- /* in case of a proj, we need to get the correct OUT slot */
- /* of the node corresponding to the proj number */
- if (pos == -1) {
- node_pos = ppc32_translate_proj_pos(irn);
- } else {
- node_pos = pos;
- }
-
- irn = skip_Proj_const(irn);
-
- DB((mod, LEVEL_1, "skipping Proj, going to %+F at pos %d ... ", irn, node_pos));
- }
-
- /* get requirements for our own nodes */
- if (is_ppc32_irn(irn)) {
- const arch_register_req_t *req;
- if (pos >= 0) {
- req = get_ppc32_in_req(irn, pos);
- } else {
- req = get_ppc32_out_req(irn, node_pos);
- }
-
- DB((mod, LEVEL_1, "returning reqs for %+F at pos %d\n", irn, pos));
- return req;
- }
-
- /* unknowns should be transformed by now */
- assert(!is_Unknown(irn));
-
- DB((mod, LEVEL_1, "returning NULL for %+F (node not supported)\n", irn));
- return arch_no_register_req;
-}
-
-static void ppc32_set_irn_reg(ir_node *irn, const arch_register_t *reg)
-{
- int pos = 0;
-
- if (is_Proj(irn)) {
-
- if (get_irn_mode(irn) == mode_X) {
- return;
- }
-
- pos = ppc32_translate_proj_pos(irn);
- irn = skip_Proj(irn);
- }
-
- if (is_ppc32_irn(irn)) {
- const arch_register_t **slots;
-
- slots = get_ppc32_slots(irn);
- slots[pos] = reg;
- }
- else {
- /* here we set the registers for the Phi nodes */
- ppc32_set_firm_reg(irn, reg, cur_reg_set);
- }
-}
-
-static const arch_register_t *ppc32_get_irn_reg(const ir_node *irn)
-{
- int pos = 0;
- const arch_register_t *reg = NULL;
-
- if (is_Proj(irn)) {
-
- if (get_irn_mode(irn) == mode_X) {
- return NULL;
- }
-
- pos = ppc32_translate_proj_pos(irn);
- irn = skip_Proj_const(irn);
- }
-
- if (is_ppc32_irn(irn)) {
- const arch_register_t **slots;
- slots = get_ppc32_slots(irn);
- reg = slots[pos];
- }
- else {
- reg = ppc32_get_firm_reg(irn, cur_reg_set);
- }
-
- return reg;
-}
-