1 /* -----------------------------------------------------------------------
2 ffi-mips.h - Copyright (c) 1996 Cygnus Support
6 Permission is hereby granted, free of charge, to any person obtaining
7 a copy of this software and associated documentation files (the
8 ``Software''), to deal in the Software without restriction, including
9 without limitation the rights to use, copy, modify, merge, publish,
10 distribute, sublicense, and/or sell copies of the Software, and to
11 permit persons to whom the Software is furnished to do so, subject to
12 the following conditions:
14 The above copyright notice and this permission notice shall be included
15 in all copies or substantial portions of the Software.
17 THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, EXPRESS
18 OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
19 MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
20 IN NO EVENT SHALL CYGNUS SUPPORT BE LIABLE FOR ANY CLAIM, DAMAGES OR
21 OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
22 ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
23 OTHER DEALINGS IN THE SOFTWARE.
24 ----------------------------------------------------------------------- */
30 #if !defined(_MIPS_SIM)
31 -- something is very wrong
--
33 # if _MIPS_SIM==_ABIN32 && defined(_ABIN32)
36 # if defined(__GNUC__)
39 # if _MIPS_SIM==_ABIO32
42 -- this is an unsupported platform
--
70 #if defined(FFI_MIPS_O32)
72 #define FFI_DEFAULT_ABI FFI_O32
74 /* O32 stack frames have 32bit integer args */
75 #define SLOT_TYPE_UNSIGNED UINT32
76 #define SLOT_TYPE_SIGNED SINT32
88 #define FFI_DEFAULT_ABI FFI_N32
90 /* N32 and N64 frames have 64bit integer args */
91 #define SLOT_TYPE_UNSIGNED UINT64
92 #define SLOT_TYPE_SIGNED SINT64
104 #define FFI_FLAG_BITS 2
106 /* SGI's strange assembler requires that we multiply by 4 rather
107 than shift left by FFI_FLAG_BITS */
109 #define FFI_ARGS_D FFI_TYPE_DOUBLE
110 #define FFI_ARGS_F FFI_TYPE_FLOAT
111 #define FFI_ARGS_DD FFI_TYPE_DOUBLE * 4 + FFI_TYPE_DOUBLE
112 #define FFI_ARGS_FF FFI_TYPE_FLOAT * 4 + FFI_TYPE_FLOAT
113 #define FFI_ARGS_FD FFI_TYPE_DOUBLE * 4 + FFI_TYPE_FLOAT
114 #define FFI_ARGS_DF FFI_TYPE_FLOAT * 4 + FFI_TYPE_DOUBLE
116 /* Needed for N32 structure returns */
117 #define FFI_TYPE_SMALLSTRUCT FFI_TYPE_UINT8
118 #define FFI_TYPE_SMALLSTRUCT2 FFI_TYPE_SINT8
122 /* The SGI assembler can't handle this.. */
124 #define FFI_TYPE_STRUCT_DD (( FFI_ARGS_DD ) << 4) + FFI_TYPE_STRUCT
128 /* ...so we calculate these by hand! */
130 #define FFI_TYPE_STRUCT_D 61
131 #define FFI_TYPE_STRUCT_F 45
132 #define FFI_TYPE_STRUCT_DD 253
133 #define FFI_TYPE_STRUCT_FF 173
134 #define FFI_TYPE_STRUCT_FD 237
135 #define FFI_TYPE_STRUCT_DF 189
136 #define FFI_TYPE_STRUCT_SMALL 93
137 #define FFI_TYPE_STRUCT_SMALL2 109