[Llvm-bgq-discuss] Interpreting CLANG assembly

Thomas Gooding tgooding at us.ibm.com
Thu Apr 18 15:38:28 CDT 2013


Hal Finkel <hfinkel at anl.gov> wrote on 04/18/2013 03:08:24 PM:
> > From: "Thomas Gooding" <tgooding at us.ibm.com>
> > I'm not sure it uses the same assembler as gcc. The following is an
> > instruction that gave me some trouble, it assembles under gcc but
> > not llvm.
> > mtfsf 0,%f0,1,0
> >
> > start.S: Assembler messages:
> > start.S:278: Error: junk at end of line: `1,0'
> >
> > The mtfsf instruction appears to have additional parameters in the
> > embedded PowerPC book.
>
> That's odd; can you grep both assembly files so that I can see that
> LLVM prints vs. what gcc prints?

llvm:
$LLVMHOME/bgclang -m64 -g -O2 -Werror -MMD -MF .dep.start.S.d -D__KERNEL__
-Wall  -I/bghome/tgooding/bgq/work -iquote /bghome/tgooding/bgq/cnk/src
-I/bghome/tgooding/bgq/work/spi/include/kernel/firmware
-fno-strict-aliasing -c -D__ASSEMBLY__ -S -Os start.S
...
 lfd %f0,1280(%r3)
 mtfsf 0,%f0,1,0
 qvlfdux %f0,%r11,%r0
 qvlfdux %f1,%r11,%r0
 qvlfdux %f2,%r11,%r0
...

gcc:
/bgsys/drivers/ppcfloor/gnu-linux/bin/powerpc64-bgq-linux-gcc -m64 -g -O2
-Werror -MMD -MF .dep.start.S.d -D__KERNEL__ -Wall
-I/bghome/tgooding/bgq/work -iquote /bghome/tgooding/bgq/cnk/src
-I/bghome/tgooding/bgq/work/spi/include/kernel/firmware
-fno-strict-aliasing -c -D__ASSEMBLY__ -S -Os start.S
...
 lfd %f0,1280(%r3)
 mtfsf 0,%f0,1,0
 qvlfdux %f0,%r11,%r0
 qvlfdux %f1,%r11,%r0
 qvlfdux %f2,%r11,%r0
...

After increasing the verbosity (bgclang -v), the assembler call looks
incorrect:

"/bgsys/drivers/ppcfloor/gnu-linux/lib/gcc/powerpc64-bgq-linux/4.4.6/../../../../powerpc64-bgq-linux/bin/as"
 -a64 -mppc64 -many -o start.o /tmp/start-9mU46t.s

Whereas I think it should be:

"/bgsys/drivers/ppcfloor/gnu-linux/lib/gcc/powerpc64-bgq-linux/4.4.6/../../../../powerpc64-bgq-linux/bin/as"
 -a64 -ma2q -many -o start.o /tmp/start-9mU46t.s

Maybe there's a way to configure this somewhere?

Thanks,
Tom

> Thanks again,
> Hal

Tom Gooding
Senior Engineer / Blue Gene Kernels
507-253-0747  (internal:  553-0747)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.alcf.anl.gov/pipermail/llvm-bgq-discuss/attachments/20130418/68aceee0/attachment-0001.html>


More information about the llvm-bgq-discuss mailing list