diff options
author | Brian Paul <[email protected]> | 2012-01-12 07:30:48 -0700 |
---|---|---|
committer | Brian Paul <[email protected]> | 2012-01-12 07:30:58 -0700 |
commit | 9a548c27aa704236cc1d8a5d4ebf68cea9c5c99c (patch) | |
tree | cdb18d78dd7dc3724d183361618212f274acb675 /src/mesa/drivers/dri/i965 | |
parent | 87118d84ff11c040f677c7506afb813def1b9ff9 (diff) |
mesa: remove _mesa_ffs(), implement ffs() for non-GNU platforms
Call ffs() and ffsll() everywhere. Define our own ffs(), ffsll()
functions when the platform doesn't have them.
v2: remove #ifdef _WIN32, __IBMC__, __IBMCPP_ tests inside ffs()
implementation. The #else clause was recursive.
Reviewed-by: Kenneth Graunke <[email protected]>
Tested-by: Alexander von Gluck <[email protected]>
Diffstat (limited to 'src/mesa/drivers/dri/i965')
-rw-r--r-- | src/mesa/drivers/dri/i965/brw_wm_emit.c | 12 | ||||
-rw-r--r-- | src/mesa/drivers/dri/i965/brw_wm_fp.c | 4 |
2 files changed, 8 insertions, 8 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_wm_emit.c b/src/mesa/drivers/dri/i965/brw_wm_emit.c index 270e32142de..2647a386f4f 100644 --- a/src/mesa/drivers/dri/i965/brw_wm_emit.c +++ b/src/mesa/drivers/dri/i965/brw_wm_emit.c @@ -766,7 +766,7 @@ void emit_dp2(struct brw_compile *p, const struct brw_reg *arg0, const struct brw_reg *arg1) { - int dst_chan = _mesa_ffs(mask & WRITEMASK_XYZW) - 1; + int dst_chan = ffs(mask & WRITEMASK_XYZW) - 1; if (!(mask & WRITEMASK_XYZW)) return; /* Do not emit dead code */ @@ -787,7 +787,7 @@ void emit_dp3(struct brw_compile *p, const struct brw_reg *arg0, const struct brw_reg *arg1) { - int dst_chan = _mesa_ffs(mask & WRITEMASK_XYZW) - 1; + int dst_chan = ffs(mask & WRITEMASK_XYZW) - 1; if (!(mask & WRITEMASK_XYZW)) return; /* Do not emit dead code */ @@ -809,7 +809,7 @@ void emit_dp4(struct brw_compile *p, const struct brw_reg *arg0, const struct brw_reg *arg1) { - int dst_chan = _mesa_ffs(mask & WRITEMASK_XYZW) - 1; + int dst_chan = ffs(mask & WRITEMASK_XYZW) - 1; if (!(mask & WRITEMASK_XYZW)) return; /* Do not emit dead code */ @@ -832,7 +832,7 @@ void emit_dph(struct brw_compile *p, const struct brw_reg *arg0, const struct brw_reg *arg1) { - const int dst_chan = _mesa_ffs(mask & WRITEMASK_XYZW) - 1; + const int dst_chan = ffs(mask & WRITEMASK_XYZW) - 1; if (!(mask & WRITEMASK_XYZW)) return; /* Do not emit dead code */ @@ -882,7 +882,7 @@ void emit_math1(struct brw_wm_compile *c, { struct brw_compile *p = &c->func; struct intel_context *intel = &p->brw->intel; - int dst_chan = _mesa_ffs(mask & WRITEMASK_XYZW) - 1; + int dst_chan = ffs(mask & WRITEMASK_XYZW) - 1; GLuint saturate = ((mask & SATURATE) ? BRW_MATH_SATURATE_SATURATE : BRW_MATH_SATURATE_NONE); @@ -945,7 +945,7 @@ void emit_math2(struct brw_wm_compile *c, { struct brw_compile *p = &c->func; struct intel_context *intel = &p->brw->intel; - int dst_chan = _mesa_ffs(mask & WRITEMASK_XYZW) - 1; + int dst_chan = ffs(mask & WRITEMASK_XYZW) - 1; if (!(mask & WRITEMASK_XYZW)) return; /* Do not emit dead code */ diff --git a/src/mesa/drivers/dri/i965/brw_wm_fp.c b/src/mesa/drivers/dri/i965/brw_wm_fp.c index 1358e749558..b40c501257b 100644 --- a/src/mesa/drivers/dri/i965/brw_wm_fp.c +++ b/src/mesa/drivers/dri/i965/brw_wm_fp.c @@ -159,7 +159,7 @@ static struct prog_dst_register dst_undef( void ) static struct prog_dst_register get_temp( struct brw_wm_compile *c ) { - int bit = _mesa_ffs( ~c->fp_temp ); + int bit = ffs( ~c->fp_temp ); if (!bit) { printf("%s: out of temporaries\n", __FILE__); @@ -260,7 +260,7 @@ static struct prog_instruction *emit_scalar_insn(struct brw_wm_compile *c, if (inst0->DstReg.WriteMask == 0) return NULL; - dst_chan = _mesa_ffs(inst0->DstReg.WriteMask) - 1; + dst_chan = ffs(inst0->DstReg.WriteMask) - 1; inst = get_fp_inst(c); *inst = *inst0; inst->DstReg.WriteMask = 1 << dst_chan; |