aboutsummaryrefslogtreecommitdiff
path: root/gcc/config/arm/arm_cde.h
blob: 0ba3ee02d057dd280c9b3400ef70b46ed472aec3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
/* Arm Custom Datapath Extension (CDE) intrinsics include file.

   Copyright (C) 2020 Free Software Foundation, Inc.
   Contributed by Arm Ltd.

   This file is part of GCC.

   GCC is free software; you can redistribute it and/or modify it
   under the terms of the GNU General Public License as published
   by the Free Software Foundation; either version 3, or (at your
   option) any later version.

   GCC is distributed in the hope that it will be useful, but WITHOUT
   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
   or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public
   License for more details.

   Under Section 7 of GPL version 3, you are granted additional
   permissions described in the GCC Runtime Library Exception, version
   3.1, as published by the Free Software Foundation.

   You should have received a copy of the GNU General Public License and
   a copy of the GCC Runtime Library Exception along with this program;
   see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
   <http://www.gnu.org/licenses/>.  */

#ifndef _GCC_ARM_CDE_H
#define _GCC_ARM_CDE_H 1

#include <stdint.h>

#if defined (__ARM_FEATURE_CDE)

#define __arm_cx1(coproc, imm) \
	__builtin_arm_cx1si(coproc, imm)

#define __arm_cx1a(coproc, acc, imm) \
	__builtin_arm_cx1asi(coproc, acc, imm)

#define __arm_cx2(coproc, n, imm) \
	__builtin_arm_cx2si(coproc, n, imm)

#define __arm_cx2a(coproc, acc, n, imm) \
	__builtin_arm_cx2asi(coproc, acc, n, imm)

#define __arm_cx3(coproc, n, m, imm) \
	__builtin_arm_cx3si(coproc, n, m, imm)

#define __arm_cx3a(coproc, acc, n, m, imm) \
	__builtin_arm_cx3asi(coproc, acc, n, m, imm)

#define __arm_cx1d(coproc, imm) \
	__builtin_arm_cx1di(coproc, imm)

#define __arm_cx1da(coproc, acc, imm) \
	__builtin_arm_cx1adi(coproc, acc, imm)

#define __arm_cx2d(coproc, n, imm) \
	__builtin_arm_cx2di(coproc, n, imm)

#define __arm_cx2da(coproc, acc, n, imm) \
	__builtin_arm_cx2adi(coproc, acc, n, imm)

#define __arm_cx3d(coproc, n, m, imm) \
	__builtin_arm_cx3di(coproc, n, m, imm)

#define __arm_cx3da(coproc, acc, n, m, imm) \
	__builtin_arm_cx3adi(coproc, acc, n, m, imm)

#if defined (__ARM_FP) || defined (__ARM_FEATURE_MVE)

/* CDE builtins using FPU/MVE registers.  */

/* uint32_t
   __arm_vcx1_u32(int coproc, uint32_t imm);  */
#define __arm_vcx1_u32(coproc, imm) \
	__builtin_arm_vcx1si(coproc, imm)

/* uint32_t
   __arm_vcx1a_u32(int coproc, uint32_t acc, uint32_t imm);  */
#define __arm_vcx1a_u32(coproc, acc, imm) \
	__builtin_arm_vcx1asi(coproc, acc, imm)

/* uint32_t
   __arm_vcx2_u32(int coproc, uint32_t n, uint32_t imm);  */
#define __arm_vcx2_u32(coproc, n, imm) \
	__builtin_arm_vcx2si(coproc, n, imm)

/* uint32_t
   __arm_vcx2a_u32(int coproc, uint32_t acc, uint32_t n, uint32_t imm);  */
#define __arm_vcx2a_u32(coproc, acc, n, imm) \
	__builtin_arm_vcx2asi(coproc, acc, n, imm)

/* uint32_t
   __arm_vcx3_u32(int coproc, uint32_t n, uint32_t m, uint32_t imm);  */
#define __arm_vcx3_u32(coproc, n, m, imm) \
	__builtin_arm_vcx3si(coproc, n, m, imm)

/* uint32_t
   __arm_vcx3a_u32(int coproc, uint32_t acc, uint32_t n, uint32_t m,
		   uint32_t imm);  */
#define __arm_vcx3a_u32(coproc, acc, n, m, imm) \
	__builtin_arm_vcx3asi(coproc, acc, n, m, imm)

/* uint64_t
   __arm_vcx1d_u64(int coproc, uint32_t imm);  */
#define __arm_vcx1d_u64(coproc, imm) \
	__builtin_arm_vcx1di(coproc, imm)

/* uint64_t
   __arm_vcx1da_u64(int coproc, uint64_t acc, uint32_t imm);  */
#define __arm_vcx1da_u64(coproc, acc, imm) \
	__builtin_arm_vcx1adi(coproc, acc, imm)

/* uint64_t
   __arm_vcx2d_u64(int coproc, uint64_t m, uint32_t imm);  */
#define __arm_vcx2d_u64(coproc, m, imm) \
	__builtin_arm_vcx2di(coproc, m, imm)

/* uint64_t
   __arm_vcx2da_u64(int coproc, uint64_t acc, uint64_t m, uint32_t imm);  */
#define __arm_vcx2da_u64(coproc, acc, m, imm) \
	__builtin_arm_vcx2adi(coproc, acc, m, imm)

/* uint64_t
   __arm_vcx3d_u64(int coproc, uint64_t n, uint64_t m, uint32_t imm);  */
#define __arm_vcx3d_u64(coproc, n, m, imm) \
	__builtin_arm_vcx3di(coproc, n, m, imm)

/* uint64_t
   __arm_vcx3da_u64(int coproc, uint64_t acc, uint64_t n, uint64_t m,
		    uint32_t imm);  */
#define __arm_vcx3da_u64(coproc, acc, n, m, imm) \
	__builtin_arm_vcx3adi(coproc, acc, n, m, imm)

#endif /* __ARM_FP || __ARM_FEATURE_MVE.  */
#endif /* __ARM_FEATURE_CDE.  */

#if __ARM_FEATURE_MVE
#include "arm_mve_types.h"

#define __arm_vcx1q_u8(coproc, imm) \
	(uint8x16_t)__builtin_arm_vcx1qv16qi(coproc, imm)
#define __arm_vcx1qa(coproc, acc, imm) \
	__builtin_arm_vcx1qav16qi(coproc, acc, imm)
#define __arm_vcx2q(coproc, n, imm) \
	__builtin_arm_vcx2qv16qi(coproc, n, imm)
#define __arm_vcx2q_u8(coproc, n, imm) \
	(uint8x16_t)__builtin_arm_vcx2qv16qi(coproc, n, imm)
#define __arm_vcx2qa(coproc, acc, n, imm) \
	__builtin_arm_vcx2qav16qi(coproc, acc, n, imm)
#define __arm_vcx3q(coproc, n, m, imm) \
	__builtin_arm_vcx3qv16qi(coproc, n, m, imm)
#define __arm_vcx3q_u8(coproc, n, m, imm) \
	(uint8x16_t)__builtin_arm_vcx3qv16qi(coproc, n, m, imm)
#define __arm_vcx3qa(coproc, acc, n, m, imm) \
	__builtin_arm_vcx3qav16qi(coproc, acc, n, m, imm)

#define __arm_vcx1q_m(coproc, inactive, imm, pred) \
	__builtin_arm_vcx1q_p_v16qi(coproc, inactive, imm, pred)
#define __arm_vcx1qa_m(coproc, acc, imm, pred) \
	__builtin_arm_vcx1qa_p_v16qi(coproc, acc, imm, pred)

#define __arm_vcx2q_m(coproc, inactive, n, imm, pred) \
	__builtin_arm_vcx2q_p_v16qi(coproc, inactive, n, imm, pred)
#define __arm_vcx2qa_m(coproc, acc, n, imm, pred) \
	__builtin_arm_vcx2qa_p_v16qi(coproc, acc, n, imm, pred)

#define __arm_vcx3q_m(coproc, inactive, n, m, imm, pred) \
	__builtin_arm_vcx3q_p_v16qi(coproc, inactive, n, m, imm, pred)
#define __arm_vcx3qa_m(coproc, acc, n, m, imm, pred) \
	__builtin_arm_vcx3qa_p_v16qi(coproc, acc, n, m, imm, pred)

#endif

#endif