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
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 via email to