summaryrefslogtreecommitdiffstats
path: root/llvm/docs/Extensions.rst
diff options
context:
space:
mode:
authorSaleem Abdulrasool <compnerd@compnerd.org>2014-04-30 07:05:07 +0000
committerSaleem Abdulrasool <compnerd@compnerd.org>2014-04-30 07:05:07 +0000
commit25947c318b9d72490be3a1e4c516f8ff2d7cd180 (patch)
tree5009e23f47acc9b6e35448c1037e0a6bfef591a1 /llvm/docs/Extensions.rst
parent99aa6e156a2d2e2fd20d454c37fcc3bf936d504c (diff)
downloadbcm5719-llvm-25947c318b9d72490be3a1e4c516f8ff2d7cd180.tar.gz
bcm5719-llvm-25947c318b9d72490be3a1e4c516f8ff2d7cd180.zip
ARM: support stack probe emission for Windows on ARM
This introduces the stack lowering emission of the stack probe function for Windows on ARM. The stack on Windows on ARM is a dynamically paged stack where any page allocation which crosses a page boundary of the following guard page will cause a page fault. This page fault must be handled by the kernel to ensure that the page is faulted in. If this does not occur and a write access any memory beyond that, the page fault will go unserviced, resulting in an abnormal program termination. The watermark for the stack probe appears to be at 4080 bytes (for accommodating the stack guard canaries and stack alignment) when SSP is enabled. Otherwise, the stack probe is emitted on the page size boundary of 4096 bytes. llvm-svn: 207615
Diffstat (limited to 'llvm/docs/Extensions.rst')
-rw-r--r--llvm/docs/Extensions.rst31
1 files changed, 31 insertions, 0 deletions
diff --git a/llvm/docs/Extensions.rst b/llvm/docs/Extensions.rst
index 7d8c521ec44..9dddab5b5ed 100644
--- a/llvm/docs/Extensions.rst
+++ b/llvm/docs/Extensions.rst
@@ -159,3 +159,34 @@ different COMDATs:
.globl Symbol2
Symbol2:
.long 1
+
+Target Specific Behaviour
+=========================
+
+Windows on ARM
+--------------
+
+Stack Probe Emission
+^^^^^^^^^^^^^^^^^^^^
+
+The reference implementation (Microsoft Visual Studio 2012) emits stack probes
+in the following fashion:
+
+.. code-block:: gas
+
+ movw r4, #constant
+ bl __chkstk
+ sub.w sp, sp, r4
+
+However, this has the limitation of 32 MiB (±16MiB). In order to accomodate
+larger binaries, LLVM supports the use of ``-mcode-model=large`` to allow a 4GiB
+range via a slight deviation. It will generate an indirect jump as follows:
+
+.. code-block:: gas
+
+ movw r4, #constant
+ movw r12, :lower16:__chkstk
+ movt r12, :upper16:__chkstk
+ blx r12
+ sub.w sp, sp, r4
+
OpenPOWER on IntegriCloud