<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:#0563C1;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:#954F72;
        text-decoration:underline;}
p.msonormal0, li.msonormal0, div.msonormal0
        {mso-style-name:msonormal;
        mso-margin-top-alt:auto;
        margin-right:0in;
        mso-margin-bottom-alt:auto;
        margin-left:0in;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
span.EmailStyle18
        {mso-style-type:personal;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
span.EmailStyle19
        {mso-style-type:personal-reply;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:70.85pt 70.85pt 56.7pt 70.85pt;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-US" link="#0563C1" vlink="#954F72">
<div class="WordSection1">
<p class="MsoNormal">The term “target” is somewhat overloaded.<o:p></o:p></p>
<p class="MsoNormal">When llvm-config tells you it was built with the X86 target, that actually includes a variety of closely related architectures, such as x86_64, i386, and so on.  Within the x86_64 architecture, there are many individual processor implementations
 that LLVM understands, such as Skylake, Bulldozer, and many many more.<o:p></o:p></p>
<p class="MsoNormal">What *<b>clang</b>* means by “target” is really the target triple, which includes the architecture, OS, and sometimes other information.  For clang-cl the default triple is likely something along the lines of “x86_64-pc-msvc” and tends
 to be derived from the characteristics of the environment where you are running clang.<o:p></o:p></p>
<p class="MsoNormal">Clang accepts a -target option which allows you to specify a different triple.  The first component of the triple would have to be an architecture name that is supported by one of the LLVM targets that clang was built with.  So, to support
 triples starting with “x86_64” you would need a clang that includes the X86 target, and so on.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Regarding the Mips target, it looks like the supported 32-bit architecture names are “mips” and “mipsel” so you could experiment with using triples starting with those strings.  I don’t know anything in particular about the Mips target
 other than what I just said.  I have cc’d the code owner of the MIPS target, who might be able to help you there.<o:p></o:p></p>
<p class="MsoNormal">--paulr<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<div style="border:none;border-left:solid blue 1.5pt;padding:0in 0in 0in 4.0pt">
<div>
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal"><b>From:</b> cfe-dev <cfe-dev-bounces@lists.llvm.org> <b>On Behalf Of
</b>Gaier, Bjoern via cfe-dev<br>
<b>Sent:</b> Wednesday, November 13, 2019 7:56 AM<br>
<b>To:</b> Clang Dev <cfe-dev@lists.llvm.org><br>
<b>Subject:</b> [cfe-dev] Understanding targets<o:p></o:p></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><span lang="EN-GB">Heyho everyone,<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB">I have a big noob question again! I basically want to know, how I can find out which processors a certain installation of Clang supports and how do I change the target processor.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB">Some background to make my question more clear:<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB">Normally I develop applications for Windows and 64bit – back then using the MSVC compiler. By now I changed to the fantastic Clang-Cl and didn’t thought much about processors – I take it automatically target x86-64 because
 of Visual Studio?<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB">However, I know that Clang supports more processors (or architectures? What is the difference?) then x86-64. So I wanted to know, which are supported and how do I tell Clang do use a different target?<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB">To give even more background:<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB">I used an old development environment, which provided compiler for the old Playstation CPU – Wikipedia says it is a “32-bit RISC MIPS R3000A-compatible MIPS R3051” (I simply thought it is a R3000). And I started to wonder,
 how do I know if Clang supports that old CPU? <o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB">So I ran my llvm-config with --targets-built and got:<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB">AArch64 AMDGPU ARM BPF Hexagon Lanai Mips MSP430 NVPTX PowerPC RISCV Sparc SystemZ WebAssembly X86 XCore<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB">I see there “Mips” and “RISCV” but no RISC MIPS or even a R3000 – does that now mean that Clang does not support does old processors? Or does it? What do I do if I encounter a ‘wild’ Clang without llvm-config – can I
 still find out its targets? I have no idea and this is why I’m asking.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB">Thank you in advance for any help!<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB">Kind greetings<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB">Björn Gaier<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="DE">Als GmbH eingetragen im Handelsregister Bad Homburg v.d.H. HRB 9816, USt.ID-Nr. DE 114 165 789 Geschäftsführer: Dr. Hiroshi Nakamura, Dr. Robert Plank, Markus Bode, Heiko Lampert, Takashi Nagano, Takeshi Fukushima. Junichi
 Tajika <o:p></o:p></span></p>
</div>
</div>
</body>
</html>