[llvm-dev] clang triple and clang target

Rail Shafigulin via llvm-dev llvm-dev at lists.llvm.org
Mon Mar 14 11:19:43 PDT 2016


On Mon, Mar 14, 2016 at 8:27 AM, Daniel Sanders <Daniel.Sanders at imgtec.com>
wrote:

> > I need to see how they look, whether it is ARM, Mips or X86.
>
>
>
> The Mips triples you're most likely to need are:
>
> ·         mips-linux-gnu – 32-bit big-endian on GNU/Linux
>
> ·         mipsel-linux-gnu – 32-bit little-endian on GNU/Linux
>
> ·         mips64-linux-gnu – 64-bit big-endian on GNU/Linux
>
> ·         mips64el-linux-gnu – 64-bit little-endian on GNU/Linux
>
>
>
> I should mention that Mips has quite a few triple-related bugs but if
> you're just looking at assembly the one you're most likely to encounter is
> that mips-*/mipsel-* only work for 32-bit subtargets and
> mips64-*/mips64el-* only work for 64-bit subtargets. If you don't match
> them up correctly then you'll either get an assertion from the code
> generator or a crash. This isn't supposed to be the case but there's been
> some unfortunate misunderstandings about GNU triples and Clang triples
> (they're not quite the same thing) that are difficult to resolve.
>
>
>

Daniel,

Thanks for the response. I tried using the option you recommended but for
some reason I didn't see any vector instructions in the output. Can you
explain what am I doing wrong? Here is the command line I ran

clang -S test.c -o test.msa.mips.s --target=mips-pc-linux-gnu -mmsa -mfp64
-mfloat-abi=hard -mcpu=mips32 -fslp-vectorize-aggressive
 -fslp-vectorize-aggressive -fslp-vectorize -fvectorize
-fno-lax-vector-conversions -O3

I'm attaching test.c as well as test.msa.mips.s so you could see input as
well as output.

Any help is appreciated.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20160314/2a548668/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: test.c
Type: text/x-csrc
Size: 206 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20160314/2a548668/attachment.c>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: test.msa.mips.s
Type: application/octet-stream
Size: 740 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20160314/2a548668/attachment.obj>


More information about the llvm-dev mailing list