This commit is contained in:
Brad Nelson
2021-01-22 22:43:52 -08:00
parent 2d584832cb
commit 39840858d7
2 changed files with 8 additions and 30 deletions

View File

@ -16,16 +16,14 @@ typedef uintptr_t ucell_t;
#ifndef SSMOD_FUNC
# if __SIZEOF_POINTER__ == 8
typedef __int128_t dcell_t;
typedef __uint128_t udcell_t;
# elif __SIZEOF_POINTER__ == 4 || defined(_M_IX86)
typedef int64_t dcell_t;
typedef uint64_t udcell_t;
# else
# error "unsupported cell size"
# endif
# define SSMOD_FUNC dcell_t d = (dcell_t) *sp * (dcell_t) sp[-1]; \
--sp; *sp = (cell_t) (((udcell_t) d) % tos); \
tos = (cell_t) (d < 0 ? ~(~d / tos) : d / tos)
--sp; cell_t a = (cell_t) (d < 0 ? ~(~d / tos) : d / tos); \
*sp = (cell_t) (d - ((dcell_t) a) * tos); tos = a
#endif
#define OPCODE_LIST \