* dump.c (dequeue_and_dump): Dump DECL_EXTERNAL.
[official-gcc.git] / libffi / include / ffi_mips.h
blob9d4a66cb8c3f01eebd6d8edd7bbe98dd8a170120
1 /* -----------------------------------------------------------------------
2 ffi-mips.h - Copyright (c) 1996 Cygnus Support
4 MIPS FFI Definitions
6 $Id: ffi_mips.h,v 1.1.1.1 1998/11/29 16:48:16 green Exp $
8 Permission is hereby granted, free of charge, to any person obtaining
9 a copy of this software and associated documentation files (the
10 ``Software''), to deal in the Software without restriction, including
11 without limitation the rights to use, copy, modify, merge, publish,
12 distribute, sublicense, and/or sell copies of the Software, and to
13 permit persons to whom the Software is furnished to do so, subject to
14 the following conditions:
16 The above copyright notice and this permission notice shall be included
17 in all copies or substantial portions of the Software.
19 THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, EXPRESS
20 OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
21 MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
22 IN NO EVENT SHALL CYGNUS SUPPORT BE LIABLE FOR ANY CLAIM, DAMAGES OR
23 OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
24 ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
25 OTHER DEALINGS IN THE SOFTWARE.
26 ----------------------------------------------------------------------- */
28 #ifndef FFI_MIPS_H
30 #include <ffi.h>
32 #if !defined(_MIPS_SIM)
33 -- something is very wrong --
34 #else
35 # if _MIPS_SIM==_ABIN32 && defined(_ABIN32)
36 # define FFI_MIPS_N32
37 # else
38 # if defined(__GNUC__)
39 # define FFI_MIPS_O32
40 # else
41 # if _MIPS_SIM==_ABIO32
42 # define FFI_MIPS_O32
43 # else
44 -- this is an unsupported platform --
45 # endif
46 # endif
47 # endif
48 #endif
50 #define v0 $2
51 #define v1 $3
52 #define a0 $4
53 #define a1 $5
54 #define a2 $6
55 #define a3 $7
56 #define a4 $8
57 #define a5 $9
58 #define a6 $10
59 #define a7 $11
60 #define t0 $8
61 #define t1 $9
62 #define t2 $10
63 #define t3 $11
64 #define t4 $12
65 #define t5 $13
66 #define t6 $14
67 #define t7 $15
68 #define t8 $24
69 #define t9 $25
70 #define ra $31
72 #if defined(FFI_MIPS_O32)
74 #define FFI_DEFAULT_ABI FFI_O32
76 /* O32 stack frames have 32bit integer args */
77 #define SLOT_TYPE_UNSIGNED UINT32
78 #define SLOT_TYPE_SIGNED SINT32
79 #define SIZEOF_ARG 4
81 #define REG_L lw
82 #define REG_S sw
83 #define SUBU subu
84 #define ADDU addu
85 #define SRL srl
86 #define LI li
88 #else
90 #define FFI_DEFAULT_ABI FFI_N32
92 /* N32 and N64 frames have 64bit integer args */
93 #define SLOT_TYPE_UNSIGNED UINT64
94 #define SLOT_TYPE_SIGNED SINT64
95 #define SIZEOF_ARG 8
97 #define REG_L ld
98 #define REG_S sd
99 #define SUBU dsubu
100 #define ADDU daddu
101 #define SRL dsrl
102 #define LI dli
104 #endif
106 #define FFI_FLAG_BITS 2
108 /* SGI's strange assembler requires that we multiply by 4 rather
109 than shift left by FFI_FLAG_BITS */
111 #define FFI_ARGS_D FFI_TYPE_DOUBLE
112 #define FFI_ARGS_F FFI_TYPE_FLOAT
113 #define FFI_ARGS_DD FFI_TYPE_DOUBLE * 4 + FFI_TYPE_DOUBLE
114 #define FFI_ARGS_FF FFI_TYPE_FLOAT * 4 + FFI_TYPE_FLOAT
115 #define FFI_ARGS_FD FFI_TYPE_DOUBLE * 4 + FFI_TYPE_FLOAT
116 #define FFI_ARGS_DF FFI_TYPE_FLOAT * 4 + FFI_TYPE_DOUBLE
118 /* Needed for N32 structure returns */
119 #define FFI_TYPE_SMALLSTRUCT FFI_TYPE_UINT8
120 #define FFI_TYPE_SMALLSTRUCT2 FFI_TYPE_SINT8
122 #if 0
124 /* The SGI assembler can't handle this.. */
126 #define FFI_TYPE_STRUCT_DD (( FFI_ARGS_DD ) << 4) + FFI_TYPE_STRUCT
128 #else
130 /* ...so we calculate these by hand! */
132 #define FFI_TYPE_STRUCT_D 61
133 #define FFI_TYPE_STRUCT_F 45
134 #define FFI_TYPE_STRUCT_DD 253
135 #define FFI_TYPE_STRUCT_FF 173
136 #define FFI_TYPE_STRUCT_FD 237
137 #define FFI_TYPE_STRUCT_DF 189
138 #define FFI_TYPE_STRUCT_SMALL 93
139 #define FFI_TYPE_STRUCT_SMALL2 109
141 #endif
143 #endif