summaryrefslogtreecommitdiffstats
path: root/llvm/docs
diff options
context:
space:
mode:
authorWei Ding <wei.ding2@amd.com>2017-02-10 02:15:29 +0000
committerWei Ding <wei.ding2@amd.com>2017-02-10 02:15:29 +0000
commit205bfdb3e9b0d046c788ae611a80f691058fd9a1 (patch)
treeff10b51e956e7f73668ba19f99b044f25cfbd941 /llvm/docs
parent6dec24316b00fcd278430a8b32a7d66189abf71a (diff)
downloadbcm5719-llvm-205bfdb3e9b0d046c788ae611a80f691058fd9a1.tar.gz
bcm5719-llvm-205bfdb3e9b0d046c788ae611a80f691058fd9a1.zip
AMDGPU : Add trap handler support.
Differential Revision: http://reviews.llvm.org/D26010 llvm-svn: 294692
Diffstat (limited to 'llvm/docs')
-rw-r--r--llvm/docs/AMDGPUUsage.rst39
1 files changed, 39 insertions, 0 deletions
diff --git a/llvm/docs/AMDGPUUsage.rst b/llvm/docs/AMDGPUUsage.rst
index 2c1a22762bc..7e4179fea8c 100644
--- a/llvm/docs/AMDGPUUsage.rst
+++ b/llvm/docs/AMDGPUUsage.rst
@@ -261,6 +261,45 @@ VOP_SDWA examples:
For full list of supported instructions, refer to "Vector ALU instructions".
+Trap Handler ABI
+--------------------------
+The Trap Handler suppored is implemented differently based on the host OS. OS
+is obtained from the appropriate element of the target triple HSA OS:
+
+.. code-block:: c++
+ enum TrapHandlerAbi {
+ TrapHandlerAbiNone = 0,
+ TrapHandlerAbiHsa = 1
+ };
+
+ TrapHandlerAbi getTrapHandlerAbi() const {
+ return isAmdHsaOS() ? TrapHandlerAbiHsa : TrapHandlerAbiNone;
+ }
+
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+For HSA OS, a trap handler is always enabled and that the following S_TRAP immediate
+operand codes are supported:
+.. code-block:: c++
+ enum TrapCode {
+ TrapCodeBreakPoint = 0,
+ TrapCodeLLVMTrap = 1,
+ TrapCodeLLVMDebugTrap = 2,
+ TrapCodeHSADebugTrap = 3
+ };
+
+- 0: Used for debugger breakpoint. If debugger is not installed causes dispatch
+to be terminated and its associated queue put into the error state.
+- 1: Used for llvm.trap..queue_ptr is in SGPR0-1. Causes dispatch to be
+terminated and its associated queue put into the error state.
+- 2: Used for llvm.debugtrap. queue_ptr is in SGPR0-1. If debugger not installed
+handled same as llvm.trap.
+- 3: Used for HSA DEBUGTRAP. queue_ptr is in SGPR0-1, the user code is in VGPR0.
+
+Graphics
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+For Graphics, S_ENDPGM is generated for llvm.trap. S_NOP is generated for
+llvm.debugtrap together with a warning that there is no trap handler installed.
+
HSA Code Object Directives
--------------------------
OpenPOWER on IntegriCloud