summaryrefslogtreecommitdiff
path: root/clang/test/Driver/ppc-features.cpp
AgeCommit message (Collapse)Author
2023-08-01[Driver] -###: exit with code 1 if hasErrorOccurredFangrui Song
The exit code for -### is inconsistent. Unrecognized options lead to exit code 1, as expected. However, most others errors (including invalid option value) lead to exit code 0, differing from GCC and most utilities. This is a longstanding quirk of -###, and we didn't fix it because many driver tests need adjustment. Change -### to be similar to -fdriver-only -v and exit with code 1. This requires fixing many driver tests, but the end result gives us stronger tests. * Existing `RUN: %clang -### ...` tests usually don't use `CHECK-NOT: error:` or `--implicit-check-not=error:`. If a change introduces an error, such a change usually cannot be detected. * Many folks contributing new tests don't know `-fdriver-only -v`. To test no driver error/warning for new tests, they can use the familiar `-### -Werror` instead of `-fdriver-only -v -Werror`. An incomplete list of prerequisite test improvement: * 2f79bb10461d114783a1548201928549ace09755: add -nogpulib to some AMDGPU tests * 9155e517e6e1cda474d0d0fa82f71696c325bc10: add --cuda-path= (test w/ and w/o /usr/local/cuda) * 80765ede5bbcca1364c2d4ae06127011eaba6389: -mcpu=native may return either 0 or 1, depending on whether `--target=` specifies a native target * abae53f43f0d1da8d8e421f4a628d7ec64d6e365: fix -fuse-ld=lld misuses (test w/o and w/o /usr/local/bin/ld.lld) * ab68df505e5bb8808ee44f53044b50ca7575098e: add -resource-dir= and -fvisibility=hidden to some -fsanitize=cfi tests * d5ca1602f64114f612ad5630f04e4aa90591c78d: --rtlib=platform without --unwindlib= may fail if CLANG_DEFAULT_UNWINDLIB=unwindlib Reviewed By: jhuber6, yaxunl, dblaikie Differential Revision: https://reviews.llvm.org/D156363
2023-07-30Revert D156363 "[Driver] -###: exit with code 1 if hasErrorOccurred"Fangrui Song
This reverts commit 8c3550b1a78fde7bf28f420da8447d9fde37017f. clang/test/Driver/fsanitize.c has a mysterious failure worth investigation.
2023-07-29[Driver] -###: exit with code 1 if hasErrorOccurredFangrui Song
The exit code for -### is inconsistent. Unrecognized options lead to exit code 1, as expected. However, most others errors (including invalid option value) lead to exit code 0, differing from GCC and most utilities. This is a longstanding quirk of -###, and we didn't fix it because many driver tests need adjustment. Change -### to be similar to -fdriver-only -v and exit with code 1. This requires fixing many driver tests, but the end result gives us stronger tests. * Existing `RUN: %clang -### ...` tests usually don't use `CHECK-NOT: error:` or `--implicit-check-not=error:`. If a change introduces an error, such a change usually cannot be detected. * Many folks contributing new tests don't know `-fdriver-only -v`. To test no driver error/warning for new tests, they can use the familiar `-### -Werror` instead of `-fdriver-only -v -Werror`. An incomplete list of prerequisite test improvement: * 2f79bb10461d114783a1548201928549ace09755: add -nogpulib to some AMDGPU tests * 9155e517e6e1cda474d0d0fa82f71696c325bc10: add --cuda-path= (test w/ and w/o /usr/local/cuda) * 80765ede5bbcca1364c2d4ae06127011eaba6389: -mcpu=native may return either 0 or 1, depending on whether `--target=` specifies a native target * abae53f43f0d1da8d8e421f4a628d7ec64d6e365: fix -fuse-ld=lld misuses (test w/o and w/o /usr/local/bin/ld.lld) Reviewed By: jhuber6, yaxunl, dblaikie Differential Revision: https://reviews.llvm.org/D156363
2023-07-28Revert D156363 "[Driver] -###: exit with code 1 if hasErrorOccurred"Fangrui Song
This reverts commit e39bf32b3bc2f0cc21d783ba789bd82553493875. Some tests have different behaviors depent on whether certain directories/files are present on the host. An incomplete list from https://lab.llvm.org/buildbot/#/builders/109/builds/70149 csky-toolchain.c riscv*-toolchain.c fuchsia.* hip-* ohos.c
2023-07-28[Driver] -###: exit with code 1 if hasErrorOccurredFangrui Song
The exit code for -### is inconsistent. Unrecognized options lead to exit code 1, as expected. However, most others errors (including invalid option value) lead to exit code 0, differing from GCC and most utilities. This is a longstanding quirk of -###, and we didn't fix it because many driver tests need adjustment. Change -### to be similar to -fdriver-only -v and exit with code 1. This requires fixing many driver tests, but the end result gives us stronger tests. * Existing `RUN: %clang -### ...` tests usually don't use `CHECK-NOT: error:` or `--implicit-check-not=error:`. If a change introduces an error, such a change usually cannot be detected. * Many folks contributing new tests don't know `-fdriver-only -v`. To test no driver error/warning for new tests, they can use the familiar `-### -Werror` instead of `-fdriver-only -v -Werror`. Reviewed By: jhuber6, yaxunl, dblaikie Differential Revision: https://reviews.llvm.org/D156363
2021-09-23Fix -fno-unwind-tables -fasynchronous-unwind-tables to emit unwind tablesFangrui Song
This matches GCC. Change the CC1 option to encode the unwind table level (1: needed by exceptions, 2: asynchronous) so that we can support two modes in the future.
2021-01-12[PowerPC] Add support for embedded devices with EFPU2Nemanja Ivanovic
PowerPC cores like e200z759n3 [1] using an efpu2 only support single precision hardware floating point instructions. The single precision instructions efs* and evfs* are identical to the spe float instructions while efd* and evfd* instructions trigger a not implemented exception. This patch introduces a new command line option -mefpu2 which leads to single-hardware / double-software code generation. [1] Core reference: https://www.nxp.com/files-static/32bit/doc/ref_manual/e200z759CRM.pdf Differential revision: https://reviews.llvm.org/D92935
2021-01-11clang: Always pass PowerPC endian information to GNU asNathan Chancellor
When building a 64-bit big endian PowerPC Linux kernel with a 64-bit little endian PowerPC target, the 32-bit vDSO errors: ``` $ make ARCH=powerpc CC=clang CROSS_COMPILE=powerpc64le-linux-gnu- \ pseries_defconfig arch/powerpc/kernel/vdso32/ ld.lld: error: arch/powerpc/kernel/vdso32/sigtramp.o is incompatible with elf32-powerpc ld.lld: error: arch/powerpc/kernel/vdso32/gettimeofday.o is incompatible with elf32-powerpc ld.lld: error: arch/powerpc/kernel/vdso32/datapage.o is incompatible with elf32-powerpc ld.lld: error: arch/powerpc/kernel/vdso32/cacheflush.o is incompatible with elf32-powerpc ld.lld: error: arch/powerpc/kernel/vdso32/note.o is incompatible with elf32-powerpc ld.lld: error: arch/powerpc/kernel/vdso32/getcpu.o is incompatible with elf32-powerpc ld.lld: error: arch/powerpc/kernel/vdso32/vgettimeofday.o is incompatible with elf32-powerpc ... ``` This happens because the endian information is missing from the call to the assembler, even though it was explicitly passed to clang. See the below example. ``` $ echo | clang --target=powerpc64le-linux-gnu \ --prefix=/usr/bin/powerpc64le-linux-gnu- \ -no-integrated-as -m32 -mbig-endian -### -x c -c - ".../clang-12" "-cc1" "-triple" "powerpc-unknown-linux-gnu" ... ... "/usr/bin/powerpc64le-linux-gnu-as" "-a32" "-mppc" "-many" "-o" "-.o" "/tmp/--e69e28.s" ``` clang sets the right target with -m32 and -mbig-endian but -mbig-endian does not make it to the assembler, resulting in a 32-bit little endian binary. This differs from the little endian targets, which always pass -mlittle-endian. ``` $ echo | clang --target=powerpc64-linux-gnu \ --prefix=/usr/bin/powerpc64-linux-gnu- \ -no-integrated-as -m32 -mlittle-endian -### -x c -c - ".../clang-12" "-cc1" "-triple" "powerpcle-unknown-linux-gnu" ... ... "/usr/bin/powerpc64-linux-gnu-as" "-a32" "-mppc" "-mlittle-endian" "-many" "-o" "-.o" "/tmp/--405dbd.s" ``` Do the same thing for the big endian targets so that there is no more error. This matches GCC's behavior, where -mbig and -mlittle are always passed along to GNU as. ``` $ echo | powerpc64-linux-gcc -### -x c -c - ... .../powerpc64-linux/bin/as -a64 -mpower4 -many -mbig -o -.o /tmp/ccVn7NAm.s ... $ echo | powerpc64le-linux-gcc -### -x c -c - ... .../powerpc64le-linux/bin/as -a64 -mpower8 -many -mlittle -o -.o /tmp/ccPN9ato.s ... ``` Reviewed By: nickdesaulniers, MaskRay Differential Revision: https://reviews.llvm.org/D94442
2021-01-02[PowerPC] Enable OpenMP for powerpcle target. [5/5]Brandon Bergren
Enable OpenMP for powerpcle to match the rest of powerpc*. Update tests. Reviewed By: MaskRay Differential Revision: https://reviews.llvm.org/D92445
2021-01-02[PowerPC] Support powerpcle target in Clang [3/5]Brandon Bergren
Add powerpcle support to clang. For FreeBSD, assume a freestanding environment for now, as we only need it in the first place to build loader, which runs in the OpenFirmware environment instead of the FreeBSD environment. For Linux, recognize glibc and musl environments to match current usage in Void Linux PPC. Adjust driver to match current binutils behavior regarding machine naming. Adjust and expand tests. Reviewed By: MaskRay Differential Revision: https://reviews.llvm.org/D93919
2020-12-21[Driver] Default Generic_GCC ppc/ppc64/ppc64le to -fasynchronous-unwind-tablesFangrui Song
GCC made the switch on 2018-04-10 ("rs6000: Enable -fasynchronous-unwind-tables by default"). In Clang, FreeBSD/NetBSD powerpc have already defaulted to -fasynchronous-unwind-tables. This patch defaults Generic_GCC powerpc (which affects Linux) to use -fasynchronous-unwind-tables. Reviewed By: #powerpc, nemanjai Differential Revision: https://reviews.llvm.org/D92054
2020-12-07[PowerPC][Clang] Remove QPX supportJinsong Ji
Clean up QPX code in clang missed in https://reviews.llvm.org/D83915 Reviewed By: #powerpc, steven.zhang Differential Revision: https://reviews.llvm.org/D92329
2020-11-24[test] Clean up ppc-features.cpp and improve testsFangrui Song
And add ppc-cpus.cpp for -mcpu= specific tests.
2020-06-16[PowerPC] Add -m[no-]power10-vector clang and llvm optionAhsan Saghir
Summary: This patch adds command line option for enabling power10-vector support. Reviewers: hfinkel, nemanjai, lei, amyk, #powerpc Reviewed By: lei, amyk, #powerpc Subscribers: wuzish, kbarton, hiraditya, shchenz, cfe-commits, llvm-commits Tags: #llvm, #clang, #powerpc Differential Revision: https://reviews.llvm.org/D80758
2020-01-10[Driver][PowerPC] Move powerpcspe logic from cc1 to DriverFangrui Song
Follow-up of D72014. It is more appropriate to use a target feature instead of a SubTypeArch to express the difference. Reviewed By: #powerpc, jhibbits Differential Revision: https://reviews.llvm.org/D72433
2019-09-05Add -m(no)-spe to clangJustin Hibbits
Summary: r337347 added support for the Signal Processing Engine (SPE) to LLVM. This follows that up with the clang side. This adds -mspe and -mno-spe, to match GCC. Subscribers: nemanjai, kbarton, cfe-commits Differential Revision: https://reviews.llvm.org/D49754 llvm-svn: 371066
2018-04-11[PowerPC] Option for secure plt modeStrahinja Petrovic
This patch enables option for secure plt mode in clang (-msecure-plt). Differential Revision: https://reviews.llvm.org/D44921 llvm-svn: 329795
2017-07-27[PowerPC] Pass CPU to assembler with -no-integrated-asNemanja Ivanovic
This just adds the CPU to a list of commands passed to GAS when not using the integrated assembler. Differential Revision: https://reviews.llvm.org/D33820 llvm-svn: 309256
2017-03-21Remove the -faltivec alias option and replace it with -maltivec everywhere.Eric Christopher
The alias was only ever used on darwin and had some issues there, and isn't used in practice much. Also fixes a problem with -mno-altivec not turning off -maltivec. Also add a diagnostic for faltivec/fno-altivec that directs users to use maltivec options and include the altivec.h file explicitly. llvm-svn: 298449
2017-03-20Turn on HTM on power8 and later (including powerpc64le) since it'sEric Christopher
available by default on those cpus and configurations. llvm-svn: 298307
2016-10-02[PowerPC] Enable soft-float for PPC64, and +soft-float -> -hard-floatHal Finkel
Enable soft-float support on PPC64, as the backend now supports it. Also, the backend now uses -hard-float instead of +soft-float, so set the target features accordingly. Fixes PR26970. llvm-svn: 283061
2016-08-30[PowerPC] Add support for -mlongcallHal Finkel
Add support for GCC's PowerPC -mlongcall option; the backend supports the corresponding target feature as of r280040. Fixes PR19098. llvm-svn: 280041
2015-12-14[PowerPC] Fix make-check issuesPetar Jovanovic
Previous change r255515 introduced a couple of issues likely caused by a different configure setup. llvm-svn: 255533
2015-12-14[Power PC] add soft float support for ppc32Petar Jovanovic
This patch enables soft float support for ppc32 architecture and fixes the ABI for variadic functions. This is the first in a set of patches for soft float support in LLVM. Patch by Strahinja Petrovic. Differential Revision: http://reviews.llvm.org/D13351 llvm-svn: 255515
2015-07-13[OpenMP] Add TLS-based implementation for threadprivate directive.Samuel Antao
llvm-svn: 242080
2015-04-09Added flag to disable isel instruction on PPC target. Using regular branches ↵Olivier Sallenave
instead of isel is more efficient in some cases. llvm-svn: 234509
2015-02-10[PowerPC] Remove the --no-tls-optimize workaround from the clang driverBill Schmidt
llvm-svn: 228739
2015-02-06[PowerPC] Re-disable linker optimizations for nowBill Schmidt
llvm-svn: 228402
2015-02-05[PowerPC] Revert workaround for TLS linker bugBill Schmidt
In r227480, Ulrich Weigand introduced a workaround for a linker optimization bug that can create mis-optimized code for accesses to general-dynamic or local-dynamic TLS variables. The linker optimization bug only occurred for Clang/LLVM because of some inefficient code being generated for these TLS accesses. I have recently corrected LLVM to produce the efficient code sequence expected by the linkers, so this workaround is no longer needed. Therefore this patch reverts r227480. I've tested that the previous bootstrap failure no longer occurs with the workaround reverted. llvm-svn: 228253
2015-01-29[PowerPC] Work around TLS linker bugUlrich Weigand
Work around a bug in GNU ld (and gold) linker versions up to 2.25 that may mis-optimize code generated by this version of clang/LLVM to access general-dynamic or local-dynamic TLS variables. Bug is fixed here: https://sourceware.org/ml/binutils/2015-01/msg00318.html llvm-svn: 227480
2015-01-15[PowerPC] Add a target option for invariant function descriptorsHal Finkel
The PPC backend will now assume that PPC64 ELFv1 function descriptors are invariant. This must be true for well-defined C/C++ code, but I'm providing an option to disable this assumption in case someone's JIT-engine needs it. llvm-svn: 226209
2015-01-06[PowerPC] Add support for -mcmpbHal Finkel
In r225106, support for the CMPB instruction was added to the PowerPC backend. This adds the associated GCC-compatible feature flag. llvm-svn: 225312
2014-10-10[PowerPC] Add feature for Power8 vector extensionsBill Schmidt
The current VSX feature for PowerPC specifies availability of the VSX instructions added with the 2.06 architecture version. With 2.07, the architecture adds new instructions to both the Category:Vector and Category:VSX instruction sets. Additionally, unaligned vector storage operations have improved performance. This patch adds a feature to provide access to the new instructions and performance capabilities of Power8. For compatibility with GCC, the feature is controlled via a new -mpower8-vector switch, and the feature causes the __POWER8_VECTOR__ builtin define to be generated by the preprocessor. There is a companion patch for llvm being committed at the same time. llvm-svn: 219502
2014-10-06Turn on the integrated assembler by default for ppc64 andEric Christopher
ppc64le. Reviewed by Hal Finkel and Bill Schmidt. llvm-svn: 219129
2014-06-26Add ppc64/power8 as a targetWill Schmidt
llvm-svn: 211778
2014-03-24Update the parameters passed to the assembler and linker forWill Schmidt
the PPC64LE target. Specifically: (assembler) adds/uses -mppc64 -mlittle-endian (linker) adds/uses elf64lppc Testcase included. llvm-svn: 204626
2014-02-28Add -mcrbits/-mno-crbits to control the PowerPC CR-bit-tracking featureHal Finkel
The backend currently enables CR-bit tracking by default at -O2 and higher. These flags allow the user to override that default. llvm-svn: 202453
2013-10-16Add minimal command line support for the VSX powerpc processor.Eric Christopher
Preprocessor support is still needed. llvm-svn: 192839
2013-10-16Rework ppc options handling into a features group.Eric Christopher
This should have no functional behavior. llvm-svn: 192838
2013-07-26[PowerPC] Support powerpc64le as a syntax-checking target.Bill Schmidt
This patch provides basic support for powerpc64le as an LLVM target. However, use of this target will not actually generate little-endian code. Instead, use of the target will cause the correct little-endian built-in defines to be generated, so that code that tests for __LITTLE_ENDIAN__, for example, will be correctly parsed for syntax-only testing. Code generation will otherwise be the same as powerpc64 (big-endian), for now. The patch leaves open the possibility of creating a little-endian PowerPC64 back end, but there is no immediate intent to create such a thing. The new test case variant ensures that correct built-in defines for little-endian code are generated. llvm-svn: 187180
2013-07-04Add 'not' to commands that are expected to fail.Rafael Espindola
This is at least good documentation, but also opens the possibility of using pipefail. llvm-svn: 185652
2013-03-30Add support for gcc-compatible -mfprnd -mno-fprnd PPC optionsHal Finkel
gcc provides -mfprnd and -mno-fprnd for controlling the fprnd target feature; support these options as well. llvm-svn: 178414
2013-03-28Add support for gcc-compatible -mpopcntd -mno-popcntd PPC optionsHal Finkel
gcc provides -mpopcntd and -mno-popcntd for controlling the popcntd target feature; support these options as well. llvm-svn: 178235
2013-03-28Add support for gcc-compatible -mmfcrf -mno-mfcrf PPC optionsHal Finkel
gcc provides -mmfcrf and -mno-mfcrf for controlling what we call the mfocrf target feature. Also, PPC is now making use of the static function AddTargetFeature used by the Mips Driver code. llvm-svn: 178227
2013-02-01Add -mqpx and -mno-qpx feature flags to toggle use of the PPC QPX vector ↵Hal Finkel
instruction set I've renamed the altivec test to ppc-features (because now there is more than one feature to test). llvm-svn: 174204