X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;f=docs%2Fllvmpipe.html;h=2efbbd4ca61843db0bdfc85ac03ea90fac657851;hb=158fb2ef20e97a898605f1cfdaac5300c7d5c784;hp=cf4512ffc45c4ae392911d3bcfbc59d3c6910484;hpb=fd64b397277c66e4cbb83222454d33b890648471;p=mesa.git diff --git a/docs/llvmpipe.html b/docs/llvmpipe.html index cf4512ffc45..2efbbd4ca61 100644 --- a/docs/llvmpipe.html +++ b/docs/llvmpipe.html @@ -7,6 +7,13 @@ +
+

The Mesa 3D Graphics Library

+
+ + +
+

Introduction

@@ -27,7 +34,7 @@ It's the fastest software rasterizer for Mesa.

  • An x86 or amd64 processor; 64-bit mode recommended.

    - Support for SSE2 is strongly encouraged. Support for SSSE3 and SSE4.1 will + Support for SSE2 is strongly encouraged. Support for SSE3 and SSE4.1 will yield the most efficient code. The fewer features the CPU has the more likely is that you run into underperforming, buggy, or incomplete code.

    @@ -36,11 +43,7 @@ It's the fastest software rasterizer for Mesa.

  • -

    LLVM: version 2.9 recommended; 2.6 or later required.

    -

    NOTE: LLVM 2.8 and earlier will not work on systems that support the - Intel AVX extensions (e.g. Sandybridge). LLVM's code generator will - fail when trying to emit AVX instructions. This was fixed in LLVM 2.9. -

    +

    LLVM: version 3.4 recommended; 3.3 or later required.

    For Linux, on a recent Debian based distribution do:

    @@ -55,15 +58,37 @@ It's the fastest software rasterizer for Mesa.

    - For Windows you will need to build LLVM from source with MSVC or MINGW - (either natively or through cross compilers) and CMake, and set the LLVM - environment variable to the directory you installed it to. + For Windows you will need to build LLVM from source with MSVC or MINGW + (either natively or through cross compilers) and CMake, and set the LLVM + environment variable to the directory you installed it to. LLVM will be statically linked, so when building on MSVC it needs to be built with a matching CRT as Mesa, and you'll need to pass - -DLLVM_USE_CRT_RELEASE=MTd for debug and checked builds, - -DLLVM_USE_CRT_RELEASE=MTd for profile and release builds. + -DLLVM_USE_CRT_xxx=yyy as described below. +

    + + + + + + + + + + + + + + + + + + + + +
    LLVM build-typeMesa build-type
    debug,checkedrelease,profile
    Debug-DLLVM_USE_CRT_DEBUG=MTd-DLLVM_USE_CRT_DEBUG=MT
    Release-DLLVM_USE_CRT_RELEASE=MTd-DLLVM_USE_CRT_RELEASE=MT
    +

    You can build only the x86 target by passing -DLLVM_TARGETS_TO_BUILD=X86 to cmake.

    @@ -94,13 +119,15 @@ but the rest of these instructions assume that scons is used. For Windows the procedure is similar except the target:
    -  scons build=debug libgl-gdi
    +  scons platform=windows build=debug libgl-gdi
     

    Using

    -On Linux, building will create a drop-in alternative for libGL.so into +

    Linux

    + +

    On Linux, building will create a drop-in alternative for libGL.so into

       build/foo/gallium/targets/libgl-xlib/libGL.so
    @@ -110,51 +137,81 @@ or
       lib/gallium/libGL.so
     
    -To use it set the LD_LIBRARY_PATH environment variable accordingly. +

    To use it set the LD_LIBRARY_PATH environment variable accordingly.

    + +

    For performance evaluation pass build=release to scons, and use the corresponding +lib directory without the "-debug" suffix.

    -For performance evaluation pass debug=no to scons, and use the corresponding -lib directory without the "-debug" suffix. -On Windows, building will create a drop-in alternative for opengl32.dll. To use -it put it in the same directory as the application. It can also be used by +

    Windows

    + +

    +On Windows, building will create +build/windows-x86-debug/gallium/targets/libgl-gdi/opengl32.dll +which is a drop-in alternative for system's opengl32.dll. To use +it put it in the same directory as your application. It can also be used by replacing the native ICD driver, but it's quite an advanced usage, so if you need to ask, don't even try it. +

    +

    +There is however an easy way to replace the OpenGL software renderer that comes +with Microsoft Windows 7 (or later) with llvmpipe (that is, on systems without +any OpenGL drivers): +

    -

    Profiling

    + -To profile llvmpipe you should pass the options +

    Profiling

    + +

    +To profile llvmpipe you should build as +

       scons build=profile <same-as-before>
     
    +

    This will ensure that frame pointers are used both in C and JIT functions, and that no tail call optimizations are done by gcc. +

    -To better profile JIT code you'll need to build LLVM with oprofile integration. - -
    -  ./configure \
    -      --prefix=$install_dir \
    -      --enable-optimized \
    -      --disable-profiling \
    -      --enable-targets=host-only \
    -      --with-oprofile
    -
    -  make -C "$build_dir"
    -  make -C "$build_dir" install
    -
    -  find "$install_dir/lib" -iname '*.a' -print0 | xargs -0 strip --strip-debug
    -
    +

    Linux perf integration

    -The you should define +

    +On Linux, it is possible to have symbol resolution of JIT code with Linux perf: +

    -  export LLVM=/path/to/llvm-2.6-profile
    +	perf record -g /my/application
    +	perf report
     
    -and rebuild. +

    +When run inside Linux perf, llvmpipe will create a /tmp/perf-XXXXX.map file with +symbol address table. It also dumps assembly code to /tmp/perf-XXXXX.map.asm, +which can be used by the bin/perf-annotate-jit.py script to produce disassembly of +the generated code annotated with the samples. +

    + +

    You can obtain a call graph via +Gprof2Dot.

    Unit testing

    @@ -196,10 +253,66 @@ for posterior analysis, e.g.: We use LLVM-C bindings for now. They are not documented, but follow the C++ interfaces very closely, and appear to be complete enough for code generation. See - http://npcontemplation.blogspot.com/2008/06/secret-of-llvm-c-bindings.html - for a stand-alone example. See the llvm-c/Core.h file for reference. + + this stand-alone example. See the llvm-c/Core.h file for reference.
  • +

    Recommended Reading

    + + + +