comparison dyncall/dyncall_callvm_mips_o32.c @ 466:ddfb9577a00e

introduced platform-native thiscall mode (DC_CALL_C_DEFAULT_THIS), as needed for upcoming aggregate support (until now only x86 platforms allowed for specifically selecting thiscall mode, given the different conventions on the same platform); also added respective DC_SIGCHAR_CC_THISCALL ('*')
author Tassilo Philipp
date Wed, 02 Feb 2022 18:30:44 +0100
parents e2899b4ff713
children 71c884e610f0
comparison
equal deleted inserted replaced
465:e2899b4ff713 466:ddfb9577a00e
4 Library: dyncall 4 Library: dyncall
5 File: dyncall/dyncall_callvm_mips_o32.c 5 File: dyncall/dyncall_callvm_mips_o32.c
6 Description: mips "o32" ABI callvm implementation 6 Description: mips "o32" ABI callvm implementation
7 License: 7 License:
8 8
9 Copyright (c) 2007-2020 Daniel Adler <dadler@uni-goettingen.de>, 9 Copyright (c) 2007-2020 Daniel Adler <dadler@uni-goettingen.de>,
10 Tassilo Philipp <tphilipp@potion-studios.com> 10 Tassilo Philipp <tphilipp@potion-studios.com>
11 11
12 Permission to use, copy, modify, and distribute this software for any 12 Permission to use, copy, modify, and distribute this software for any
13 purpose with or without fee is hereby granted, provided that the above 13 purpose with or without fee is hereby granted, provided that the above
14 copyright notice and this permission notice appear in all copies. 14 copyright notice and this permission notice appear in all copies.
128 self->mRegData.u[self->mArgCount].f[1] = x; /* floats in regs always right justified */ 128 self->mRegData.u[self->mArgCount].f[1] = x; /* floats in regs always right justified */
129 # endif 129 # endif
130 # if 0 130 # if 0
131 self->mRegData.u[self->mArgCount].f[1] = x; 131 self->mRegData.u[self->mArgCount].f[1] = x;
132 call kernel 132 call kernel
133 133
134 mips: 134 mips:
135 lwc1 $f12, 4($5) <--- byte offset 4 135 lwc1 $f12, 4($5) <--- byte offset 4
136 lwc1 $f13, 0($5) 136 lwc1 $f13, 0($5)
137 lwc1 $f14, 12($5) <--- byte offset 12 137 lwc1 $f14, 12($5) <--- byte offset 12
138 lwc1 $f15, 8($5) 138 lwc1 $f15, 8($5)
139 mipsel: 139 mipsel:
140 lwc1 $f12, 0($5) <--- byte offset 4 140 lwc1 $f12, 0($5) <--- byte offset 4
141 lwc1 $f13, 4($5) 141 lwc1 $f13, 4($5)
142 lwc1 $f14, 8($5) <--- byte offset 12 142 lwc1 $f14, 8($5) <--- byte offset 12
143 lwc1 $f15, 12($5) 143 lwc1 $f15, 12($5)
144 144
145 # if defined(DC__Endian_LITTLE) 145 # if defined(DC__Endian_LITTLE)
146 /* index 0 and 2 */ 146 /* index 0 and 2 */
147 self->mRegData.floats[self->mArgCount*2] = x; 147 self->mRegData.floats[self->mArgCount*2] = x;
190 &dc_callvm_free_mips_o32 190 &dc_callvm_free_mips_o32
191 , &dc_callvm_reset_mips_o32 191 , &dc_callvm_reset_mips_o32
192 , &dc_callvm_mode_mips_o32 192 , &dc_callvm_mode_mips_o32
193 , &dc_callvm_argBool_mips_o32 193 , &dc_callvm_argBool_mips_o32
194 , &dc_callvm_argChar_mips_o32 194 , &dc_callvm_argChar_mips_o32
195 , &dc_callvm_argShort_mips_o32 195 , &dc_callvm_argShort_mips_o32
196 , &dc_callvm_argInt_mips_o32 196 , &dc_callvm_argInt_mips_o32
197 , &dc_callvm_argLong_mips_o32 197 , &dc_callvm_argLong_mips_o32
198 , &dc_callvm_argLongLong_mips_o32 198 , &dc_callvm_argLongLong_mips_o32
199 , &dc_callvm_argFloat_mips_o32 199 , &dc_callvm_argFloat_mips_o32
200 , &dc_callvm_argDouble_mips_o32 200 , &dc_callvm_argDouble_mips_o32
219 DCCallVM_mips_o32* self = (DCCallVM_mips_o32*)in_self; 219 DCCallVM_mips_o32* self = (DCCallVM_mips_o32*)in_self;
220 DCCallVM_vt* vt; 220 DCCallVM_vt* vt;
221 221
222 switch(mode) { 222 switch(mode) {
223 case DC_CALL_C_DEFAULT: 223 case DC_CALL_C_DEFAULT:
224 case DC_CALL_C_DEFAULT_THIS:
224 case DC_CALL_C_MIPS32_O32: 225 case DC_CALL_C_MIPS32_O32:
225 case DC_CALL_C_ELLIPSIS: 226 case DC_CALL_C_ELLIPSIS:
226 case DC_CALL_C_ELLIPSIS_VARARGS: 227 case DC_CALL_C_ELLIPSIS_VARARGS:
227 vt = &gVT_mips_o32; 228 vt = &gVT_mips_o32;
228 break; 229 break;
229 default: 230 default:
230 self->mInterface.mError = DC_ERROR_UNSUPPORTED_MODE; 231 self->mInterface.mError = DC_ERROR_UNSUPPORTED_MODE;
231 return; 232 return;
232 } 233 }
233 dc_callvm_base_init(&self->mInterface, vt); 234 dc_callvm_base_init(&self->mInterface, vt);
234 } 235 }
235 236