Added stix_mulints()

This commit is contained in:
hyunghwan.chung
2015-11-11 13:31:05 +00:00
parent e519c5078e
commit 0daf143cce
8 changed files with 425 additions and 101 deletions

View File

@ -54,6 +54,10 @@
/*#define STIX_DEBUG_EXEC*/
#define STIX_PROFILE_EXEC
#if STIX_SIZEOF_UINTMAX_T > STIX_SIZEOF_OOW_T
# define USE_FULL_WORD
#endif
#include <stdio.h> /* TODO: delete these header inclusion lines */
#include <string.h>
#include <assert.h>
@ -98,6 +102,25 @@
#define STIX_ALIGN(x,y) ((((x) + (y) - 1) / (y)) * (y))
/* ========================================================================= */
/* BIGINT TYPES AND MACROS */
/* ========================================================================= */
#if defined(USE_FULL_WORD)
typedef stix_uintmax_t bigatom_t;
typedef stix_oow_t atom_t;
typedef stix_oop_word_t oop_atom_t;
# define ATOM_BITS STIX_OOW_BITS
# define SIZEOF_ATOM_T STIX_SIZEOF_OOW_T
#else
typedef stix_oow_t bigatom_t;
typedef stix_oohw_t atom_t;
# define ATOM_BITS STIX_OOHW_BITS
typedef stix_oop_halfword_t oop_atom_t;
# define SIZEOF_ATOM_T STIX_SIZEOF_OOHW_T
# define MAKE_WORD(hw1,hw2) ((stix_oow_t)(hw1) | (stix_oow_t)(hw2) << ATOM_BITS)
#endif
/* ========================================================================= */
/* CLASS SPEC ENCODING */
/* ========================================================================= */
@ -1082,6 +1105,12 @@ stix_oop_t stix_subints (
stix_oop_t y
);
stix_oop_t stix_mulints (
stix_t* stix,
stix_oop_t x,
stix_oop_t y
);
stix_oop_t stix_strtoint (
stix_t* stix,
const stix_ooch_t* str,