diff options
author | Ian Romanick <[email protected]> | 2008-02-20 14:45:08 -0800 |
---|---|---|
committer | Ian Romanick <[email protected]> | 2008-02-21 10:43:45 -0800 |
commit | 2d1f086c12b6d64f5c3fb80474f26775aeb71370 (patch) | |
tree | b3b95ed628b4e61ababa866f6af310bdbf6b75fb /src/gallium/drivers/cell/spu/spu_exec.c | |
parent | 7c74037852a484a8a50e8bc540b954a624de4d33 (diff) |
Cell: Fix off-by-one error in spu_dcache_fetch_unaligned
An off-by-one error caused an extra qword to be fetched under certain
alignment / size combinations.
Diffstat (limited to 'src/gallium/drivers/cell/spu/spu_exec.c')
-rw-r--r-- | src/gallium/drivers/cell/spu/spu_exec.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/gallium/drivers/cell/spu/spu_exec.c b/src/gallium/drivers/cell/spu/spu_exec.c index 94ac6a28850..cf81bee8fde 100644 --- a/src/gallium/drivers/cell/spu/spu_exec.c +++ b/src/gallium/drivers/cell/spu/spu_exec.c @@ -73,6 +73,7 @@ #include "spu_main.h" #include "spu_vertex_shader.h" #include "spu_dcache.h" +#include "cell/common.h" #define TILE_TOP_LEFT 0 #define TILE_TOP_RIGHT 1 @@ -1900,8 +1901,7 @@ spu_exec_machine_run( struct spu_exec_machine *mach ) for (i = 0; i < mach->NumDeclarations; i++) { union { struct tgsi_full_declaration decl; - qword buffer[2 * ((sizeof(struct tgsi_full_declaration) + 31) - / 32)]; + qword buffer[ROUNDUP16(sizeof(struct tgsi_full_declaration)) / 16]; } d ALIGN16_ATTRIB; unsigned ea = (unsigned) (mach->Declarations + pc); @@ -1915,8 +1915,7 @@ spu_exec_machine_run( struct spu_exec_machine *mach ) while (pc != -1) { union { struct tgsi_full_instruction inst; - qword buffer[2 * ((sizeof(struct tgsi_full_instruction) + 31) - / 32)]; + qword buffer[ROUNDUP16(sizeof(struct tgsi_full_instruction)) / 16]; } i ALIGN16_ATTRIB; unsigned ea = (unsigned) (mach->Instructions + pc); |