Re: [gomp-nvptx 6/9] nvptx libgcc: rewrite in C

2015-12-07 Thread Nathan Sidwell

On 12/01/15 18:52, Bernd Schmidt wrote:

What exactly is the problem with having asm files? I'm asking because this...

On 12/01/2015 04:28 PM, Alexander Monakov wrote:

+/* __shared__ char *__nvptx_stacks[32];  */
+asm ("// BEGIN GLOBAL VAR DEF: __nvptx_stacks");
+asm (".visible .shared .u64 __nvptx_stacks[32];");
+
+/* __shared__ unsigned __nvptx_uni[32];  */
+asm ("// BEGIN GLOBAL VAR DEF: __nvptx_uni");
+asm (".visible .shared .u32 __nvptx_uni[32];");


... doesn't look great to me. This is better done in assembly directly IMO.


the decl reworking I recently committed has a 'TODO: this would be a good place 
to check for a .shared section' in it.  That would  seem a better place to 
augment and allow the above with a regular __attribute__((section...))


nathan



Re: [gomp-nvptx 6/9] nvptx libgcc: rewrite in C

2015-12-01 Thread Alexander Monakov
On Wed, 2 Dec 2015, Bernd Schmidt wrote:

> What exactly is the problem with having asm files? I'm asking because this...

Wrappers for malloc and free need different code under -muniform-simt.

> 
> On 12/01/2015 04:28 PM, Alexander Monakov wrote:
> > +/* __shared__ char *__nvptx_stacks[32];  */
> > +asm ("// BEGIN GLOBAL VAR DEF: __nvptx_stacks");
> > +asm (".visible .shared .u64 __nvptx_stacks[32];");
> > +
> > +/* __shared__ unsigned __nvptx_uni[32];  */
> > +asm ("// BEGIN GLOBAL VAR DEF: __nvptx_uni");
> > +asm (".visible .shared .u32 __nvptx_uni[32];");
> 
> ... doesn't look great to me. This is better done in assembly directly IMO.

Hm.  I can convert it to asm, but then if/when I start using attribute-based
shared memory, I'd have to move it back to C again, I think.

Thanks.
Alexander


Re: [gomp-nvptx 6/9] nvptx libgcc: rewrite in C

2015-12-01 Thread Bernd Schmidt
What exactly is the problem with having asm files? I'm asking because 
this...


On 12/01/2015 04:28 PM, Alexander Monakov wrote:

+/* __shared__ char *__nvptx_stacks[32];  */
+asm ("// BEGIN GLOBAL VAR DEF: __nvptx_stacks");
+asm (".visible .shared .u64 __nvptx_stacks[32];");
+
+/* __shared__ unsigned __nvptx_uni[32];  */
+asm ("// BEGIN GLOBAL VAR DEF: __nvptx_uni");
+asm (".visible .shared .u32 __nvptx_uni[32];");


... doesn't look great to me. This is better done in assembly directly IMO.


Bernd