r300/compiler: Rewrite register allocator
[mesa.git] / src / mesa / drivers / dri / r300 / compiler / radeon_program_pair.h
index 01cdb154240f14cd96669ef11678fc673dbd6cf5..a957ea9f7a0b81b34577aaccc20928a2bb06a8c0 100644 (file)
@@ -63,7 +63,7 @@ struct rc_pair_instruction_source {
 
 struct rc_pair_instruction_arg {
        unsigned int Source:2;
-       unsigned int Swizzle:9;
+       unsigned int Swizzle:12;
        unsigned int Abs:1;
        unsigned int Negate:1;
 };
@@ -71,7 +71,7 @@ struct rc_pair_instruction_arg {
 struct rc_pair_sub_instruction {
        unsigned int Opcode:8;
        unsigned int DestIndex:RC_REGISTER_INDEX_BITS;
-       unsigned int WriteMask:3;
+       unsigned int WriteMask:4;
        unsigned int Target:2;
        unsigned int OutputWriteMask:3;
        unsigned int DepthWriteMask:1;
@@ -93,12 +93,6 @@ struct rc_pair_instruction {
 typedef void (*rc_pair_foreach_src_fn)
                        (void *, struct rc_pair_instruction_source *);
 
-typedef enum {
-       RC_PAIR_SOURCE_NONE = 0,
-       RC_PAIR_SOURCE_RGB,
-       RC_PAIR_SOURCE_ALPHA
-} rc_pair_source_type;
-
 /**
  * General helper functions for dealing with the paired instruction format.
  */
@@ -117,10 +111,13 @@ void rc_pair_foreach_source_that_rgb_reads(
        void * data,
        rc_pair_foreach_src_fn cb);
 
-rc_pair_source_type rc_source_type_that_arg_reads(
-       unsigned int source,
-       unsigned int swizzle,
-       unsigned int channels);
+struct rc_pair_instruction_source * rc_pair_get_src(
+       struct rc_pair_instruction * pair_inst,
+       struct rc_pair_instruction_arg * arg);
+
+int rc_pair_get_src_index(
+       struct rc_pair_instruction * pair_inst,
+       struct rc_pair_instruction_source * src);
 /*@}*/
 
 
@@ -134,6 +131,7 @@ void rc_pair_translate(struct radeon_compiler *cc, void *user);
 void rc_pair_schedule(struct radeon_compiler *cc, void *user);
 void rc_pair_regalloc(struct radeon_compiler *cc, void *user);
 void rc_pair_regalloc_inputs_only(struct radeon_compiler *cc, void *user);
+void rc_pair_remove_dead_sources(struct radeon_compiler *c, void *user);
 /*@}*/
 
 #endif /* __RADEON_PROGRAM_PAIR_H_ */