summaryrefslogtreecommitdiffstats
path: root/clang/utils/TableGen/NeonEmitter.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Recommit ARM-NEON: make type modifiers orthogonal and allow multiple modifiers.Tim Northover2019-11-261-288/+164
| | | | | | | | | | | | | | | | | | The modifier system used to mutate types on NEON intrinsic definitions had a separate letter for all kinds of transformations that might be needed, and we were quite quickly running out of letters to use. This patch converts to a much smaller set of orthogonal modifiers that can be applied together to achieve the desired effect. When merging with downstream it is likely to cause a conflict with any local modifications to the .td files. There is a new script in utils/convert_arm_neon.py that was used to convert all .td definitions and I would suggest running it on the last downstream version of those files before this commit rather than resolving conflicts manually. The original version broke vcreate_* because it became a macro and didn't apply the normal integer promotion rules before bitcasting to a vector. This adds a temporary.
* Revert 3f91705ca54 "ARM-NEON: make type modifiers orthogonal and allow ↵Hans Wennborg2019-11-251-164/+288
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | multiple modifiers." This broke the vcreate_u64 intrinsic. Example: $ cat /tmp/a.cc #include <arm_neon.h> void g() { auto v = vcreate_u64(0); } $ bin/clang -c /tmp/a.cc --target=arm-linux-androideabi16 -march=armv7-a /tmp/a.cc:4:12: error: C-style cast from scalar 'int' to vector 'uint64x1_t' (vector of 1 'uint64_t' value) of different size auto v = vcreate_u64(0); ^~~~~~~~~~~~~~ /work/llvm.monorepo/build.release/lib/clang/10.0.0/include/arm_neon.h:4144:11: note: expanded from macro 'vcreate_u64' __ret = (uint64x1_t)(__p0); \ ^~~~~~~~~~~~~~~~~~ Reverting until this can be investigated. > The modifier system used to mutate types on NEON intrinsic definitions had a > separate letter for all kinds of transformations that might be needed, and we > were quite quickly running out of letters to use. This patch converts to a much > smaller set of orthogonal modifiers that can be applied together to achieve the > desired effect. > > When merging with downstream it is likely to cause a conflict with any local > modifications to the .td files. There is a new script in > utils/convert_arm_neon.py that was used to convert all .td definitions and I > would suggest running it on the last downstream version of those files before > this commit rather than resolving conflicts manually.
* ARM-NEON: make type modifiers orthogonal and allow multiple modifiers.Tim Northover2019-11-201-288/+164
| | | | | | | | | | | | | | The modifier system used to mutate types on NEON intrinsic definitions had a separate letter for all kinds of transformations that might be needed, and we were quite quickly running out of letters to use. This patch converts to a much smaller set of orthogonal modifiers that can be applied together to achieve the desired effect. When merging with downstream it is likely to cause a conflict with any local modifications to the .td files. There is a new script in utils/convert_arm_neon.py that was used to convert all .td definitions and I would suggest running it on the last downstream version of those files before this commit rather than resolving conflicts manually.
* NeonEmitter: remove special case on casting polymorphic builtins.Tim Northover2019-11-201-5/+2
| | | | | | | For some reason we were not casting a fairly obscure class of builtin calls we expected to be polymorphic to vectors of char. It worked because the only affected intrinsics weren't actually polymorphic after all, but is unnecessarily complicated.
* NeonEmitter: remove special 'a' type modifier.Tim Northover2019-11-061-47/+1
| | | | | | | | 'a' used to implement a splat in C++ code in NeonEmitter.cpp, but this can be done directly from .td expansions now (and most ops already did). So removing it simplifies the overall code. https://reviews.llvm.org/D69716
* NeonEmitter: switch to enum for internal Type representation.Tim Northover2019-11-061-101/+90
| | | | | | | | | Previously we had a handful of bools (Signed, Floating, ...) that could easily end up in an inconsistent state. This adds an enum Kind which holds the mutually exclusive states a type might be in, retaining some of the bools that modified an underlying type. https://reviews.llvm.org/D69715
* [ARM] Fix arm_neon.h with -flax-vector-conversions=none, part 3Eli Friedman2019-10-171-1/+2
| | | | | | | | | | | | | | It's completely impossible to check that I've actually found all the issues, due to the use of macros in arm_neon.h, but hopefully this time it'll take more than a few hours for someone to find another issue. I have no idea why, but apparently there's a rule that some, but not all, builtins which should take an fp16 vector actually take an int8 vector as an argument. Fix this, and add test coverage. Differential Revision: https://reviews.llvm.org/D68838 llvm-svn: 375179
* [ARM] Fix arm_neon.h with -flax-vector-conversions=none, part 2.Eli Friedman2019-10-101-1/+4
| | | | | | | | | | | | | | | | | | | | | Just running -fsyntax-only over arm_neon.h doesn't cover some intrinsics which are defined using macros. Add more test coverage for that. arm-neon-header.c wasn't checking the full set of available NEON target features; change the target architecture of the test to account for that. Fix the generator for arm_neon.h to generate casts in more cases where they are necessary. Fix VFMLAL_LOW etc. to express their signatures differently, so the builtins have the expected type. Maybe the TableGen backend should detect intrinsics that are defined the wrong way, and produce an error. The rules here are sort of strange. Differential Revision: https://reviews.llvm.org/D68743 llvm-svn: 374419
* [ARM] Fix arm_neon.h with -flax-vector-conversions=noneEli Friedman2019-10-091-2/+2
| | | | | | | | | | | | | | Really, we were already 99% of the way there; just needed a couple minor fixes that affected 64-bit-only builtins. Based on D61717. Note that the change to builtin_str changes the type of a few __builtin_neon_* intrinsics that had the "wrong" type. Fixes https://bugs.llvm.org/show_bug.cgi?id=43341 Differential Revision: https://reviews.llvm.org/D68683 llvm-svn: 374191
* Use scope qualifiers in Clang's tblgen backends to get usefulJohn McCall2019-10-011-8/+5
| | | | | | redeclaration checking. NFC. llvm-svn: 373406
* [ARM NEON] Avoid duplicated decarationsDiogo N. Sampaio2019-09-031-3/+22
| | | | | | | | | | | | | | | | | | | | | | Summary: The declaration of arm neon intrinsics that are "big endian safe" print the same code for big and small endian targets. This patch avoids duplicates by checking if an intrinsic is safe to have a single definition. (decreases header 11k lines out of 73k). Reviewers: t.p.northover, ostannard, labrinea Reviewed By: ostannard Subscribers: kristof.beyls, cfe-commits, olista01 Tags: #clang Differential Revision: https://reviews.llvm.org/D66588 llvm-svn: 370716
* Retire llvm::less_ptr. llvm::deref is much more flexible.Benjamin Kramer2019-08-221-2/+2
| | | | llvm-svn: 369675
* [Clang] Migrate llvm::make_unique to std::make_uniqueJonas Devlieghere2019-08-141-4/+4
| | | | | | | | | | Now that we've moved to C++14, we no longer need the llvm::make_unique implementation from STLExtras.h. This patch is a mechanical replacement of (hopefully) all the llvm::make_unique instances across the monorepo. Differential revision: https://reviews.llvm.org/D66259 llvm-svn: 368942
* Use llvm::stable_sortFangrui Song2019-04-241-6/+2
| | | | llvm-svn: 359098
* Use llvm::is_contained. NFCFangrui Song2019-02-101-2/+2
| | | | llvm-svn: 353635
* Update the file headers across all of the LLVM projects in the monorepoChandler Carruth2019-01-191-4/+3
| | | | | | | | | | | | | | | | | to reflect the new license. We understand that people may be surprised that we're moving the header entirely to discuss the new license. We checked this carefully with the Foundation's lawyer and we believe this is the correct approach. Essentially, all code in the project is now made available by the LLVM project under our new license, so you will see that the license headers include that license only. Some of our contributors have contributed code under our old license, and accordingly, we have retained a copy of our old license notice in the top-level files in each project and repository. llvm-svn: 351636
* [AArch64] Implement FP16FML intrinsicsBryan Chan2018-10-251-0/+37
| | | | | | | | | | | | | Generate the FP16FML intrinsics into arm_neon.h (AArch64 only for now). Add two new type modifiers to NeonEmitter to handle the new prototypes. Define __ARM_FEATURE_FP16FML when +fp16fml is enabled and guard the intrinsics with the macro in arm_neon.h. Based on a patch by Gao Yiling. Differential Revision: https://reviews.llvm.org/D53633 llvm-svn: 345344
* llvm::sort(C.begin(), C.end(), ...) -> llvm::sort(C, ...)Fangrui Song2018-09-261-1/+1
| | | | | | | | | | | | | | Summary: The convenience wrapper in STLExtras is available since rL342102. Reviewers: rsmith, #clang, dblaikie Reviewed By: rsmith, #clang Subscribers: mgrang, arphaman, kadircet, cfe-commits Differential Revision: https://reviews.llvm.org/D52576 llvm-svn: 343147
* Replaces __inline by __inline__ / C89 compatibleDiogo N. Sampaio2018-09-071-2/+2
| | | | llvm-svn: 341644
* Fix arm_neon.h and arm_fp16.h generation for compiling with std=c89Diogo N. Sampaio2018-09-051-2/+2
| | | | | | | | | | | | | | | | | Summary: The inline attribute is not valid for C standard 89. Replace the argument in the generation of header files with __inline, as well adding tests for both header files. Reviewers: pbarrio, SjoerdMeijer, javed.absar, t.p.northover Subscribers: t.p.northover, kristof.beyls, chrib, cfe-commits Differential Revision: https://reviews.llvm.org/D51683 test/Headers/arm-fp16-header.c test/Headers/arm-neon-header.c utils/TableGen/NeonEmitter.cpp llvm-svn: 341475
* [AArch64] Corrected FP16 Intrinsic range checks in Clang + added Sema testsLuke Geeson2018-06-121-5/+8
| | | | | | | | | | | | | | | | | | Summary: This fixes the ranges for the vcvth family of FP16 intrinsics in the clang front end. Previously it was accepting incorrect ranges -Changed builtin range checking in SemaChecking -added tests SemaCheck changes - included in their own file since no similar one exists -modified existing tests to reflect new ranges Reviewers: SjoerdMeijer, javed.absar Reviewed By: SjoerdMeijer Subscribers: kristof.beyls, cfe-commits Differential Revision: https://reviews.llvm.org/D47592 llvm-svn: 334489
* [ARM,AArch64] Add intrinsics for dot product instructionsOliver Stannard2018-04-271-0/+13
| | | | | | | | | | The ACLE spec which describes these intrinsics hasn't been published yet, but this is based on the final draft which will be published soon, and these have already been implemented by GCC. Differential revision: https://reviews.llvm.org/D46109 llvm-svn: 331039
* Fix typos in clangAlexander Kornienko2018-04-061-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Found via codespell -q 3 -I ../clang-whitelist.txt Where whitelist consists of: archtype cas classs checkk compres definit frome iff inteval ith lod methode nd optin ot pres statics te thru Patch by luzpaz! (This is a subset of D44188 that applies cleanly with a few files that have dubious fixes reverted.) Differential revision: https://reviews.llvm.org/D44188 llvm-svn: 329399
* [clang] Change std::sort to llvm::sort in response to r327219Mandeep Singh Grang2018-03-271-1/+1
| | | | | | | | | | | r327219 added wrappers to std::sort which randomly shuffle the container before sorting. This will help in uncovering non-determinism caused due to undefined sorting order of objects having the same key. To make use of that infrastructure we need to invoke llvm::sort instead of std::sort. llvm-svn: 328636
* Mark fallthrough with LLVM_FALLTHROUGHAdrian Prantl2018-02-011-1/+1
| | | | llvm-svn: 323986
* [AArch64] Add ARMv8.2-A FP16 scalar intrinsicsAbderrazek Zaafrani2018-01-191-1/+147
| | | | | | https://reviews.llvm.org/D41792 llvm-svn: 323006
* Avoid int to string conversion in Twine or raw_ostream contexts.Benjamin Kramer2017-12-281-3/+3
| | | | | | Some output changes from uppercase hex to lowercase hex, no other functionality change intended. llvm-svn: 321526
* [AARch64] Add ARMv8.2-A FP16 vector intrinsicsAbderrazek Zaafrani2017-12-211-1/+5
| | | | | | | | Putting back the code that was reverted few weeks ago. Differential Revision: https://reviews.llvm.org/D34161 llvm-svn: 321294
* Silence a bunch of implicit fallthrough warningsAdrian Prantl2017-12-191-3/+3
| | | | llvm-svn: 321115
* This reverts r305820 (ARMv.2-A FP16 vector intrinsics) because it showsSjoerd Meijer2017-07-061-5/+1
| | | | | | | | problems in testing, see comments in D34161 for some more details. A fix is in progres in D35011, but a revert seems better now as the fix will probably take some more time to land. llvm-svn: 307277
* [AArch64] ADD ARMv.2-A FP16 vector intrinsicsAbderrazek Zaafrani2017-06-201-1/+5
| | | | | | Differential Revision: https://reviews.llvm.org/D34161 llvm-svn: 305820
* Revert "[AArch64] Add ARMv8.2-A FP16 vefctor intrinsics"Vedant Kumar2017-06-021-5/+1
| | | | | | | | | | | | This reverts commit r304493. It breaks all the Darwin bots: http://green.lab.llvm.org/green/job/clang-stage1-cmake-RA-incremental_check/37168 Failure: Failing Tests (2): Clang :: CodeGen/aarch64-v8.2a-neon-intrinsics.c Clang :: CodeGen/arm_neon_intrinsics.c llvm-svn: 304509
* [AArch64] Add ARMv8.2-A FP16 vefctor intrinsicsAbderrazek Zaafrani2017-06-011-1/+5
| | | | llvm-svn: 304493
* Adapt to llvm/TableGen DagInit changes.Matthias Braun2016-12-051-15/+20
| | | | llvm-svn: 288645
* Fix some Clang-tidy and Include What You Use warnings; other minor fixes (NFC).Eugene Zelenko2016-11-291-19/+44
| | | | | | This preparation to remove SetVector.h dependency on SmallSet.h. llvm-svn: 288213
* [NFC] Header cleanupMehdi Amini2016-07-181-2/+0
| | | | | | | | | | Summary: Removed unused headers, replaced some headers with forward class declarations Patch by: Eugene <claprix@yandex.ru> Differential Revision: https://reviews.llvm.org/D20100 llvm-svn: 275882
* Apply clang-tidy's misc-move-constructor-init throughout Clang.Benjamin Kramer2016-05-271-4/+6
| | | | | | No functionality change intended, maybe a tiny performance improvement. llvm-svn: 270996
* No need to use utostr when putting integers into a raw_ostream. NFCCraig Topper2016-01-311-5/+5
| | | | llvm-svn: 259310
* [TableGen] Merge the SuperClass Record and SMRange vector a single vector. ↵Craig Topper2016-01-181-1/+1
| | | | | | This removes the state needed to manage the extract vector. NFC llvm-svn: 258066
* [ARM NEON] Remove special-case for f16 vcvt handling. NFCI.Ahmed Bougacha2015-08-221-4/+0
| | | | | | | | We can use the 'H' typespec modifier to use 128-bit vectors directly in the only two users of this special-case: the vcvt f16 intrinsics. This also lets us use more meaningful prototype modifiers. llvm-svn: 245778
* [ARM NEON] Use the common naming scheme for vcvt f16 builtins. NFC.Ahmed Bougacha2015-08-211-2/+2
| | | | | | | | | | | We had "vcvt_f16" and "VCVT_HIGH_F16": for other FP types, this naming is used for intrinsics with integer overloads. The FP->FP conversions, on the other hand, use the full "vcvt_f32_f64" name instead. Use the same naming convention for the f16<->f32 conversions. While there, reorder the definitions a little bit. llvm-svn: 245763
* [ARM NEON] Factor out FP-prototype checking. NFC.Ahmed Bougacha2015-08-211-5/+9
| | | | llvm-svn: 245761
* Fix memory ownership in the NeonEmitter by using values instead of pointers ↵David Blaikie2015-08-061-37/+30
| | | | | | | | | | | | | (smart or otherwise) Improvement to the memory leak fix in 244196. Address validity is required for the Intrinsic objects, but since the collections only ever grow (no elements are removed), deque provides sufficient guarantees (that the objects will never be reallocated/moved around) for this use case. llvm-svn: 244241
* Plug a memory leak in NeonEmitter: Intrinsics allocated were never released.Yaron Keren2015-08-061-0/+6
| | | | llvm-svn: 244196
* Revert r240270 ("Fixed/added namespace ending comments using clang-tidy").Alexander Kornienko2015-06-221-1/+1
| | | | llvm-svn: 240353
* Fixed/added namespace ending comments using clang-tidy. NFCAlexander Kornienko2015-06-221-1/+1
| | | | | | | | | | | | The patch is generated using this command: $ tools/extra/clang-tidy/tool/run-clang-tidy.py -fix \ -checks=-*,llvm-namespace-comment -header-filter='llvm/.*|clang/.*' \ work/llvm/tools/clang To reduce churn, not touching namespaces spanning less than 10 lines. llvm-svn: 240270
* [CodeGen][NEON] Emit constants for "immediate" intrinsic arguments.Ahmed Bougacha2015-06-041-8/+24
| | | | | | | | | | | | | | | | | On ARM/AArch64, we currently always use EmitScalarExpr for the immediate builtin arguments, instead of directly emitting the constant. When the overflow sanitizer is enabled, this generates overflow intrinsics instead of constants, breaking assumptions in various places. Instead, use the knowledge of "immediates" to directly emit a constant: - teach the tablegen backend to emit the "immediate" modifiers - use those modifiers in the NEON CodeGen, on ARM and AArch64. Fixes PR23517. Differential Revision: http://reviews.llvm.org/D10045 llvm-svn: 239002
* Replace push_back(Constructor(foo)) with emplace_back(foo) for non-trivial typesBenjamin Kramer2015-05-291-2/+2
| | | | | | | | | | | | | | | | | | | | If the type isn't trivially moveable emplace can skip a potentially expensive move. It also saves a couple of characters. Call sites were found with the ASTMatcher + some semi-automated cleanup. memberCallExpr( argumentCountIs(1), callee(methodDecl(hasName("push_back"))), on(hasType(recordDecl(has(namedDecl(hasName("emplace_back")))))), hasArgument(0, bindTemporaryExpr( hasType(recordDecl(hasNonTrivialDestructor())), has(constructExpr()))), unless(isInTemplateInstantiation())) No functional change intended. llvm-svn: 238601
* [TableGen] Clang changes for r235697 to stop leaking Expanders and Operators ↵Craig Topper2015-04-241-8/+7
| | | | | | in SetTheory. llvm-svn: 235698
* Remove empty non-virtual destructors or mark them =default when non-publicBenjamin Kramer2015-04-111-8/+0
| | | | | | These add no value but can make a class non-trivially copyable. NFC. llvm-svn: 234689
OpenPOWER on IntegriCloud