[LLVMdev] I am confused about target triple strings

Rodney M. Bates rodney_bates at lcwb.coop
Wed Nov 26 14:34:37 PST 2014


I think I have answered my own question.

When the triple comes through the IR, the architecture does have to be
"x86_64".  When it comes from the llc -march option, it's "x86-64".  But
this option apparently is only the target machine, not the rest of the components,
so the hyphen is not a separator.

On 11/26/2014 04:14 PM, Rodney M. Bates wrote:
> How do I construct a target triple (quadruple?) string when the architecture is
> "x86-64"?  The hyphen in the architecture is ambiguous with those that separate the
> components of the triple.
>
> Looking at Triple.cpp and guessing that Triple::Triple(const Twine &Str)
> would be parsing it, it appears getArchName stops short of any
> hyphen and parseArch expects "x86_64", with an underscore.
>
>
> But "llc -march" accepts it with the hyphen and rejects the underscore:
>
> rodney at allegheny:~/proj/m3/llvmtest/hello/AMD64_LINUX$ llc  -filetype=asm -march=x86_64 Hello.mb -o Hello_.ms
> llc: error: invalid target 'x86_64'.
> rodney at allegheny:~/proj/m3/llvmtest/hello/AMD64_LINUX$ llc  -filetype=asm -march=x86-64 Hello.mb -o Hello.ms
> rodney at allegheny:~/proj/m3/llvmtest/hello/AMD64_LINUX$
>
> llc -version also lists "x86-64" as a registered target.
>
> Triple.cpp has a mix of "x86-64" and "x86_64" strings that I have not been
> able to make much of.
>
> This is llvm 3.4.2
>
>
>

-- 
Rodney Bates
rodney.m.bates at acm.org



More information about the llvm-dev mailing list