1 LLVMPIPE -- a fork of softpipe that employs LLVM for code generation.
9 - the whole fragment pipeline is code generated in a single function
15 - texture sampling (not all state/formats are supported)
17 - fragment shader TGSI translation
18 - same level of support as the TGSI SSE2 exec machine, with the exception
19 we don't fallback to TGSI interpretation when an unsupported opcode is
20 found, but just ignore it
22 - input interpolation also code generated
26 - blend (including logic ops)
27 - both in SoA and AoS layouts, but only the former used for now
30 - intermediates can be vectors of floats, ubytes, fixed point, etc, and of
32 - not all operations are implemented for these types yet though
34 Most mesa/progs/demos/* work.
36 To do (probably by this order):
38 - code generate stipple and stencil testing
40 - translate the remaining bits of texture sampling state
42 - translate TGSI control flow instructions, and all other remaining opcodes
44 - integrate with the draw module for VS code generation
46 - code generate the triangle setup and rasterization
54 - udis86, http://udis86.sourceforge.net/ . Use my repository, which decodes
55 opcodes not yet supported by upstream.
57 git clone git://people.freedesktop.org/~jrfonseca/udis86
59 ./configure --with-pic
63 - LLVM 2.5. On Debian based distributions do:
65 aptitude install llvm-dev
67 There is a typo in one of the llvm-dev 2.5 headers, that causes compilation
68 errors in the debug build:
70 --- /usr/include/llvm-c/Core.h.orig 2009-08-10 15:38:54.000000000 +0100
71 +++ /usr/include/llvm-c/Core.h 2009-08-10 15:38:25.000000000 +0100
74 inline T **unwrap(LLVMValueRef *Vals, unsigned Length) {
76 - for (LLVMValueRef *I = Vals, E = Vals + Length; I != E; ++I)
77 + for (LLVMValueRef *I = Vals, *E = Vals + Length; I != E; ++I)
80 return reinterpret_cast<T**>(Vals);
82 - A x86 or amd64 processor with support for sse2, sse3, and sse4.1 SIMD
83 instructions. This is necessary because we emit several SSE intrinsics for
84 convenience. See /proc/cpuinfo to know what your CPU supports.
92 To build everything invoke scons as:
94 scons debug=yes statetrackers=mesa drivers=llvmpipe winsys=xlib dri=false -k
96 Alternatively, you can build it with GNU make, if you prefer, by invoking it as
100 but the rest of these instructions assume that scons is used.
106 Building will create a drop-in alternative for libGL.so. To use it set the
107 environment variables:
109 export LD_LIBRARY_PATH=$PWD/build/linux-x86_64-debug/lib:$LD_LIBRARY_PATH
113 export LD_LIBRARY_PATH=$PWD/build/linux-x86-debug/lib:$LD_LIBRARY_PATH
115 For performance evaluation pass debug=no to scons, and use the corresponding
116 lib directory without the "-debug" suffix.
122 Building will also create several unit tests in
123 build/linux-???-debug/gallium/drivers/llvmpipe:
125 - lp_test_blend: blending
126 - lp_test_conv: SIMD vector conversion
127 - lp_test_format: pixel unpacking/packing
129 Some of this tests can output results and benchmarks to a tab-separated-file
130 for posterior analysis, e.g.:
132 build/linux-x86_64-debug/gallium/drivers/llvmpipe/lp_test_blend -o blend.tsv
138 - When looking to this code by the first time start in lp_state_fs.c, and
139 then skim through the lp_bld_* functions called in there, and the comments
140 at the top of the lp_bld_*.c functions.
142 - All lp_bld_*.[ch] are isolated from the rest of the driver, and could/may be
143 put in a stand-alone Gallium state -> LLVM IR translation module.
145 - We use LLVM-C bindings for now. They are not documented, but follow the C++
146 interfaces very closely, and appear to be complete enough for code
148 http://npcontemplation.blogspot.com/2008/06/secret-of-llvm-c-bindings.html
149 for a stand-alone example.