Nathan,
The gcc syntax definitely makes everything but the first string in the asm
optional.
For instance
asm("nop")
Rather than
asm("nop" :::)
However xlc appears to be a little bit more restricted by not accepting a
subset of the grammar.
-Paul [Sent from my phone]
On Wednesday, May 4, 2016, Nathan Hjelm <[email protected]> wrote:
>
> Go ahead, I don't have access to xlc so I couldn't verify myself. I
> don't fully understand why the last : can be omitted when there are no
> clobbers.
>
> -Nathan
>
> On Wed, May 04, 2016 at 01:34:48PM -0500, Josh Hursey wrote:
> > Did someone pick this up to merge into master & v2.x?
> > I can confirm that Paul's patch fixes the issue for XL compilers. I
> didn't
> > see a PR for it, but can file one if no one has yet.
> > On Mon, May 2, 2016 at 6:55 PM, Paul Hargrove <[email protected]
> <javascript:;>> wrote:
> >
> > It appears that xlc's support for gcc-style inline asm does not
> allow an
> > empty clobbers list.
> > The failure I see is
> > libtool: compile: xlc -DHAVE_CONFIG_H -I.
> >
> -I/home/hargrove/SCRATCH/OMPI/openmpi-2.0.0rc2-linux-ppc64-xlc-12.1/openmpi-2.0.0rc2/opal/asm
> > -I../../opal/include -I../../ompi/include -I../../oshmem/include
> > -I../../opal/mca/hwloc/hwloc1112/hwloc/include/private/autogen
> > -I../../opal/mca/hwloc/hwloc1112/hwloc/include/hwloc/autogen
> > -I../../ompi/mpiext/cuda/c
> >
> -I/home/hargrove/SCRATCH/OMPI/openmpi-2.0.0rc2-linux-ppc64-xlc-12.1/openmpi-2.0.0rc2
> > -I../..
> >
> -I/home/hargrove/SCRATCH/OMPI/openmpi-2.0.0rc2-linux-ppc64-xlc-12.1/openmpi-2.0.0rc2/opal/include
> >
> -I/home/hargrove/SCRATCH/OMPI/openmpi-2.0.0rc2-linux-ppc64-xlc-12.1/openmpi-2.0.0rc2/orte/include
> > -I../../orte/include
> >
> -I/home/hargrove/SCRATCH/OMPI/openmpi-2.0.0rc2-linux-ppc64-xlc-12.1/openmpi-2.0.0rc2/ompi/include
> >
> -I/home/hargrove/SCRATCH/OMPI/openmpi-2.0.0rc2-linux-ppc64-xlc-12.1/openmpi-2.0.0rc2/oshmem/include
> > -D_REENTRANT
> >
> -I/home/hargrove/SCRATCH/OMPI/openmpi-2.0.0rc2-linux-ppc64-xlc-12.1/openmpi-2.0.0rc2/opal/mca/hwloc/hwloc1112/hwloc/include
> >
> -I/home/hargrove/SCRATCH/OMPI/openmpi-2.0.0rc2-linux-ppc64-xlc-12.1/BLD/opal/mca/hwloc/hwloc1112/hwloc/include
> >
> -I/home/hargrove/SCRATCH/OMPI/openmpi-2.0.0rc2-linux-ppc64-xlc-12.1/openmpi-2.0.0rc2/opal/mca/event/libevent2022/libevent
> >
> -I/home/hargrove/SCRATCH/OMPI/openmpi-2.0.0rc2-linux-ppc64-xlc-12.1/openmpi-2.0.0rc2/opal/mca/event/libevent2022/libevent/include
> >
> -I/home/hargrove/SCRATCH/OMPI/openmpi-2.0.0rc2-linux-ppc64-xlc-12.1/BLD/opal/mca/event/libevent2022/libevent/include
> > -q64 -g -c
> >
> /home/hargrove/SCRATCH/OMPI/openmpi-2.0.0rc2-linux-ppc64-xlc-12.1/openmpi-2.0.0rc2/opal/asm/asm.c
> > -Wp,-qmakedep=gcc,-MF.deps/asm.TPlo -qpic -DPIC -o .libs/asm.o
> >
> "/home/hargrove/SCRATCH/OMPI/openmpi-2.0.0rc2-linux-ppc64-xlc-12.1/openmpi-2.0.0rc2/opal/include/opal/sys/powerpc/atomic.h",
> > line 150.27: 1506-276 (S) Syntax error: possible missing string
> literal?
> >
> "/home/hargrove/SCRATCH/OMPI/openmpi-2.0.0rc2-linux-ppc64-xlc-12.1/openmpi-2.0.0rc2/opal/include/opal/sys/powerpc/atomic.h",
> > line 239.27: 1506-276 (S) Syntax error: possible missing string
> literal?
> > make[2]: *** [asm.lo] Error 1
> > The code corresponding to the first error message is
> >
> > 143 static inline int32_t opal_atomic_ll_32 (volatile int32_t
> > *addr)
> > 144 {
> > 145 int32_t ret;
> > 146
> > 147 __asm__ __volatile__ ("lwarx %0, 0, %1 \n\t"
> > 148 : "=&r" (ret)
> > 149 : "r" (addr)
> > 150 :);
> > 151 return ret;
> > 152 }
> >
> > And the second error is the identical line as it appears in
> > opal_atomic_ll_64().
> > The following patch to remove the "trailing" colons was sufficient
> to
> > fix this problem.
> > --- openmpi-2.0.0rc2/opal/include/opal/sys/powerpc/atomic.h~
> > 2016-05-02 23:37:13.597782000 +0000
> > +++ openmpi-2.0.0rc2/opal/include/opal/sys/powerpc/atomic.h
> > 2016-05-02 23:36:11.615404378 +0000
> > @@ -147,7 +147,7 @@
> > __asm__ __volatile__ ("lwarx %0, 0, %1 \n\t"
> > : "=&r" (ret)
> > : "r" (addr)
> > - :);
> > + );
> > return ret;
> > }
> > @@ -236,7 +236,7 @@
> > __asm__ __volatile__ ("ldarx %0, 0, %1 \n\t"
> > : "=&r" (ret)
> > : "r" (addr)
> > - :);
> > + );
> > return ret;
> > }
> > -Paul
> > --
> > Paul H. Hargrove [email protected]
> <javascript:;>
> > Computer Languages & Systems Software (CLaSS) Group
> > Computer Science Department Tel: +1-510-495-2352
> > Lawrence Berkeley National Laboratory Fax: +1-510-486-6900
> > _______________________________________________
> > devel mailing list
> > [email protected] <javascript:;>
> > Subscription: https://www.open-mpi.org/mailman/listinfo.cgi/devel
> > Link to this post:
> > http://www.open-mpi.org/community/lists/devel/2016/05/18886.php
>
> > _______________________________________________
> > devel mailing list
> > [email protected] <javascript:;>
> > Subscription: https://www.open-mpi.org/mailman/listinfo.cgi/devel
> > Link to this post:
> http://www.open-mpi.org/community/lists/devel/2016/05/18906.php
>
>
--
Paul H. Hargrove [email protected]
Computer Languages & Systems Software (CLaSS) Group
Computer Science Department Tel: +1-510-495-2352
Lawrence Berkeley National Laboratory Fax: +1-510-486-6900