William Dillon via llvm-dev
2016-Jan-03 22:28 UTC
[llvm-dev] Diff to add ARMv6L to Target parser
Hi all. I’ve been working with Swift on ARMv6 and v7. While working with ARMv6 on linux, I noticed that my arm architecture canonicalization code didn’t produce the expected result. The code that I had been using (within Swift’s Driver.cpp the following: static llvm::Triple computeTargetTriple(StringRef DefaultTargetTriple) { llvm::Triple triple = llvm::Triple(DefaultTargetTriple); // Canonicalization of all armv6 sub architectures to armv6 if (triple.getArch() == llvm::Triple::ArchType::arm) { if (triple.getSubArch() == llvm::Triple::SubArchType::ARMSubArch_v6 || triple.getSubArch() == llvm::Triple::SubArchType::ARMSubArch_v6m || triple.getSubArch() == llvm::Triple::SubArchType::ARMSubArch_v6k || triple.getSubArch() == llvm::Triple::SubArchType::ARMSubArch_v6t2) { triple.setArchName("armv6"); } } // Canonicalization of all armv7 sub architectures to armv7 if (triple.getArch() == llvm::Triple::ArchType::arm) { if (triple.getSubArch() == llvm::Triple::SubArchType::ARMSubArch_v7 || triple.getSubArch() == llvm::Triple::SubArchType::ARMSubArch_v7em || triple.getSubArch() == llvm::Triple::SubArchType::ARMSubArch_v7m || triple.getSubArch() == llvm::Triple::SubArchType::ARMSubArch_v7s || triple.getSubArch() == llvm::Triple::SubArchType::ARMSubArch_v7k) { triple.setArchName("armv7"); } } return triple; } However, because the DefaultTargetTriple is armv6l-unknown-linux-gnueabihf, and llvm didn’t know about v6l, it would fail to match and canonicalize to armv6. I added the notion of v6l to llvm to address this. Thoughts/comments? - Will -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: llvm-diff.txt URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20160103/0027af19/attachment.txt>
Renato Golin via llvm-dev
2016-Jan-04 10:23 UTC
[llvm-dev] Diff to add ARMv6L to Target parser
On 3 January 2016 at 22:28, William Dillon via llvm-dev <llvm-dev at lists.llvm.org> wrote:> However, because the DefaultTargetTriple is armv6l-unknown-linux-gnueabihf, and llvm didn’t know about v6l, it would fail to match and canonicalize to armv6. I added the notion of v6l to llvm to address this.Hi Will, ARMv6l was definitely there once. I'm not sure what happened. I'm copying the ARM folks that did most of the recent changes in hope they can shed some light. cheers, --renato
Artyom Skrobov via llvm-dev
2016-Jan-04 14:16 UTC
[llvm-dev] Diff to add ARMv6L to Target parser
>> However, because the DefaultTargetTriple is armv6l-unknown-linux-gnueabihf, >> and llvm didn’t know about v6l, it would fail to match and canonicalize to armv6. >> I added the notion of v6l to llvm to address this. > > ARMv6l was definitely there once. I'm not sure what happened. > > I'm copying the ARM folks that did most of the recent changes in hope they can > shed some light.Going back through SVN history, I cannot find any evidence that ARMv6L ever existed. There used to be ARMv6HL, until r252903 changed it from an architecture variant into an alias for ARMv6K; i.e. ARMv6HL can still be used in a target triple. For a reference, http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/TargetParser.cpp?revision=238651 is the last version of TargetParser before any of our changes, i.e. authored purely by Renato. One can see it has v6HL but not v6L.