OSDN Git Service

2007-06-27 Rask Ingemann Lambertsen <rask@sygehus.dk>
[pf3gnuchains/gcc-fork.git] / gcc / config / spu / spu-builtins.h
1 /* Copyright (C) 2006 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 2 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 this file; see the file COPYING.  If not, write to the Free
15    Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA
16    02110-1301, USA.  */
17 \f
18 /* built-ins */
19
20 enum spu_builtin_type_index
21 {
22   SPU_BTI_END_OF_PARAMS,
23
24   /* We create new type nodes for these. */
25   SPU_BTI_V16QI,
26   SPU_BTI_V8HI,
27   SPU_BTI_V4SI,
28   SPU_BTI_V2DI,
29   SPU_BTI_V4SF,
30   SPU_BTI_V2DF,
31   SPU_BTI_UV16QI,
32   SPU_BTI_UV8HI,
33   SPU_BTI_UV4SI,
34   SPU_BTI_UV2DI,
35
36   /* A 16-byte type. (Implemented with V16QI_type_node) */
37   SPU_BTI_QUADWORD,
38
39   /* These all correspond to intSI_type_node */
40   SPU_BTI_7,
41   SPU_BTI_S7,
42   SPU_BTI_U7,
43   SPU_BTI_S10,
44   SPU_BTI_S10_4,
45   SPU_BTI_U14,
46   SPU_BTI_16,
47   SPU_BTI_S16,
48   SPU_BTI_S16_2,
49   SPU_BTI_U16,
50   SPU_BTI_U16_2,
51   SPU_BTI_U18,
52
53   /* These correspond to the standard types */
54   SPU_BTI_INTQI, 
55   SPU_BTI_INTHI, 
56   SPU_BTI_INTSI, 
57   SPU_BTI_INTDI, 
58
59   SPU_BTI_UINTQI,
60   SPU_BTI_UINTHI,
61   SPU_BTI_UINTSI,
62   SPU_BTI_UINTDI,
63
64   SPU_BTI_FLOAT, 
65   SPU_BTI_DOUBLE,
66
67   SPU_BTI_VOID,   
68   SPU_BTI_PTR,   
69
70   SPU_BTI_MAX
71 };
72
73 #define V16QI_type_node               (spu_builtin_types[SPU_BTI_V16QI])
74 #define V8HI_type_node                (spu_builtin_types[SPU_BTI_V8HI])
75 #define V4SI_type_node                (spu_builtin_types[SPU_BTI_V4SI])
76 #define V2DI_type_node                (spu_builtin_types[SPU_BTI_V2DI])
77 #define V4SF_type_node                (spu_builtin_types[SPU_BTI_V4SF])
78 #define V2DF_type_node                (spu_builtin_types[SPU_BTI_V2DF])
79 #define unsigned_V16QI_type_node      (spu_builtin_types[SPU_BTI_UV16QI])
80 #define unsigned_V8HI_type_node       (spu_builtin_types[SPU_BTI_UV8HI])
81 #define unsigned_V4SI_type_node       (spu_builtin_types[SPU_BTI_UV4SI])
82 #define unsigned_V2DI_type_node       (spu_builtin_types[SPU_BTI_UV2DI])
83
84 extern GTY(()) tree spu_builtin_types[SPU_BTI_MAX];
85
86 /* Some builtins require special handling.  This enum differentiates. */
87 enum spu_builtin_type {
88     B_INSN,
89     B_JUMP,
90     B_BISLED,
91     B_CALL,
92     B_HINT,
93     B_OVERLOAD, 
94     B_INTERNAL
95 };
96
97 typedef enum {
98 #define DEF_BUILTIN(fcode, icode, name, type, params) fcode,
99 #include "spu-builtins.def"
100 #undef DEF_BUILTIN
101    NUM_SPU_BUILTINS
102 } spu_function_code;
103
104 struct spu_builtin_description {
105     spu_function_code fcode;
106     enum insn_code icode;
107     const char *name;
108     enum spu_builtin_type type;
109
110     /* The first element of parm is always the return type.  The rest
111      * are a zero terminated list of parameters. */
112     int parm[5];
113
114     tree fndecl;
115 };
116
117 extern GTY(()) struct spu_builtin_description spu_builtins[];
118
119
120