Small simplification in ia32 ASM emitter.
[libfirm] / ir / be / ia32 / ia32_common_transform.c
index 5245bb9..7e825bc 100644 (file)
@@ -727,6 +727,31 @@ ir_node *gen_CopyB(ir_node *node) {
        return res;
 }
 
+ir_node *gen_Proj_tls(ir_node *node) {
+       ir_node  *block = NULL;
+       ir_graph *irg   = current_ir_graph;
+       dbg_info *dbgi  = NULL;
+       ir_node  *res   = NULL;
+
+       switch (be_transformer) {
+               case TRANSFORMER_DEFAULT:
+                       block = be_transform_node(get_nodes_block(node));
+                       break;
+
+#ifdef FIRM_GRGEN_BE
+               case TRANSFORMER_PBQP:
+                       block = get_nodes_block(node);
+                       break;
+#endif
+
+               default: panic("invalid transformer");
+       }
+
+       res   = new_rd_ia32_LdTls(dbgi, irg, block, mode_Iu);
+
+       return res;
+}
+
 ir_node *gen_Unknown(ir_node *node)
 {
        ir_mode *mode = get_irn_mode(node);
@@ -770,14 +795,12 @@ const arch_register_req_t *make_register_req(const constraint_t *constraint,
                if (same_as >= n_outs)
                        panic("invalid output number in same_as constraint");
 
-               other_constr         = out_reqs[same_as];
+               other_constr     = out_reqs[same_as];
 
-               req                  = obstack_alloc(obst, sizeof(req[0]));
-               req->cls             = other_constr->cls;
-               req->type            = arch_register_req_type_should_be_same;
-               req->limited         = NULL;
-               req->other_same      = 1U << pos;
-               req->other_different = 0;
+               req              = obstack_alloc(obst, sizeof(req[0]));
+               *req             = *other_constr;
+               req->type       |= arch_register_req_type_should_be_same;
+               req->other_same  = 1U << pos;
 
                /* switch constraints. This is because in firm we have same_as
                 * constraints on the output constraints while in the gcc asm syntax