0
|
1 /* Copyright (C) 2006, 2007 Free Software Foundation, Inc.
|
|
2
|
|
3 This file is free software; you can redistribute it and/or modify it under
|
|
4 the terms of the GNU General Public License as published by the Free
|
|
5 Software Foundation; either version 3 of the License, or (at your option)
|
|
6 any later version.
|
|
7
|
|
8 This file is distributed in the hope that it will be useful, but WITHOUT
|
|
9 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
10 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
11 for more details.
|
|
12
|
|
13 You should have received a copy of the GNU General Public License
|
|
14 along with GCC; see the file COPYING3. If not see
|
|
15 <http://www.gnu.org/licenses/>. */
|
|
16
|
|
17 /* built-ins */
|
|
18
|
|
19 enum spu_builtin_type_index
|
|
20 {
|
|
21 SPU_BTI_END_OF_PARAMS,
|
|
22
|
|
23 /* We create new type nodes for these. */
|
|
24 SPU_BTI_V16QI,
|
|
25 SPU_BTI_V8HI,
|
|
26 SPU_BTI_V4SI,
|
|
27 SPU_BTI_V2DI,
|
|
28 SPU_BTI_V4SF,
|
|
29 SPU_BTI_V2DF,
|
|
30 SPU_BTI_UV16QI,
|
|
31 SPU_BTI_UV8HI,
|
|
32 SPU_BTI_UV4SI,
|
|
33 SPU_BTI_UV2DI,
|
|
34
|
|
35 /* A 16-byte type. (Implemented with V16QI_type_node) */
|
|
36 SPU_BTI_QUADWORD,
|
|
37
|
|
38 /* These all correspond to intSI_type_node */
|
|
39 SPU_BTI_7,
|
|
40 SPU_BTI_S7,
|
|
41 SPU_BTI_U7,
|
|
42 SPU_BTI_S10,
|
|
43 SPU_BTI_S10_4,
|
|
44 SPU_BTI_U14,
|
|
45 SPU_BTI_16,
|
|
46 SPU_BTI_S16,
|
|
47 SPU_BTI_S16_2,
|
|
48 SPU_BTI_U16,
|
|
49 SPU_BTI_U16_2,
|
|
50 SPU_BTI_U18,
|
|
51
|
|
52 /* These correspond to the standard types */
|
|
53 SPU_BTI_INTQI,
|
|
54 SPU_BTI_INTHI,
|
|
55 SPU_BTI_INTSI,
|
|
56 SPU_BTI_INTDI,
|
|
57
|
|
58 SPU_BTI_UINTQI,
|
|
59 SPU_BTI_UINTHI,
|
|
60 SPU_BTI_UINTSI,
|
|
61 SPU_BTI_UINTDI,
|
|
62
|
|
63 SPU_BTI_FLOAT,
|
|
64 SPU_BTI_DOUBLE,
|
|
65
|
|
66 SPU_BTI_VOID,
|
|
67 SPU_BTI_PTR,
|
|
68
|
|
69 SPU_BTI_MAX
|
|
70 };
|
|
71
|
|
72 #define V16QI_type_node (spu_builtin_types[SPU_BTI_V16QI])
|
|
73 #define V8HI_type_node (spu_builtin_types[SPU_BTI_V8HI])
|
|
74 #define V4SI_type_node (spu_builtin_types[SPU_BTI_V4SI])
|
|
75 #define V2DI_type_node (spu_builtin_types[SPU_BTI_V2DI])
|
|
76 #define V4SF_type_node (spu_builtin_types[SPU_BTI_V4SF])
|
|
77 #define V2DF_type_node (spu_builtin_types[SPU_BTI_V2DF])
|
|
78 #define unsigned_V16QI_type_node (spu_builtin_types[SPU_BTI_UV16QI])
|
|
79 #define unsigned_V8HI_type_node (spu_builtin_types[SPU_BTI_UV8HI])
|
|
80 #define unsigned_V4SI_type_node (spu_builtin_types[SPU_BTI_UV4SI])
|
|
81 #define unsigned_V2DI_type_node (spu_builtin_types[SPU_BTI_UV2DI])
|
|
82
|
|
83 extern GTY(()) tree spu_builtin_types[SPU_BTI_MAX];
|
|
84
|
|
85 /* Some builtins require special handling. This enum differentiates. */
|
|
86 enum spu_builtin_type {
|
|
87 B_INSN,
|
|
88 B_JUMP,
|
|
89 B_BISLED,
|
|
90 B_CALL,
|
|
91 B_HINT,
|
|
92 B_OVERLOAD,
|
|
93 B_INTERNAL
|
|
94 };
|
|
95
|
|
96 typedef enum {
|
|
97 #define DEF_BUILTIN(fcode, icode, name, type, params) fcode,
|
|
98 #include "spu-builtins.def"
|
|
99 #undef DEF_BUILTIN
|
|
100 NUM_SPU_BUILTINS
|
|
101 } spu_function_code;
|
|
102
|
|
103 struct spu_builtin_description {
|
|
104 spu_function_code fcode;
|
|
105 enum insn_code icode;
|
|
106 const char *name;
|
|
107 enum spu_builtin_type type;
|
|
108
|
|
109 /* The first element of parm is always the return type. The rest
|
|
110 * are a zero terminated list of parameters. */
|
|
111 int parm[5];
|
|
112
|
|
113 tree fndecl;
|
|
114 };
|
|
115
|
|
116 extern GTY(()) struct spu_builtin_description spu_builtins[];
|
|
117
|
|
118
|
|
119
|