[radeonhd] Re: Updated R5xx 3D Programming Guide
glisse at freedesktop.org
Tue Apr 8 16:24:40 PDT 2008
On Wed, 09 Apr 2008 00:36:28 +0200
Syren Baran <sbaran at gmx.de> wrote:
> Am Dienstag, den 08.04.2008, 19:39 +0200 schrieb Jerome Glisse:
> > GPU are not a CPU, programming them is far more complexe than programming
> > CPU, you have to handle things that CPU do for you. For instance you have
> > setup how data are routed to GPU.
> True, thats still the main problem i see.
> > Also GPU are not intended to run usual
> > program, ie program with if, swith, jump, and others alike instructions.
> > GPU could handle such instructions but your often limited in the depth you
> > can have (for instance no more than 16 nested for, if statement).
> Well, a normal CPU doesnt have any conditional statements like "if,
> switch, while etc" either, just the jz, jnz etc on assembly level.
> The conditional jumps described in the R5xx guide arent all too
> different (Section 7.6 Flow control and 18.104.22.168 in special).
> I´m pretty sure this is the most tricky part, since ideally the
> conditional jumps should only occur when either all or no stream units
> want to jump, otherwise the gpu will mask a lot of units.
I think you miss my point, you can't have too much depth in loop or
procedure call on r5xx gpu. See section 7.6.2 or section 3.5 of ATI
> > This part need to be designed with GPU specificity
> > in mind. This why i don't think a compiler, at least in the sense you seems
> > to think about, is of any use with a GPU.
> Dont think so, otherwise nvidias CUDA would be useless as well.
> Being able to send a program to the GPU will be usefull for benchmarking
> as i already pointed out.
> Compiler might be a bit overdoing it for the time being. Assembling the
> opcodes into a binary seems like the obious first step. And then loading
> the program into GPU memory and starting it.
> Or, to be more specific,
> a normal cpu program creates a buffer and loads the GPU binary,
> then sends the gpu the instruction to load and execute the program.
> The GPU should be able to send some results into a buffer in main
That's an uneasy part, this need a lot of basic infrastructure, lot
of code for doing this.
I just want to be sure that you are aware of the limitation of GPU
hw, it should not be seen as CPU and so not be tackle like a CPU.
Compiler we are aiming for should be able to translate TGSI in
GPU opcode. I am yet not sure on win we could get from using llvm
too for producing the byte code.
Jerome Glisse <glisse at freedesktop.org>
More information about the xorg