- const ir_asm_constraint *constraint = &in_constraints[i];
- unsigned pos = constraint->pos;
- ir_node *pred = get_irn_n(node, i);
- ir_node *transformed;
-
- assert(pos < reg_map_size);
- register_map[pos].use_input = 1;
- register_map[pos].valid = 1;
- register_map[pos].memory = is_memory_op(constraint);
+ ir_node *pred = get_irn_n(node, i);
+ const ir_asm_constraint *constraint = &in_constraints[i];
+ ident *constr_id = constraint->constraint;
+ const char *c = get_id_str(constr_id);
+ unsigned pos = constraint->pos;
+ bool is_memory_op = false;
+ ir_node *input = NULL;
+ constraint_t parsed_constraint;
+ const arch_register_req_t *req;
+
+ parse_asm_constraints(&parsed_constraint, c, false);
+ req = make_register_req(&parsed_constraint, n_out_constraints,
+ out_reg_reqs, i);
+ in_reg_reqs[i] = req;
+
+ if (parsed_constraint.immediate_type != '\0') {
+ char imm_type = parsed_constraint.immediate_type;
+ input = try_create_Immediate(pred, imm_type);
+ }
+
+ if (input == NULL) {
+ ir_node *pred = get_irn_n(node, i);
+ input = be_transform_node(pred);
+
+ if (parsed_constraint.cls == NULL
+ && parsed_constraint.same_as < 0) {
+ is_memory_op = true;
+ } else if(parsed_constraint.memory_possible) {
+ /* TODO: match Load or Load/Store if memory possible is set */
+ }
+ }
+ in[i] = input;
+
+ register_map[pos].use_input = true;
+ register_map[pos].valid = true;
+ register_map[pos].memory = is_memory_op;