summaryrefslogtreecommitdiff
path: root/src/mesa/drivers/dri/r300/compiler/radeon_program_print.c
diff options
context:
space:
mode:
authorNicolai Hähnle <nhaehnle@gmail.com>2009-10-04 11:13:09 +0200
committerNicolai Hähnle <nhaehnle@gmail.com>2009-10-04 11:13:13 +0200
commite6b137dcce58ca074458b184304573613917553f (patch)
tree9b0adc568998581fafdcfece12a342b40aaac7ba /src/mesa/drivers/dri/r300/compiler/radeon_program_print.c
parentb7cf887ca74561469c144f1d12227e1bcf277e7e (diff)
r300/compiler: Introduce aluresult register for branch operation support
Signed-off-by: Nicolai Hähnle <nhaehnle@gmail.com>
Diffstat (limited to 'src/mesa/drivers/dri/r300/compiler/radeon_program_print.c')
-rw-r--r--src/mesa/drivers/dri/r300/compiler/radeon_program_print.c38
1 files changed, 37 insertions, 1 deletions
diff --git a/src/mesa/drivers/dri/r300/compiler/radeon_program_print.c b/src/mesa/drivers/dri/r300/compiler/radeon_program_print.c
index 0485286451..6645d7cacb 100644
--- a/src/mesa/drivers/dri/r300/compiler/radeon_program_print.c
+++ b/src/mesa/drivers/dri/r300/compiler/radeon_program_print.c
@@ -38,10 +38,36 @@ static const char * textarget_to_string(rc_texture_target target)
}
}
+static void rc_print_comparefunc(FILE * f, const char * lhs, rc_compare_func func, const char * rhs)
+{
+ if (func == RC_COMPARE_FUNC_NEVER) {
+ fprintf(f, "false");
+ } else if (func == RC_COMPARE_FUNC_ALWAYS) {
+ fprintf(f, "true");
+ } else {
+ const char * op;
+ switch(func) {
+ case RC_COMPARE_FUNC_LESS: op = "<"; break;
+ case RC_COMPARE_FUNC_EQUAL: op = "=="; break;
+ case RC_COMPARE_FUNC_LEQUAL: op = "<="; break;
+ case RC_COMPARE_FUNC_GREATER: op = ">"; break;
+ case RC_COMPARE_FUNC_NOTEQUAL: op = "!="; break;
+ case RC_COMPARE_FUNC_GEQUAL: op = ">="; break;
+ default: op = "???"; break;
+ }
+ fprintf(f, "%s %s %s", lhs, op, rhs);
+ }
+}
+
static void rc_print_register(FILE * f, rc_register_file file, int index, unsigned int reladdr)
{
if (file == RC_FILE_NONE) {
fprintf(f, "none");
+ } else if (file == RC_FILE_SPECIAL) {
+ switch(index) {
+ case RC_SPECIAL_ALU_RESULT: fprintf(f, "aluresult"); break;
+ default: fprintf(f, "special[%i]", index); break;
+ }
} else {
const char * filename;
switch(file) {
@@ -151,7 +177,17 @@ static void rc_print_instruction(FILE * f, struct rc_instruction * inst)
inst->I.TexSrcUnit);
}
- fprintf(f, ";\n");
+ fprintf(f, ";");
+
+ if (inst->I.WriteALUResult) {
+ fprintf(f, " [aluresult = (");
+ rc_print_comparefunc(f,
+ (inst->I.WriteALUResult == RC_ALURESULT_X) ? "x" : "w",
+ inst->I.ALUResultCompare, "0");
+ fprintf(f, ")]");
+ }
+
+ fprintf(f, "\n");
}
/**