diff options
author | Ian Romanick <idr@us.ibm.com> | 2008-03-17 15:37:09 -0700 |
---|---|---|
committer | Ian Romanick <idr@us.ibm.com> | 2008-03-17 15:47:45 -0700 |
commit | 0c715de39fa8337a2753dacd77ed280000416c1a (patch) | |
tree | a7b77f217cca2cdca740ee46b3cf7d4c045e423e /src | |
parent | 5456f4f210defe0c4ba17a9314ba0b61334e7976 (diff) |
cell: Fix simple register allocator
THere are 64-bits in a uint64_t, not 128. Duh.
Diffstat (limited to 'src')
-rw-r--r-- | src/gallium/auxiliary/rtasm/rtasm_ppc_spe.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/gallium/auxiliary/rtasm/rtasm_ppc_spe.c b/src/gallium/auxiliary/rtasm/rtasm_ppc_spe.c index a996218ce7..842d713f84 100644 --- a/src/gallium/auxiliary/rtasm/rtasm_ppc_spe.c +++ b/src/gallium/auxiliary/rtasm/rtasm_ppc_spe.c @@ -326,8 +326,8 @@ int spe_allocate_available_register(struct spe_function *p) { unsigned i; for (i = 0; i < 128; i++) { - const uint64_t mask = (1ULL << (i % 128)); - const unsigned idx = i / 128; + const uint64_t mask = (1ULL << (i % 64)); + const unsigned idx = i / 64; if ((p->regs[idx] & mask) != 0) { p->regs[idx] &= ~mask; @@ -341,8 +341,8 @@ int spe_allocate_available_register(struct spe_function *p) int spe_allocate_register(struct spe_function *p, int reg) { - const unsigned idx = reg / 128; - const unsigned bit = reg % 128; + const unsigned idx = reg / 64; + const unsigned bit = reg % 64; assert((p->regs[idx] & (1ULL << bit)) != 0); @@ -353,8 +353,8 @@ int spe_allocate_register(struct spe_function *p, int reg) void spe_release_register(struct spe_function *p, int reg) { - const unsigned idx = reg / 128; - const unsigned bit = reg % 128; + const unsigned idx = reg / 64; + const unsigned bit = reg % 64; assert((p->regs[idx] & (1ULL << bit)) == 0); |