[Openmp-commits] [PATCH] D138704: RFC: [openmp] Provide an assembly implementation of __kmp_invoke_microtask on ARM

Martin Storsjö via Phabricator via Openmp-commits openmp-commits at lists.llvm.org
Tue Nov 29 06:13:43 PST 2022


mstorsjo added inline comments.


================
Comment at: openmp/runtime/src/z_Linux_asm.S:1447
+	// We strictly need 4*(argc-2) bytes, but allocate 4*argc for
+	// simplicity (to avoid needing to handle the argc<2 cases).
+	// We align the number of bytes allocated to 8 bytes, to keep the
----------------
DavidSpickett wrote:
> What is the `-2` in `argc-2`? (or rather what would it be)
We pass 2 arguments out of `argc` in registers (while the other 2 register parameters are taken by `tid` and `gtid`). In the case of aarch64 with 8 register parameters, they'd need space for `argc-6` arguments on the stack.


================
Comment at: openmp/runtime/src/z_Linux_asm.S:1452
+	// extra 8 bytes for gtid and tid.
+	mov	r5, #1
+	add	r5, r5, r3, lsr #1
----------------
DavidSpickett wrote:
> This 1 here, is it part of the rounding or is it the extra 8 bytes for gtid and tid?
This is the extra 8 bytes for gtid and tid.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D138704/new/

https://reviews.llvm.org/D138704



More information about the Openmp-commits mailing list