diff options
author | Nicolai Hähnle <nhaehnle@gmail.com> | 2009-10-03 21:28:59 +0200 |
---|---|---|
committer | Nicolai Hähnle <nhaehnle@gmail.com> | 2009-10-03 23:37:16 +0200 |
commit | b7cf887ca74561469c144f1d12227e1bcf277e7e (patch) | |
tree | c956777f799712573febf464310a1ec0f75f1991 /src/mesa/drivers/dri/r300/compiler/radeon_program.c | |
parent | 6d25b9125ec1e66e0e255b0ee20fe18dfe1076fa (diff) |
r300/compiler: Introduce control flow instructions and refactor dataflow
Note that control flow instruction support isn't actually fully functional yet.
Signed-off-by: Nicolai Hähnle <nhaehnle@gmail.com>
Diffstat (limited to 'src/mesa/drivers/dri/r300/compiler/radeon_program.c')
-rw-r--r-- | src/mesa/drivers/dri/r300/compiler/radeon_program.c | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/src/mesa/drivers/dri/r300/compiler/radeon_program.c b/src/mesa/drivers/dri/r300/compiler/radeon_program.c index b97c48084b..a1ee7c0cab 100644 --- a/src/mesa/drivers/dri/r300/compiler/radeon_program.c +++ b/src/mesa/drivers/dri/r300/compiler/radeon_program.c @@ -154,7 +154,24 @@ struct rc_instruction *rc_insert_new_instruction(struct radeon_compiler * c, str void rc_remove_instruction(struct rc_instruction * inst) { - rc_dataflow_remove_instruction(inst); inst->Prev->Next = inst->Next; inst->Next->Prev = inst->Prev; } + +/** + * Return the number of instructions in the program. + */ +unsigned int rc_recompute_ips(struct radeon_compiler * c) +{ + unsigned int ip = 0; + + for(struct rc_instruction * inst = c->Program.Instructions.Next; + inst != &c->Program.Instructions; + inst = inst->Next) { + inst->IP = ip++; + } + + c->Program.Instructions.IP = 0xcafedead; + + return ip; +} |