Re: Connect The Dots: iPhone Graphics, OS X, LLVM, ARM, and Ruby?



"Daniel Amelang" <daniel amelang gmail com> writes:

> I haven't spent the time to actually analyze the output. I'm just
> curious: did you? How did you come to this conclusion? (that the
> vector code generated is good)

Well, 'analyze' is probably too strong a word, but the SSE code I got
it to generate for a simplified version of a render operation
completely avoided memory spills, and didn't do anything crazy like
deciding to swap the contents of two MMX registers in the middle of an
inner loop. I have seen gcc do both.

So my conclusion is more that the code is better than what we can get
with the GCC intrinsics (which is not terrible in the first place).

> > - It is written in C++ with STL, which among other things means the
> >   binaries of the compiler itself are huge. As an example, a simple
> >   Hello World jit compiler was over 3MB of text, which included 470
> >   copies of some copy_backwards_iterator() function. This may
> >   obviously be a problem for embedded systems, but even on desktop
> >   systems such a huge binary is going to use a lot of CPU cache.
> 
> Or you just don't ship the compiler. So, if we throw out the dynamic
> code generation idea, and just try to generate at build-time all the
> specialized Render code, we wouldn't need it, right? In this way we
> would be using LLVM for automatically optimizing the SIMD/shader code
> (beyond what gcc can do with C+intrinsics), and perhaps more
> importantly, using LLVM to automatically generate specialized code for
> each operation + extend mode + format + etc. Currently, one has to
> manually write a lot of code (for each platform) to get the same
> coverage.

But then you have to answer questions like:

        - Which operations do you target? A possible answer is
          "anything that anyone will ever run", but that's a lot of
          operations. A non-answer is "any combination that render
          supports", which is an astronomical number of operations.

        - Do you target MMX, SSE, SSE2, SSE3 or 3dnow? All of them?
          For all of the "anything that anyone will ever run"
          operations? Do you also generate and ship all this code for
          every shader core in existance?


Soren



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]