RE: [Algorithms] non-branching zbuf code tricks?
Brought to you by:
vexxed72
|
From: <Chr...@Pl...> - 2001-01-09 18:52:44
|
Tom Forsyth wrote: >> >zbuf[x] = z < zbuf[x] ? z : zbuf[x]; >> [...] >Indeed - this is just a branch hiding in an expression. On my platform gcc compiles this to: lw v0, 0(a0) slt v1,a0,v0 movn v0,a1,v1 sw v0,0(a0) which (for once, when it comes to gcc) is optimal code. Clearly not a branch in sight. Can't a PC do something similar? Christer Ericson SCEA, Santa Monica |