POWER8 inline assembly clobbers

171 views
Skip to first unread message

Anton Blanchard

unread,
May 10, 2016, 10:08:08 PM5/10/16
to OpenBLAS-dev
OpenBLAS fails to build on a recent ppc64le toolchain because of issues with inline assembly clobbers, eg:

../kernel/power/scopy_microk_power8.c:57:2: error: PIC register clobbered by ‘%2’ in ‘asm’

The clobbers do specify r2:

        : "cr0", "%0", "%2" , "%1", "memory"

Is there a reason we are we specifying r0, r2 and r1 in the clobber list?

Anton

Werner Saar

unread,
May 11, 2016, 12:29:06 AM5/11/16
to openbl...@googlegroups.com
Hi,

%0, %1 and %2 are not the register but the inputs i, x1 and y1.

Best regards
Werner
--
You received this message because you are subscribed to the Google Groups "OpenBLAS-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to openblas-dev...@googlegroups.com.
To post to this group, send email to openbl...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Anton Blanchard

unread,
Aug 8, 2016, 8:14:40 PM8/8/16
to OpenBLAS-dev
On Wednesday, May 11, 2016 at 2:29:06 PM UTC+10, Werner Saar wrote:
Hi,

%0, %1 and %2 are not the register but the inputs i, x1 and y1.

Your inline assembly is incorrect, it does not do that. In fact OpenBLAS will not
build on recent gcc versions because of this error.

You need to add constraints to the arguments, as an example:

        :
          "+&r" (i),    // 0    
          "+&r" (y1),   // 1
          "+&r" (x1),   // 2
          "+&r" (y2),   // 3
          "+&r" (x2),   // 4
        :
          "r" (16),     // 5
          "r" (32),     // 6
          "r" (48),     // 7
          "r" (64),     // 8
          "r" (80),     // 9
          "r" (96),     // 10
          "r" (112)     // 11
        : "cr0", "memory"
        );

Alan Modra

unread,
Feb 2, 2017, 7:30:43 PM2/2/17
to OpenBLAS-dev

I've fixed a bunch of issues in the attached patch.  Please take a look.
0001-Fix-power8-asm.patch

Alan Modra

unread,
Feb 13, 2017, 4:23:40 PM2/13/17
to OpenBLAS-dev
Revised patch, correcting all power8 asm().  The .S files also contain errors, not fixed by this patch.
0001-Fix-power8-asm.patch
Reply all
Reply to author
Forward
0 new messages