public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Tobias Burnus <tobias@codesourcery.com>
To: Thomas Schwinge <thomas@codesourcery.com>, <gcc-patches@gcc.gnu.org>
Cc: Jakub Jelinek <jakub@redhat.com>
Subject: Re: [committed] OpenMP: Cleanups related to the 'present' modifier
Date: Wed, 14 Jun 2023 12:00:42 +0200	[thread overview]
Message-ID: <837af8e8-3107-8ac3-ad77-aa53509ad6d0@codesourcery.com> (raw)
In-Reply-To: <87jzw6305o.fsf@euler.schwinge.homeip.net>

[-- Attachment #1: Type: text/plain, Size: 1467 bytes --]

On 14.06.23 10:42, Thomas Schwinge wrote:
> Couldn't/shouldn't we now get rid of this 'GOMP_MAP_FLAG_PRESENT'...
...
>>   #define GOMP_MAP_PRESENT_P(X) \
>> -  (((X) & GOMP_MAP_FLAG_PRESENT) == GOMP_MAP_FLAG_PRESENT)
>> +  (((X) & GOMP_MAP_FLAG_PRESENT) == GOMP_MAP_FLAG_PRESENT \
>> +   || (X) == GOMP_MAP_FORCE_PRESENT)
> ..., and this 'GOMP_MAP_PRESENT_P' should look for
> 'GOMP_MAP_FLAG_ALWAYS_PRESENT' instead of 'GOMP_MAP_FLAG_PRESENT' (plus
> 'GOMP_MAP_FORCE_PRESENT')?
>
> Instead of the current effective 'GOMP_MAP_FLAG_ALWAYS_PRESENT':
>
>      GOMP_MAP_FLAG_SPECIAL_0
>      | GOMP_MAP_FLAG_SPECIAL_2
>      | GOMP_MAP_FLAG_SPECIAL_5
>
> ..., it could/should use a simpler flag combination?  (My idea is that
> this later make usage of flag bits for other purposes easier -- but I've
> not verified that in depth.)

I concur that it would be useful to save that space. We do not fully
rule out other combinations as we can always move to check single values
instead of comparing bit patterns, but I concur, reserving flags would
be useful.

Can you propose some bit pattern to use? Attached are the currently used
ones (binary, hex, and decimal).

Tobias
-----------------
Siemens Electronic Design Automation GmbH; Anschrift: Arnulfstraße 201, 80634 München; Gesellschaft mit beschränkter Haftung; Geschäftsführer: Thomas Heurung, Frank Thürauf; Sitz der Gesellschaft: München; Registergericht München, HRB 106955

[-- Attachment #2: bitpattern.txt --]
[-- Type: text/plain, Size: 1890 bytes --]

100000000	0x100	256	GOMP_MAP_LAST
000000000	0x000	  0	GOMP_MAP_ALLOC
000000001	0x001	  1	GOMP_MAP_TO
000000010	0x002	  2	GOMP_MAP_FROM
000000011	0x003	  3	GOMP_MAP_TOFROM
000000100	0x004	  4	GOMP_MAP_POINTER
000000101	0x005	  5	GOMP_MAP_TO_PSET
000000110	0x006	  6	GOMP_MAP_FORCE_PRESENT
000000111	0x007	  7	GOMP_MAP_DELETE
000001000	0x008	  8	GOMP_MAP_FORCE_DEVICEPTR
000001001	0x009	  9	GOMP_MAP_DEVICE_RESIDENT
000001010	0x00a	 10	GOMP_MAP_LINK
000001011	0x00b	 11	GOMP_MAP_IF_PRESENT
000001100	0x00c	 12	GOMP_MAP_FIRSTPRIVATE
000001101	0x00d	 13	GOMP_MAP_FIRSTPRIVATE_INT
000001110	0x00e	 14	GOMP_MAP_USE_DEVICE_PTR
000001111	0x00f	 15	GOMP_MAP_ZERO_LEN_ARRAY_SECTION
010000000	0x080	128	GOMP_MAP_FORCE_ALLOC
010000001	0x081	129	GOMP_MAP_FORCE_TO
010000010	0x082	130	GOMP_MAP_FORCE_FROM
010000011	0x083	131	GOMP_MAP_FORCE_TOFROM
000010000	0x010	 16	GOMP_MAP_USE_DEVICE_PTR_IF_PRESENT
000010001	0x011	 17	GOMP_MAP_ALWAYS_TO
000010010	0x012	 18	GOMP_MAP_ALWAYS_FROM
000010011	0x013	 19	GOMP_MAP_ALWAYS_TOFROM
010010101	0x095	149	GOMP_MAP_ALWAYS_PRESENT_TO
010010110	0x096	150	GOMP_MAP_ALWAYS_PRESENT_FROM
010010111	0x097	151	GOMP_MAP_ALWAYS_PRESENT_TOFROM
000011100	0x01c	 28	GOMP_MAP_STRUCT
000011101	0x01d	 29	GOMP_MAP_ALWAYS_POINTER
000011110	0x01e	 30	GOMP_MAP_POINTER_TO_ZERO_LENGTH_ARRAY_SECTION
000011111	0x01f	 31	GOMP_MAP_DELETE_ZERO_LEN_ARRAY_SECTION
000010111	0x017	 23	GOMP_MAP_RELEASE
001010000	0x050	 80	GOMP_MAP_ATTACH
001010001	0x051	 81	GOMP_MAP_DETACH
011010001	0x0d1	209	GOMP_MAP_FORCE_DETACH
001010010	0x052	 82	GOMP_MAP_ATTACH_ZERO_LENGTH_ARRAY_SECTION
100000001	0x101	257	GOMP_MAP_FIRSTPRIVATE_POINTER
100000010	0x102	258	GOMP_MAP_FIRSTPRIVATE_REFERENCE
100000011	0x103	259	GOMP_MAP_ATTACH_DETACH
100000100	0x104	260	GOMP_MAP_PRESENT_ALLOC
100000101	0x105	261	GOMP_MAP_PRESENT_TO
100000110	0x106	262	GOMP_MAP_PRESENT_FROM
100000111	0x107	263	GOMP_MAP_PRESENT_TOFROM

  reply	other threads:[~2023-06-14 10:00 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-03 13:44 [PATCH] openmp: Add support for " Kwok Cheung Yeung
2023-02-09 21:17 ` [OG12][committed] openmp: Add support for the " Kwok Cheung Yeung
2023-02-14 22:44   ` [og12] Address cast to pointer from integer of different size in 'libgomp/target.c:gomp_target_rev' (was: [OG12][committed] openmp: Add support for the 'present' modifier) Thomas Schwinge
2023-02-15  0:00   ` [OG12][committed] openmp: Add support for the 'present' modifier Kwok Cheung Yeung
2023-02-15 19:02   ` [og12] Fix 'libgomp.{c-c++-common,fortran}/target-present-*' test cases (was: [OG12][committed] openmp: Add support for the 'present' modifier) Thomas Schwinge
2023-06-07 11:25     ` [committed] testsuite/libgomp.*/target-present-*.{c,f90}: Improve and fix (was: Re: [og12] Fix 'libgomp.{c-c++-common,fortran}/target-present-*' test cases) Tobias Burnus
2023-06-07 11:26     ` Tobias Burnus
2023-06-12 16:44   ` [committed] OpenMP: Cleanups related to the 'present' modifier Tobias Burnus
2023-06-14  8:42     ` Thomas Schwinge
2023-06-14 10:00       ` Tobias Burnus [this message]
2023-02-17 11:45 ` [PATCHv2] openmp: Add support for " Kwok Cheung Yeung
2023-04-28 17:26   ` Tobias Burnus
2023-06-06 14:55     ` [committed] " Tobias Burnus

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=837af8e8-3107-8ac3-ad77-aa53509ad6d0@codesourcery.com \
    --to=tobias@codesourcery.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=jakub@redhat.com \
    --cc=thomas@codesourcery.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).