3 ** Copyright (C) 2005-2012 Mike Pall. See Copyright Notice in luajit.h
14 /* Compressed C type index. ORDER CCX. */
18 CCX_F
, /* Floating-point number. */
22 CCX_A
, /* Refarray. */
23 CCX_S
/* Struct/union. */
26 /* Convert C type info to compressed C type index. ORDER CT. ORDER CCX. */
27 static LJ_AINLINE
uint32_t cconv_idx(CTInfo info
)
29 uint32_t idx
= ((info
>> 26) & 15u); /* Dispatch bits. */
30 lua_assert(ctype_type(info
) <= CT_MAYCONVERT
);
32 idx
= ((U64x(f436fff5
,fff7f021
) >> 4*idx
) & 15u);
34 idx
= (((idx
< 8 ? 0xfff7f021u
: 0xf436fff5) >> 4*(idx
& 7u)) & 15u);
40 #define cconv_idx2(dinfo, sinfo) \
41 ((cconv_idx((dinfo)) << 3) + cconv_idx((sinfo)))
43 #define CCX(dst, src) ((CCX_##dst << 3) + CCX_##src)
45 /* Conversion flags. */
46 #define CCF_CAST 0x00000001u
47 #define CCF_FROMTV 0x00000002u
48 #define CCF_SAME 0x00000004u
49 #define CCF_IGNQUAL 0x00000008u
51 #define CCF_ARG_SHIFT 8
52 #define CCF_ARG(n) ((n) << CCF_ARG_SHIFT)
53 #define CCF_GETARG(f) ((f) >> CCF_ARG_SHIFT)
55 LJ_FUNC
int lj_cconv_compatptr(CTState
*cts
, CType
*d
, CType
*s
, CTInfo flags
);
56 LJ_FUNC
void lj_cconv_ct_ct(CTState
*cts
, CType
*d
, CType
*s
,
57 uint8_t *dp
, uint8_t *sp
, CTInfo flags
);
58 LJ_FUNC
int lj_cconv_tv_ct(CTState
*cts
, CType
*s
, CTypeID sid
,
59 TValue
*o
, uint8_t *sp
);
60 LJ_FUNC
int lj_cconv_tv_bf(CTState
*cts
, CType
*s
, TValue
*o
, uint8_t *sp
);
61 LJ_FUNC
void lj_cconv_ct_tv(CTState
*cts
, CType
*d
,
62 uint8_t *dp
, TValue
*o
, CTInfo flags
);
63 LJ_FUNC
void lj_cconv_bf_tv(CTState
*cts
, CType
*d
, uint8_t *dp
, TValue
*o
);
64 LJ_FUNC
int lj_cconv_multi_init(CType
*d
, TValue
*o
);
65 LJ_FUNC
void lj_cconv_ct_init(CTState
*cts
, CType
*d
, CTSize sz
,
66 uint8_t *dp
, TValue
*o
, MSize len
);