public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc/devel/c++-coroutines] [Ada] Bump secondary stack alignment factor in full runtimes
@ 2020-06-12 18:47 Iain D Sandoe
0 siblings, 0 replies; only message in thread
From: Iain D Sandoe @ 2020-06-12 18:47 UTC (permalink / raw)
To: gcc-cvs
https://gcc.gnu.org/g:4739f95b008ff61288e46a5f615e97fbdb06af01
commit 4739f95b008ff61288e46a5f615e97fbdb06af01
Author: Olivier Hainque <hainque@adacore.com>
Date: Tue Mar 24 08:49:29 2020 +0000
[Ada] Bump secondary stack alignment factor in full runtimes
2020-06-12 Olivier Hainque <hainque@adacore.com>
gcc/ada/
* libgnat/s-secsta.ads (Memory_Alignment): New constant, memory
alignment for chunks and allocated blocks. Initialize to
Standard'Maximum_Alignment * 2.
(Chunk_Memory): Use it.
* libgnat/s-secsta.adb (Round_Up): Likewise.
Diff:
---
gcc/ada/libgnat/s-secsta.adb | 2 +-
gcc/ada/libgnat/s-secsta.ads | 19 ++++++++++++++++---
2 files changed, 17 insertions(+), 4 deletions(-)
diff --git a/gcc/ada/libgnat/s-secsta.adb b/gcc/ada/libgnat/s-secsta.adb
index 0010449ea94..7ec846281f9 100644
--- a/gcc/ada/libgnat/s-secsta.adb
+++ b/gcc/ada/libgnat/s-secsta.adb
@@ -564,7 +564,7 @@ package body System.Secondary_Stack is
--------------
function Round_Up (Size : Storage_Count) return Memory_Size is
- Algn_MS : constant Memory_Size := Standard'Maximum_Alignment;
+ Algn_MS : constant Memory_Size := Memory_Alignment;
Size_MS : constant Memory_Size := Memory_Size (Size);
begin
diff --git a/gcc/ada/libgnat/s-secsta.ads b/gcc/ada/libgnat/s-secsta.ads
index 764ae2f153b..d06e97f96d8 100644
--- a/gcc/ada/libgnat/s-secsta.ads
+++ b/gcc/ada/libgnat/s-secsta.ads
@@ -261,10 +261,23 @@ private
subtype Memory_Index is Memory_Size;
-- Index into the memory storage of a single chunk
+ Memory_Alignment : constant := Standard'Maximum_Alignment * 2;
+ -- The memory alignment we will want to honor on every allocation.
+ --
+ -- At this stage, gigi assumes we can accomodate any alignment requirement
+ -- there might be on the data type for which the memory gets allocated (see
+ -- build_call_alloc_dealloc).
+ --
+ -- The multiplication factor is intended to account for requirements
+ -- by user code compiled with specific arch/cpu options such as -mavx
+ -- on X86[_64] targets, which Standard'Maximum_Alignment doesn't convey
+ -- without such compilation options. * 4 would actually be needed to
+ -- support -mavx512f on X86, but this would incur more annoying memory
+ -- consumption overheads.
+
type Chunk_Memory is array (Memory_Size range <>) of SSE.Storage_Element;
- for Chunk_Memory'Alignment use Standard'Maximum_Alignment;
- -- The memory storage of a single chunk. It utilizes maximum alignment in
- -- order to guarantee efficient operations.
+ for Chunk_Memory'Alignment use Memory_Alignment;
+ -- The memory storage of a single chunk
--------------
-- SS_Chunk --
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2020-06-12 18:47 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-12 18:47 [gcc/devel/c++-coroutines] [Ada] Bump secondary stack alignment factor in full runtimes Iain D Sandoe
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).