[LLVMdev] I am confused about target triple strings

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


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