shithub: femtolisp

ref: da7de7d9c3f9c66468e4d988cc6b23bc961ed742
dir: /llt.h/

View raw version
#pragma once

#include "platform.h"
#include "utf8.h"
#include "ios.h"
#include "bitvector.h"

#include "htableh.inc"
HTPROT(ptrhash)

#define DBL_MAXINT (1LL<<53)
#define FLT_MAXINT (1<<24)
#define BIT63 0x8000000000000000ULL
#define BIT31 0x80000000UL

#ifdef BITS64
#define TOP_BIT BIT63
typedef uint64_t lltuint_t;
typedef int64_t lltint_t;
#else
#define TOP_BIT BIT31
typedef uint32_t lltuint_t;
typedef int32_t lltint_t;
#endif

#define LOG2_10 3.3219280948873626
#define rel_zero(a, b) (fabs((a)/(b)) < DBL_EPSILON)
#define LLT_ALIGN(x, sz) (((x) + (sz-1)) & (-sz))

extern double D_PNAN, D_NNAN, D_PINF, D_NINF;
extern float F_PNAN, F_NNAN, F_PINF, F_NINF;

_Noreturn void flmain(const uint8_t *boot, int bootsz, int argc, char **argv);