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

Alexander Monakov amonakov@ispras.ru
Wed Dec 2 00:23:00 GMT 2015


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



More information about the Gcc-patches mailing list