Mesa (master): nvfx: use 64-bit bitmasks for temps

Luca Barbieri lb at kemper.freedesktop.org
Sun Aug 22 22:17:10 UTC 2010


Module: Mesa
Branch: master
Commit: d21be6ee2cae2daeb83583a5d3798f5104c00d73
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=d21be6ee2cae2daeb83583a5d3798f5104c00d73

Author: Luca Barbieri <luca at luca-barbieri.com>
Date:   Sun Aug 22 21:41:49 2010 +0200

nvfx: use 64-bit bitmasks for temps

---

 src/gallium/drivers/nvfx/nvfx_fragprog.c |   16 ++++++++--------
 1 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/src/gallium/drivers/nvfx/nvfx_fragprog.c b/src/gallium/drivers/nvfx/nvfx_fragprog.c
index c4394b2..47df71f 100644
--- a/src/gallium/drivers/nvfx/nvfx_fragprog.c
+++ b/src/gallium/drivers/nvfx/nvfx_fragprog.c
@@ -21,8 +21,8 @@ struct nvfx_fpc {
 	struct nvfx_pipe_fragment_program* pfp;
 	struct nvfx_fragment_program *fp;
 
-	unsigned r_temps;
-	unsigned r_temps_discard;
+	unsigned long long r_temps;
+	unsigned long long r_temps_discard;
 	struct nvfx_reg r_result[PIPE_MAX_SHADER_OUTPUTS];
 	struct nvfx_reg *r_temp;
 
@@ -50,7 +50,7 @@ struct nvfx_fpc {
 static INLINE struct nvfx_reg
 temp(struct nvfx_fpc *fpc)
 {
-	int idx = ffs(~fpc->r_temps) - 1;
+	int idx = ffsll(~fpc->r_temps) - 1;
 
 	if (idx < 0) {
 		NOUVEAU_ERR("out of temps!!\n");
@@ -58,8 +58,8 @@ temp(struct nvfx_fpc *fpc)
 		return nvfx_reg(NVFXSR_TEMP, 0);
 	}
 
-	fpc->r_temps |= (1 << idx);
-	fpc->r_temps_discard |= (1 << idx);
+	fpc->r_temps |= (1ULL << idx);
+	fpc->r_temps_discard |= (1ULL << idx);
 	return nvfx_reg(NVFXSR_TEMP, idx);
 }
 
@@ -67,7 +67,7 @@ static INLINE void
 release_temps(struct nvfx_fpc *fpc)
 {
 	fpc->r_temps &= ~fpc->r_temps_discard;
-	fpc->r_temps_discard = 0;
+	fpc->r_temps_discard = 0ULL;
 }
 
 static INLINE struct nvfx_reg
@@ -911,7 +911,7 @@ nvfx_fragprog_parse_decl_output(struct nvfx_context* nvfx, struct nvfx_fpc *fpc,
 	}
 
 	fpc->r_result[idx] = nvfx_reg(NVFXSR_OUTPUT, hw);
-	fpc->r_temps |= (1 << hw);
+	fpc->r_temps |= (1ULL << hw);
 	return TRUE;
 }
 
@@ -987,7 +987,7 @@ nvfx_fragprog_prepare(struct nvfx_context* nvfx, struct nvfx_fpc *fpc)
 		fpc->r_temp = CALLOC(high_temp, sizeof(struct nvfx_reg));
 		for (i = 0; i < high_temp; i++)
 			fpc->r_temp[i] = temp(fpc);
-		fpc->r_temps_discard = 0;
+		fpc->r_temps_discard = 0ULL;
 	}
 
 	return TRUE;




More information about the mesa-commit mailing list