James Molloy via llvm-dev
2016-May-18 12:21 UTC
[llvm-dev] LLVM issuse:AArch64 TargetParser
Hi, A64 versus A32/T32 code generation is controlled by the -target option which I don’t believe is under discussion here. James On 18 May 2016, at 13:17, Bruce Hoult <bruce at hoult.org<mailto:bruce at hoult.org>> wrote: Note that armv8a modifies the A32 and T32 instruction sets, and is therefore an important -march option for 32 bit code. Therefore armv8a can not be used to imply aarch64. For example: - IT predication instruction with more than a single controlled 16 bit instruction, or an instruction that modifies PC is deprecated. All old uses of IT work by default, but a control bit enables the OS to cause a trap on use of a deprecated use. - new A32 and T32 Load Acquire/Store Release instructions - new A32 and T32 scalar FP instructions including conditional select, min, max, new rounding modes for FP to int conversion, conversion between half precision and double precision - new A32 and T32 vector forms of the above FP operations - new A32 and T32 cryptographic instructions - changes to barrier instructions Users can reasonably expect -march=armv8a for 32 bit code to potentially generate the new FP instructions and restrict the use of the IT instruction. On Thu, May 5, 2016 at 1:11 PM, Jojo Ma via llvm-dev <llvm-dev at lists.llvm.org<mailto:llvm-dev at lists.llvm.org>> wrote: Hi everyone, I'm a member engineer of linaro's llvm team,coming from Spreadtrum.I am a new person on LLVM.Now I'm writing a Target Parser for AArch64,so options parsing of AArch64 about cpu & arch & fpu can be summary to one place. In the TargetParser,we assume "aarch64" and "arm64" are synonyms of armv8a(as they are only for armv8a,people usually do this). So after using AArch64TargetParser in options parsing in Clang,using "-march=aarch64" and "-march=arm64" are both valid. I saw Kevin has a different view on this in his submission:r213353. +// RUN: %clang -target aarch64 -march=arm64 -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-ARCH-NOT-ACCEPT %s +// RUN: %clang -target aarch64 -march=aarch64 -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-ARCH-NOT-ACCEPT %s +// CHECK-ARCH-NOT-ACCEPT: error: the clang compiler does not support So I failed on the regression testing.So I think we should reach a consensus on this issue. Would you mind letting me know what you think of this issuse? Thank you very much!Looking forward to your reply! I enclose the attachments for your reference. Best Regards, Jojo.ma<http://Jojo.ma> _______________________________________________ LLVM Developers mailing list llvm-dev at lists.llvm.org<mailto:llvm-dev at lists.llvm.org> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you. -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20160518/0b0e5c74/attachment-0001.html>
Renato Golin via llvm-dev
2016-May-18 12:31 UTC
[llvm-dev] LLVM issuse:AArch64 TargetParser
On 18 May 2016 at 13:21, James Molloy via llvm-dev <llvm-dev at lists.llvm.org> wrote:> Hi, > > A64 versus A32/T32 code generation is controlled by the -target option which > I don’t believe is under discussion here.Indeed, that is the case. The -target option picks the back-end, and -march chooses the support level, same as GCC. Just to be clear: "-target armv8" implies AArch32, so you can't use "-march=aarch64" with it. "-target aarch64" is strictly AArch64, so you can't use "-march=armv7" or lower with it. However, the first case above is an *aberration* and the recommended usage is: "-target arm -march=armv8a" which will select the "ARMv8A AArch32 ARM instruction set". "-target aarch64 -march=armv8a" which will select the "ARMv8A AArch64 instruction set". Also, please do *not* use: "-target thumb -march=armv8a", even though it works today in LLVM, it's another aberration. Instead, use: "-target arm -march=armv8a -mthumb". This will correctly choose the "ARMv8A AArch32 Thumb2 instruction set". cheers, --renato
Bruce Hoult via llvm-dev
2016-May-18 12:46 UTC
[llvm-dev] LLVM issuse:AArch64 TargetParser
Thanks! Just for completeness, if you want to force T16, should you use "-target arm -march=armv6 -mthumb -mfloat-abi=soft" Or is there a better way? (the last option needed because T16 has no access to FP registers, so you'd better either not be using FP arguments/results at all or else compile everything else you link to with softfp as well) On Wed, May 18, 2016 at 3:31 PM, Renato Golin <renato.golin at linaro.org> wrote:> On 18 May 2016 at 13:21, James Molloy via llvm-dev > <llvm-dev at lists.llvm.org> wrote: > > Hi, > > > > A64 versus A32/T32 code generation is controlled by the -target option > which > > I don’t believe is under discussion here. > > Indeed, that is the case. The -target option picks the back-end, and > -march chooses the support level, same as GCC. > > Just to be clear: > > "-target armv8" implies AArch32, so you can't use "-march=aarch64" with > it. > "-target aarch64" is strictly AArch64, so you can't use > "-march=armv7" or lower with it. > > However, the first case above is an *aberration* and the recommended usage > is: > > "-target arm -march=armv8a" which will select the "ARMv8A AArch32 > ARM instruction set". > "-target aarch64 -march=armv8a" which will select the "ARMv8A > AArch64 instruction set". > > Also, please do *not* use: > > "-target thumb -march=armv8a", even though it works today in LLVM, > it's another aberration. > > Instead, use: > > "-target arm -march=armv8a -mthumb". This will correctly choose the > "ARMv8A AArch32 Thumb2 instruction set". > > cheers, > --renato > > -- > This message has been scanned for viruses and > dangerous content by MailScanner, and is > believed to be clean. > >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20160518/fc930380/attachment.html>