Commit Graph

18 Commits

Author SHA1 Message Date
Sam Parker 4603fa8943 [ARM] ACLE Chapter 9 intrinsics
Implemented the remaining integer data processing intrinsics from
the ARM ACLE v2.1 spec, such as parallel arithemtic and DSP style
multiplications.

Differential Revision: https://reviews.llvm.org/D32282


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@302131 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-04 08:37:59 +00:00
Eric Christopher 58e445a784 Update functions in clang supplied headers to use the compiler reserved
namespace for arguments.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@260647 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-12 02:22:53 +00:00
Oliver Stannard fc6a9e21d0 [ARM,AArch64] Fix __rev16l and __rev16ll intrinsics
These two intrinsics are defined in arm_acle.h.

__rev16l needs to rotate by 16 bits, bit it was actually rotating by 2 bits.
For AArch64, where long is 64 bits, this would still be wrong.

__rev16ll was incorrect, it reversed the bytes in each 32-bit word, rather than
each 16-bit halfword. The correct implementation is to apply __rev16 to the top
and bottom words of the 64-bit value.

For AArch32 targets, these get compiled down to the hardware rev16 instruction
at -O1 and above. For AArch64 targets, the 64-bit ones get compiled to two
32-bit rev16 instructions, because there is not currently a pattern for the
64-bit rev16 instruction.

Differential Revision: http://reviews.llvm.org/D14609


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@253211 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-16 14:58:50 +00:00
Luke Cheeseman 514068cf49 This patch implements clang support for the ACLE special register intrinsics
in section 10.1, __arm_{w,r}sr{,p,64}.

This includes arm_acle.h definitions with builtins and codegen to support
these, the intrinsics are implemented by generating read/write_register calls
which get appropriately lowered in the backend based on the register string
provided. SemaChecking is also implemented to fault invalid parameters.

Differential Revision: http://reviews.llvm.org/D9697



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@239737 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-15 17:51:01 +00:00
David Majnemer 1a175a2b14 Headers: Don't use attribute keywords which aren't reserved
Instead of using 'unavailable', use '__unavailable__'

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@228087 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-04 00:26:10 +00:00
Yi Kong b374ac9fef arm_acle: Fix error in ROR implementation
The logic in calculating the rotate amount was flawed.

Thanks Pasi Parviainen for pointing out!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@216669 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-28 15:25:52 +00:00
Yi Kong 0c331cfac1 arm_acle: Implement data processing intrinsics
Summary:
ACLE 2.0 section 9.2 defines the following "miscellaneous data processing intrinsics": `__clz`, `__cls`, `__ror`, `__rev`, `__rev16`, `__revsh` and `__rbit`.

`__clz` has already been implemented in the arm_acle.h header file. The rest are not supported yet. This patch completes ACLE data processing intrinsics.

Reviewers: t.p.northover, rengolin

Reviewed By: rengolin

Subscribers: aemerson, mroth, llvm-commits

Differential Revision: http://reviews.llvm.org/D4983

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@216658 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-28 09:44:07 +00:00
Yi Kong e2b32bc8dd arm_acle: Add mappings for dbg intrinsic
This completes all ACLE hint intrinsics.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@216453 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-26 12:48:11 +00:00
Yi Kong ae401c85d2 arm_acle: Implement swap intrinsic
Insert the LDREX/STREX instruction sequence specified in ARM ACLE 2.0,
as SWP instruction is deprecated since ARMv6.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@216446 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-26 09:50:54 +00:00
Yi Kong 60ea804d3d arm_acle.h: Small cleanup
Since __SIZEOF_LONG_LONG__ is always defined as 8 on ARM targets,
there's no point in checking this. NFC.

Patch by Moritz Roth.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@215697 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-15 08:53:22 +00:00
Yi Kong 56b7cd4cad ARM: Add mappings for ACLE prefetch intrinsics
Implement __pld, __pldx, __pli and __plix builtin intrinsics as specified in
ARM ACLE 2.0.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@215599 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-13 23:20:15 +00:00
Yi Kong 8aee075c00 ARM: Add ACLE memory barrier intrinsic mapping
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@213261 91177308-0d34-0410-b5e6-96231b3b80d8
2014-07-17 12:45:17 +00:00
Yi Kong 5573271b0c ARM: Add NOP intrinsic mapping in arm_acle.h
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@212950 91177308-0d34-0410-b5e6-96231b3b80d8
2014-07-14 15:32:29 +00:00
Saleem Abdulrasool 71f06af4f7 Headers: add hint intrinsics to arm_acle.h
This adds the ARM ACLE hint intrinsic wrappers to arm_acle.h.  These need to be
protected with a !defined(_MSC_VER) since MSVC (and thus clang in compatibility
mode) provide these wrappers as proper builtin intrinsics.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@212891 91177308-0d34-0410-b5e6-96231b3b80d8
2014-07-12 23:27:26 +00:00
Yi Kong d5b9b66aba Improve comments of ARM ACLE header file and tests
Include section number in ARM ACLE specification for easier navigation.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@212887 91177308-0d34-0410-b5e6-96231b3b80d8
2014-07-12 22:48:13 +00:00
Saleem Abdulrasool 7569f62673 Headers: mark arm_acle.h with extern "C"
Although the functions are marked as always_inline, the compiler with which they
are used may not honour the extended attributes and emit them as functions.  In
such a case, indicate that they should have extern "C" linkage and should not be
mangled in C++ style if used within C++.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@212511 91177308-0d34-0410-b5e6-96231b3b80d8
2014-07-08 05:46:00 +00:00
Renato Golin a9f8b0771c Add the __qdbl intrinsic to the arm_acle.h header
Patch by: Moritz Roth

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@212264 91177308-0d34-0410-b5e6-96231b3b80d8
2014-07-03 10:14:52 +00:00
Yi Kong 2b874e51c1 Introduce arm_acle.h supporting existing LLVM builtin intrinsics
Summary: This patch introduces ACLE header file, implementing extensions that can be directly mapped to existing Clang intrinsics. It implements for both AArch32 and AArch64.

Reviewers: t.p.northover, compnerd, rengolin

Reviewed By: compnerd, rengolin

Subscribers: rnk, echristo, compnerd, aemerson, mroth, cfe-commits

Differential Revision: http://reviews.llvm.org/D4296

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@211962 91177308-0d34-0410-b5e6-96231b3b80d8
2014-06-27 21:25:42 +00:00