Mercurial > pub > dyncall > dyncall
diff dyncallback/dyncall_args_mips_o32.c @ 110:9aa75a74614c
- working mips32 eabi callbacks
- mips32 eabi doc update
- switched some mips32 eabi call assembly to use more portable pseudo instructions for storing floats
- fixed weird type use of var declaration in mips callbacks
- ToDo update
- converted some // comments to old c-style
- test code build fix for some test suites on some platforms
author | cslag |
---|---|
date | Sat, 18 Jun 2016 19:38:22 +0200 |
parents | 9e677d4c0b6b |
children | f0437f85091b |
line wrap: on
line diff
--- a/dyncallback/dyncall_args_mips_o32.c Sat Jun 11 21:44:38 2016 +0200 +++ b/dyncallback/dyncall_args_mips_o32.c Sat Jun 18 19:38:22 2016 +0200 @@ -29,7 +29,7 @@ DCint dcbArgInt(DCArgs* p) { DCint value; - p->freg_count = 2; // first int will disable float reg use. + p->freg_count = 2; /* first int will disable float reg use. */ value = *((int*)p->stackptr); p->stackptr += sizeof(int); return value; @@ -39,7 +39,7 @@ DCulonglong dcbArgULongLong(DCArgs* p) { DCulonglong value; - p->stackptr += ((int)p->stackptr & 4); // Skip one slot if not aligned. + p->stackptr += ((int)p->stackptr & 4); /* Skip one slot if not aligned. */ #if defined(DC__Endian_LITTLE) value = dcbArgUInt(p); value |= ((DCulonglong)dcbArgUInt(p)) << 32; @@ -64,11 +64,11 @@ { DCfloat result; if(p->freg_count < 2) { - // Stored float regs (max 2) are always 8b aligned. The way we look them up, - // relative to a diverging p->stackptr, we need consider this. Only works - // with up to two float args, which is all we need. Hacky, but saves us - // from one more variable and more bookkeeping in DCArgs. - result = ((DCfloat*)(p->stackptr + ((int)p->stackptr & 4)) - 4) // '-4' b/c those regs are stored right before the args + /* Stored float regs (max 2) are always 8b aligned. The way we look them up, */ + /* relative to a diverging p->stackptr, we need consider this. Only works */ + /* with up to two float args, which is all we need. Hacky, but saves us */ + /* from one more variable and more bookkeeping in DCArgs. */ + result = ((DCfloat*)(p->stackptr + ((int)p->stackptr & 4)) - 4) /* '-4' b/c those regs are stored right before the args */ #if defined(DC__Endian_LITTLE) [0]; #else @@ -87,14 +87,14 @@ DCdouble result; DCfloat f[2]; } d; - p->stackptr += ((int)p->stackptr & 4); // Skip one slot if not aligned. + p->stackptr += ((int)p->stackptr & 4); /* Skip one slot if not aligned. */ if(p->freg_count < 2) { - //result = *((DCdouble*)p->stackptr-2); this changes the value, slightly - d.f[0] = ((DCfloat*)p->stackptr-4)[0]; // '-4' b/c those regs are stored right before the args + /*result = *((DCdouble*)p->stackptr-2); this changes the value, slightly*/ + d.f[0] = ((DCfloat*)p->stackptr-4)[0]; /* '-4' b/c those regs are stored right before the args */ d.f[1] = ((DCfloat*)p->stackptr-4)[1]; ++p->freg_count; } else { - //result = *((DCdouble*)p->stackptr); this changes the value, slightly + /*result = *((DCdouble*)p->stackptr); this changes the value, slightly*/ d.f[0] = ((DCfloat*)p->stackptr)[0]; d.f[1] = ((DCfloat*)p->stackptr)[1]; }