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
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
|
/* Intrinsics for TI C6X.
Copyright (C) 2011-2013 Free Software Foundation, Inc.
Contributed by CodeSourcery.
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_C6X_INTRINSICS_H
#define _GCC_C6X_INTRINSICS_H
#if !defined(__TMS320C6X__)
# error "c6x_intrinsics.h is only supported for C6X targets"
#endif
#ifdef __cplusplus
extern "C" {
#endif
#include <stdint.h>
/* Define vector types. */
typedef uint8_t __uv4qi __attribute__((vector_size (4)));
typedef int16_t __v2hi __attribute__((vector_size (4)));
typedef int32_t __v2si __attribute__((vector_size (8)));
__extension__ static __inline int __attribute__ ((__always_inline__))
_abs (int src)
{
return __builtin_c6x_abs (src);
}
__extension__ static __inline int __attribute__ ((__always_inline__))
_abs2 (int src)
{
return (int)__builtin_c6x_abs2 ((__v2hi)src);
}
__extension__ static __inline int __attribute__ ((__always_inline__))
_sadd (int src1, int src2)
{
return __builtin_c6x_sadd (src1, src2);
}
__extension__ static __inline int __attribute__ ((__always_inline__))
_ssub (int src1, int src2)
{
return __builtin_c6x_ssub (src1, src2);
}
__extension__ static __inline int __attribute__ ((__always_inline__))
_add2 (int src1, int src2)
{
return (int)__builtin_c6x_add2 ((__v2hi)src1, (__v2hi)src2);
}
__extension__ static __inline int __attribute__ ((__always_inline__))
_sub2 (int src1, int src2)
{
return (int)__builtin_c6x_sub2 ((__v2hi)src1, (__v2hi)src2);
}
__extension__ static __inline int __attribute__ ((__always_inline__))
_add4 (int src1, int src2)
{
return (int)__builtin_c6x_add4 ((__uv4qi)src1, (__uv4qi)src2);
}
__extension__ static __inline int __attribute__ ((__always_inline__))
_sub4 (int src1, int src2)
{
return (int)__builtin_c6x_sub4 ((__uv4qi)src1, (__uv4qi)src2);
}
__extension__ static __inline int __attribute__ ((__always_inline__))
_sadd2 (int src1, int src2)
{
return (int)__builtin_c6x_sadd2 ((__v2hi)src1, (__v2hi)src2);
}
__extension__ static __inline int __attribute__ ((__always_inline__))
_ssub2 (int src1, int src2)
{
return (int)__builtin_c6x_ssub2 ((__v2hi)src1, (__v2hi)src2);
}
__extension__ static __inline int __attribute__ ((__always_inline__))
_saddu4 (int src1, int src2)
{
return (int)__builtin_c6x_saddu4 ((__uv4qi)src1, (__uv4qi)src2);
}
__extension__ static __inline int __attribute__ ((__always_inline__))
_smpy (int src1, int src2)
{
return __builtin_c6x_smpy (src1, src2);
}
__extension__ static __inline int __attribute__ ((__always_inline__))
_smpylh (int src1, int src2)
{
return __builtin_c6x_smpylh (src1, src2);
}
__extension__ static __inline int __attribute__ ((__always_inline__))
_smpyhl (int src1, int src2)
{
return __builtin_c6x_smpyhl (src1, src2);
}
__extension__ static __inline int __attribute__ ((__always_inline__))
_smpyh (int src1, int src2)
{
return __builtin_c6x_smpyh (src1, src2);
}
__extension__ static __inline long long __attribute__ ((__always_inline__))
_smpy2ll (int src1, int src2)
{
return (long long)__builtin_c6x_smpy2 ((__v2hi)src1, (__v2hi)src2);
}
__extension__ static __inline long long __attribute__ ((__always_inline__))
_mpy2ll (int src1, int src2)
{
return (long long)__builtin_c6x_mpy2 ((__v2hi)src1, (__v2hi)src2);
}
__extension__ static __inline int __attribute__ ((__always_inline__))
_extr (int src1, int src2)
{
return __builtin_c6x_extr (src1, src2);
}
__extension__ static __inline int __attribute__ ((__always_inline__))
_extru (int src1, int src2)
{
return __builtin_c6x_extru (src1, src2);
}
__extension__ static __inline int __attribute__ ((__always_inline__))
_clrr (int src1, int src2)
{
return __builtin_c6x_clrr (src1, src2);
}
__extension__ static __inline int __attribute__ ((__always_inline__))
_avg2 (int src1, int src2)
{
return (int)__builtin_c6x_avg2 ((__v2hi)src1, (__v2hi)src2);
}
__extension__ static __inline int __attribute__ ((__always_inline__))
_avgu4 (int src1, int src2)
{
return (int)__builtin_c6x_avgu4 ((__uv4qi)src1, (__uv4qi)src2);
}
__extension__ static __inline int __attribute__ ((__always_inline__))
_sshl (int src1, int src2)
{
return __builtin_c6x_sshl (src1, src2);
}
__extension__ static __inline int __attribute__ ((__always_inline__))
_subc (int src1, int src2)
{
return __builtin_c6x_subc (src1, src2);
}
#ifdef __cplusplus
}
#endif
#endif
|