OSDN Git Service

Add Subzero documentation.
authorNicolas Capens <capn@google.com>
Tue, 27 Jun 2017 14:24:22 +0000 (10:24 -0400)
committerNicolas Capens <capn@google.com>
Tue, 27 Jun 2017 14:27:11 +0000 (14:27 +0000)
Change-Id: I47fa608e8923605bd090d6216c9ccf7d5c4051e2
Reviewed-on: https://swiftshader-review.googlesource.com/10308
Reviewed-by: Nicolas Capens <capn@google.com>
Tested-by: Nicolas Capens <capn@google.com>
docs/Index.md
docs/Subzero.md [new file with mode: 0644]

index e22f063..12c4318 100644 (file)
@@ -20,7 +20,7 @@ The Renderer layer generates specialized processing routines for draw calls and
 \r
 Reactor is an embedded language for C++ to dynamically generate code in a WYSIWYG fashion. It allows to specialize the processing routines for the state and shaders used by each draw call. Its syntax closely resembles C and shading languages, to make the code generation easily readable.\r
 \r
-The JIT layer is a run-time compiler, such as [LLVM](http://llvm.org/)'s JIT. Reactor records its operations in an in-memory intermediate form which can be materialized by the JIT into a function which can be called directly.\r
+The JIT layer is a run-time compiler, such as [LLVM](http://llvm.org/)'s JIT, or [Subzero](Subzero.md). Reactor records its operations in an in-memory intermediate form which can be materialized by the JIT into a function which can be called directly.\r
 \r
 Design\r
 ------\r
diff --git a/docs/Subzero.md b/docs/Subzero.md
new file mode 100644 (file)
index 0000000..ae5c046
--- /dev/null
@@ -0,0 +1,19 @@
+Subzero Documentation\r
+=====================\r
+\r
+Subzero is a JIT compiler used as a back-end for [Reactor](Reactor.md). It originates from Chrome's [Portable Native Client](https://developer.chrome.com/native-client) project. Its authoritative repository is at [https://chromium.googlesource.com/native_client/pnacl-subzero/](https://chromium.googlesource.com/native_client/pnacl-subzero/).\r
+\r
+Subzero for SwiftShader\r
+-----------------------\r
+\r
+SwiftShader contains a fork of the Subzero source code (at the time of writing they are in sync). It is an alternative JIT compiler back-end, with LLVM still being the default for CMake builds. To build SwiftShader with Subzero instead of LLVM, specify -DREACTOR_BACKEND=Subzero in your CMake command (or change LLVM to Subzero in the CMake GUI). For Chrome builds that use the BUILD.gn files, Subzero is the default as it produces significantly smaller binaries than with LLVM.\r
+\r
+Subzero Development\r
+-------------------\r
+\r
+Development on Subzero itself requires setting up the NaCl environment on a Linux system to be able to run its unit tests:\r
+\r
+* Install Chrome's [depot_tools](http://dev.chromium.org/developers/how-tos/install-depot-tools).\r
+* Run ```mkdir nacl && cd nacl && fetch nacl``` ([ref](http://www.chromium.org/nativeclient/how-tos/how-to-use-git-svn-with-native-client)).\r
+* Run ```native_client/toolchain_build/toolchain_build_pnacl.py --verbose --sync --clobber --install toolchain/linux_x86/pnacl_newlib_raw``` ([ref](https://sites.google.com/a/chromium.org/dev/nativeclient/pnacl/developing-pnacl#TOC-TL-DR-for-checking-out-PNaCl-sources-building-and-testing)).\r
+* Run all unit tests with ```make -f Makefile.standalone check``` ([ref](https://chromium.googlesource.com/native_client/pnacl-subzero/+/master/docs/README.rst)).\r