extensions
Volodymyr Shymanskyy 5 years ago
commit 968b7fabec

@ -157,7 +157,8 @@ d_m3ErrorConst (trapStackOverflow, "[trap] stack overflow")
// initialization
//-------------------------------------------------------------------------------------------------------------------------------
M3StackInfo m3_GetNativeStackInfo (int32_t i_stackSize);
// not yet implemented
// M3StackInfo m3_GetNativeStackInfo (int32_t i_stackSize);
// GetNativeStackInfo should be called at the start of main() or, if runtimes are used in a thread,
// at the start of the thread start function.

@ -2098,11 +2098,6 @@ _ (Compile_ReserveConstants (o));
o->numAllocatedExecSlots = 0; // this var only tracks dynamic slots so clear local+constant allocations
o->block.initStackIndex = o->stackIndex;
pc_t pc2 = GetPagePC (o->page);
if (pc2 != pc) {
m3Abort("pc2 != pc");
}
_ (EmitOp (o, op_Entry));
EmitPointer (o, io_function);

@ -168,10 +168,27 @@ typedef short i16;
typedef uint8_t u8;
typedef int8_t i8;
static inline float rintf( float arg ) {
union { float f; uint32_t i; } u;
u.f = arg;
uint32_t ux = u.i & 0x7FFFFFFF;
if (UNLIKELY(ux == 0 || ux > 0x5A000000)) {
return arg;
}
return (float)lrint(arg);
}
static inline double rint( double arg ) {
union { double f; uint32_t i[2]; } u;
u.f = arg;
uint32_t ux = u.i[1] & 0x7FFFFFFF;
if (UNLIKELY((ux == 0 && u.i[0] == 0) || ux > 0x433FFFFF)) {
return arg;
}
return (double)lrint(arg);
}
//TODO
static inline float rintf( float arg ) { return .0f; }
static inline double rint ( double arg ) { return .0; }
static inline uint64_t strtoull ( const char* str, char ** endptr, int base ) { return 0; }
static inline uint64_t strtoull( const char* str, char ** endptr, int base ) { return 0; }
#endif

Loading…
Cancel
Save