Rob Clark, the principal author of the Freedreno Gallium3D driver and the one behind this new A3xx compiler, has written a blog post detailing the graphics compiler improvements.
Those interested in the low-level details of the new Freedreno A3xx compiler can read his post in full. Some highlights include:
- In terms of the previous A3xx compiler design: "The original a3xx compiler was more of a simple TGSI translator. It translated each TGSI opcode into a simple sequence of one or more native instructions...The simple TGSI translator approach works fine with simple shader ISA's. It worked ok for a2xx, other than slightly suboptimal register usage. But the problem is that a3xx (and a4xx) is not such a simple instruction set architecture. In particular, the instruction scheduling required that the compiler be aware of the shader instruction pipeline(s)."
- With the new compiler design: " First thing I wanted to do before adding a lot more complexity is to rip out a bunch of code. With that in mind I implemented a generic TGSI lowering pass, to replace about a dozen opcodes with sequences of equivalent simpler instructions. This probably should be made configurable and moved to util, I think most of the lowerings would be useful to other gallium drivers...The next step was to turn ir3 (the a3xx IR), which originates from the fdre-a3xx shader assembler into something more useful."
- The OpenGL ES 2.0 es2gears benchmark ran around 435 FPS for the original Freedreno shader compiler but is now scoring about 539 FPS with the new compiler.
- Games like SuperTuxKart are now rendering correctly where they would not render properly with the old compiler.
Overall, Freedreno is in the best shape among the current open-source, reverse-engineered ARM Linux graphics drivers.