X-Git-Url: https://git.m6w6.name/?p=m6w6%2Fext-psi;a=blobdiff_plain;f=src%2Fcalc%2Fbasic.h;h=bc35baf1a55ceddac436f473dda67aabccd535c2;hp=ec42112b1922bbfb408d459a1b458d345f83b8d1;hb=fb8f7887c289ae74d6e8dd85d55ae09e6796e890;hpb=c9384515a81cb64d345b299908b2852f51bb8e6e diff --git a/src/calc/basic.h b/src/calc/basic.h index ec42112..bc35baf 100644 --- a/src/calc/basic.h +++ b/src/calc/basic.h @@ -23,7 +23,6 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *******************************************************************************/ -#include "php_psi_stdinc.h" #include #include "token.h" @@ -58,12 +57,18 @@ static inline token_t psi_calc_add(token_t t1, impl_val *v1, token_t t2, impl_va case PSI_T_UINT64: res->i64 = v1->i8 + v2->u64; return PSI_T_INT64; +# if HAVE_INT128 case PSI_T_INT128: res->i128 = v1->i8 + v2->i128; return PSI_T_INT128; +# endif + +# if HAVE_UINT128 case PSI_T_UINT128: res->u128 = v1->i8 + v2->u128; return PSI_T_UINT128; +# endif + case PSI_T_FLOAT: res->fval = v1->i8 + v2->fval; return PSI_T_FLOAT; @@ -107,12 +112,18 @@ static inline token_t psi_calc_add(token_t t1, impl_val *v1, token_t t2, impl_va case PSI_T_UINT64: res->u64 = v1->u8 + v2->u64; return PSI_T_UINT64; +# if HAVE_INT128 case PSI_T_INT128: res->i128 = v1->u8 + v2->i128; return PSI_T_INT128; +# endif + +# if HAVE_UINT128 case PSI_T_UINT128: res->u128 = v1->u8 + v2->u128; return PSI_T_UINT128; +# endif + case PSI_T_FLOAT: res->fval = v1->u8 + v2->fval; return PSI_T_FLOAT; @@ -156,12 +167,18 @@ static inline token_t psi_calc_add(token_t t1, impl_val *v1, token_t t2, impl_va case PSI_T_UINT64: res->i64 = v1->i16 + v2->u64; return PSI_T_INT64; +# if HAVE_INT128 case PSI_T_INT128: res->i128 = v1->i16 + v2->i128; return PSI_T_INT128; +# endif + +# if HAVE_UINT128 case PSI_T_UINT128: res->u128 = v1->i16 + v2->u128; return PSI_T_UINT128; +# endif + case PSI_T_FLOAT: res->fval = v1->i16 + v2->fval; return PSI_T_FLOAT; @@ -205,12 +222,18 @@ static inline token_t psi_calc_add(token_t t1, impl_val *v1, token_t t2, impl_va case PSI_T_UINT64: res->u64 = v1->u16 + v2->u64; return PSI_T_UINT64; +# if HAVE_INT128 case PSI_T_INT128: res->i128 = v1->u16 + v2->i128; return PSI_T_INT128; +# endif + +# if HAVE_UINT128 case PSI_T_UINT128: res->u128 = v1->u16 + v2->u128; return PSI_T_UINT128; +# endif + case PSI_T_FLOAT: res->fval = v1->u16 + v2->fval; return PSI_T_FLOAT; @@ -254,12 +277,18 @@ static inline token_t psi_calc_add(token_t t1, impl_val *v1, token_t t2, impl_va case PSI_T_UINT64: res->i64 = v1->i32 + v2->u64; return PSI_T_INT64; +# if HAVE_INT128 case PSI_T_INT128: res->i128 = v1->i32 + v2->i128; return PSI_T_INT128; +# endif + +# if HAVE_UINT128 case PSI_T_UINT128: res->u128 = v1->i32 + v2->u128; return PSI_T_UINT128; +# endif + case PSI_T_FLOAT: res->fval = v1->i32 + v2->fval; return PSI_T_FLOAT; @@ -303,12 +332,18 @@ static inline token_t psi_calc_add(token_t t1, impl_val *v1, token_t t2, impl_va case PSI_T_UINT64: res->u64 = v1->u32 + v2->u64; return PSI_T_UINT64; +# if HAVE_INT128 case PSI_T_INT128: res->i128 = v1->u32 + v2->i128; return PSI_T_INT128; +# endif + +# if HAVE_UINT128 case PSI_T_UINT128: res->u128 = v1->u32 + v2->u128; return PSI_T_UINT128; +# endif + case PSI_T_FLOAT: res->fval = v1->u32 + v2->fval; return PSI_T_FLOAT; @@ -352,12 +387,18 @@ static inline token_t psi_calc_add(token_t t1, impl_val *v1, token_t t2, impl_va case PSI_T_UINT64: res->i64 = v1->i64 + v2->u64; return PSI_T_INT64; +# if HAVE_INT128 case PSI_T_INT128: res->i128 = v1->i64 + v2->i128; return PSI_T_INT128; +# endif + +# if HAVE_UINT128 case PSI_T_UINT128: res->u128 = v1->i64 + v2->u128; return PSI_T_UINT128; +# endif + case PSI_T_FLOAT: res->fval = v1->i64 + v2->fval; return PSI_T_FLOAT; @@ -401,12 +442,18 @@ static inline token_t psi_calc_add(token_t t1, impl_val *v1, token_t t2, impl_va case PSI_T_UINT64: res->u64 = v1->u64 + v2->u64; return PSI_T_UINT64; +# if HAVE_INT128 case PSI_T_INT128: res->i128 = v1->u64 + v2->i128; return PSI_T_INT128; +# endif + +# if HAVE_UINT128 case PSI_T_UINT128: res->u128 = v1->u64 + v2->u128; return PSI_T_UINT128; +# endif + case PSI_T_FLOAT: res->fval = v1->u64 + v2->fval; return PSI_T_FLOAT; @@ -424,6 +471,7 @@ static inline token_t psi_calc_add(token_t t1, impl_val *v1, token_t t2, impl_va break; } break; +#if HAVE_INT128 case PSI_T_INT128: switch (t2) { case PSI_T_INT8: @@ -450,12 +498,18 @@ static inline token_t psi_calc_add(token_t t1, impl_val *v1, token_t t2, impl_va case PSI_T_UINT64: res->i128 = v1->i128 + v2->u64; return PSI_T_INT128; +# if HAVE_INT128 case PSI_T_INT128: res->i128 = v1->i128 + v2->i128; return PSI_T_INT128; +# endif + +# if HAVE_UINT128 case PSI_T_UINT128: res->u128 = v1->i128 + v2->u128; return PSI_T_UINT128; +# endif + case PSI_T_FLOAT: res->fval = v1->i128 + v2->fval; return PSI_T_FLOAT; @@ -473,6 +527,9 @@ static inline token_t psi_calc_add(token_t t1, impl_val *v1, token_t t2, impl_va break; } break; +#endif + +#if HAVE_UINT128 case PSI_T_UINT128: switch (t2) { case PSI_T_INT8: @@ -499,12 +556,18 @@ static inline token_t psi_calc_add(token_t t1, impl_val *v1, token_t t2, impl_va case PSI_T_UINT64: res->u128 = v1->u128 + v2->u64; return PSI_T_UINT128; +# if HAVE_INT128 case PSI_T_INT128: res->u128 = v1->u128 + v2->i128; return PSI_T_UINT128; +# endif + +# if HAVE_UINT128 case PSI_T_UINT128: res->u128 = v1->u128 + v2->u128; return PSI_T_UINT128; +# endif + case PSI_T_FLOAT: res->fval = v1->u128 + v2->fval; return PSI_T_FLOAT; @@ -522,6 +585,8 @@ static inline token_t psi_calc_add(token_t t1, impl_val *v1, token_t t2, impl_va break; } break; +#endif + case PSI_T_FLOAT: switch (t2) { case PSI_T_INT8: @@ -548,12 +613,18 @@ static inline token_t psi_calc_add(token_t t1, impl_val *v1, token_t t2, impl_va case PSI_T_UINT64: res->fval = v1->fval + v2->u64; return PSI_T_FLOAT; +# if HAVE_INT128 case PSI_T_INT128: res->fval = v1->fval + v2->i128; return PSI_T_FLOAT; +# endif + +# if HAVE_UINT128 case PSI_T_UINT128: res->fval = v1->fval + v2->u128; return PSI_T_FLOAT; +# endif + case PSI_T_FLOAT: res->fval = v1->fval + v2->fval; return PSI_T_FLOAT; @@ -597,12 +668,18 @@ static inline token_t psi_calc_add(token_t t1, impl_val *v1, token_t t2, impl_va case PSI_T_UINT64: res->dval = v1->dval + v2->u64; return PSI_T_DOUBLE; +# if HAVE_INT128 case PSI_T_INT128: res->dval = v1->dval + v2->i128; return PSI_T_DOUBLE; +# endif + +# if HAVE_UINT128 case PSI_T_UINT128: res->dval = v1->dval + v2->u128; return PSI_T_DOUBLE; +# endif + case PSI_T_FLOAT: res->dval = v1->dval + v2->fval; return PSI_T_DOUBLE; @@ -647,12 +724,18 @@ static inline token_t psi_calc_add(token_t t1, impl_val *v1, token_t t2, impl_va case PSI_T_UINT64: res->ldval = v1->ldval + v2->u64; return PSI_T_LONG_DOUBLE; +# if HAVE_INT128 case PSI_T_INT128: res->ldval = v1->ldval + v2->i128; return PSI_T_LONG_DOUBLE; +# endif + +# if HAVE_UINT128 case PSI_T_UINT128: res->ldval = v1->ldval + v2->u128; return PSI_T_LONG_DOUBLE; +# endif + case PSI_T_FLOAT: res->ldval = v1->ldval + v2->fval; return PSI_T_LONG_DOUBLE; @@ -709,12 +792,18 @@ static inline token_t psi_calc_sub(token_t t1, impl_val *v1, token_t t2, impl_va case PSI_T_UINT64: res->i64 = v1->i8 - v2->u64; return PSI_T_INT64; +# if HAVE_INT128 case PSI_T_INT128: res->i128 = v1->i8 - v2->i128; return PSI_T_INT128; +# endif + +# if HAVE_UINT128 case PSI_T_UINT128: res->u128 = v1->i8 - v2->u128; return PSI_T_UINT128; +# endif + case PSI_T_FLOAT: res->fval = v1->i8 - v2->fval; return PSI_T_FLOAT; @@ -758,12 +847,18 @@ static inline token_t psi_calc_sub(token_t t1, impl_val *v1, token_t t2, impl_va case PSI_T_UINT64: res->u64 = v1->u8 - v2->u64; return PSI_T_UINT64; +# if HAVE_INT128 case PSI_T_INT128: res->i128 = v1->u8 - v2->i128; return PSI_T_INT128; +# endif + +# if HAVE_UINT128 case PSI_T_UINT128: res->u128 = v1->u8 - v2->u128; return PSI_T_UINT128; +# endif + case PSI_T_FLOAT: res->fval = v1->u8 - v2->fval; return PSI_T_FLOAT; @@ -807,12 +902,18 @@ static inline token_t psi_calc_sub(token_t t1, impl_val *v1, token_t t2, impl_va case PSI_T_UINT64: res->i64 = v1->i16 - v2->u64; return PSI_T_INT64; +# if HAVE_INT128 case PSI_T_INT128: res->i128 = v1->i16 - v2->i128; return PSI_T_INT128; +# endif + +# if HAVE_UINT128 case PSI_T_UINT128: res->u128 = v1->i16 - v2->u128; return PSI_T_UINT128; +# endif + case PSI_T_FLOAT: res->fval = v1->i16 - v2->fval; return PSI_T_FLOAT; @@ -856,12 +957,18 @@ static inline token_t psi_calc_sub(token_t t1, impl_val *v1, token_t t2, impl_va case PSI_T_UINT64: res->u64 = v1->u16 - v2->u64; return PSI_T_UINT64; +# if HAVE_INT128 case PSI_T_INT128: res->i128 = v1->u16 - v2->i128; return PSI_T_INT128; +# endif + +# if HAVE_UINT128 case PSI_T_UINT128: res->u128 = v1->u16 - v2->u128; return PSI_T_UINT128; +# endif + case PSI_T_FLOAT: res->fval = v1->u16 - v2->fval; return PSI_T_FLOAT; @@ -905,12 +1012,18 @@ static inline token_t psi_calc_sub(token_t t1, impl_val *v1, token_t t2, impl_va case PSI_T_UINT64: res->i64 = v1->i32 - v2->u64; return PSI_T_INT64; +# if HAVE_INT128 case PSI_T_INT128: res->i128 = v1->i32 - v2->i128; return PSI_T_INT128; +# endif + +# if HAVE_UINT128 case PSI_T_UINT128: res->u128 = v1->i32 - v2->u128; return PSI_T_UINT128; +# endif + case PSI_T_FLOAT: res->fval = v1->i32 - v2->fval; return PSI_T_FLOAT; @@ -954,12 +1067,18 @@ static inline token_t psi_calc_sub(token_t t1, impl_val *v1, token_t t2, impl_va case PSI_T_UINT64: res->u64 = v1->u32 - v2->u64; return PSI_T_UINT64; +# if HAVE_INT128 case PSI_T_INT128: res->i128 = v1->u32 - v2->i128; return PSI_T_INT128; +# endif + +# if HAVE_UINT128 case PSI_T_UINT128: res->u128 = v1->u32 - v2->u128; return PSI_T_UINT128; +# endif + case PSI_T_FLOAT: res->fval = v1->u32 - v2->fval; return PSI_T_FLOAT; @@ -1003,12 +1122,18 @@ static inline token_t psi_calc_sub(token_t t1, impl_val *v1, token_t t2, impl_va case PSI_T_UINT64: res->i64 = v1->i64 - v2->u64; return PSI_T_INT64; +# if HAVE_INT128 case PSI_T_INT128: res->i128 = v1->i64 - v2->i128; return PSI_T_INT128; +# endif + +# if HAVE_UINT128 case PSI_T_UINT128: res->u128 = v1->i64 - v2->u128; return PSI_T_UINT128; +# endif + case PSI_T_FLOAT: res->fval = v1->i64 - v2->fval; return PSI_T_FLOAT; @@ -1052,12 +1177,18 @@ static inline token_t psi_calc_sub(token_t t1, impl_val *v1, token_t t2, impl_va case PSI_T_UINT64: res->u64 = v1->u64 - v2->u64; return PSI_T_UINT64; +# if HAVE_INT128 case PSI_T_INT128: res->i128 = v1->u64 - v2->i128; return PSI_T_INT128; +# endif + +# if HAVE_UINT128 case PSI_T_UINT128: res->u128 = v1->u64 - v2->u128; return PSI_T_UINT128; +# endif + case PSI_T_FLOAT: res->fval = v1->u64 - v2->fval; return PSI_T_FLOAT; @@ -1075,6 +1206,7 @@ static inline token_t psi_calc_sub(token_t t1, impl_val *v1, token_t t2, impl_va break; } break; +#if HAVE_INT128 case PSI_T_INT128: switch (t2) { case PSI_T_INT8: @@ -1101,12 +1233,18 @@ static inline token_t psi_calc_sub(token_t t1, impl_val *v1, token_t t2, impl_va case PSI_T_UINT64: res->i128 = v1->i128 - v2->u64; return PSI_T_INT128; +# if HAVE_INT128 case PSI_T_INT128: res->i128 = v1->i128 - v2->i128; return PSI_T_INT128; +# endif + +# if HAVE_UINT128 case PSI_T_UINT128: res->u128 = v1->i128 - v2->u128; return PSI_T_UINT128; +# endif + case PSI_T_FLOAT: res->fval = v1->i128 - v2->fval; return PSI_T_FLOAT; @@ -1124,6 +1262,9 @@ static inline token_t psi_calc_sub(token_t t1, impl_val *v1, token_t t2, impl_va break; } break; +#endif + +#if HAVE_UINT128 case PSI_T_UINT128: switch (t2) { case PSI_T_INT8: @@ -1150,12 +1291,18 @@ static inline token_t psi_calc_sub(token_t t1, impl_val *v1, token_t t2, impl_va case PSI_T_UINT64: res->u128 = v1->u128 - v2->u64; return PSI_T_UINT128; +# if HAVE_INT128 case PSI_T_INT128: res->u128 = v1->u128 - v2->i128; return PSI_T_UINT128; +# endif + +# if HAVE_UINT128 case PSI_T_UINT128: res->u128 = v1->u128 - v2->u128; return PSI_T_UINT128; +# endif + case PSI_T_FLOAT: res->fval = v1->u128 - v2->fval; return PSI_T_FLOAT; @@ -1173,6 +1320,8 @@ static inline token_t psi_calc_sub(token_t t1, impl_val *v1, token_t t2, impl_va break; } break; +#endif + case PSI_T_FLOAT: switch (t2) { case PSI_T_INT8: @@ -1199,12 +1348,18 @@ static inline token_t psi_calc_sub(token_t t1, impl_val *v1, token_t t2, impl_va case PSI_T_UINT64: res->fval = v1->fval - v2->u64; return PSI_T_FLOAT; +# if HAVE_INT128 case PSI_T_INT128: res->fval = v1->fval - v2->i128; return PSI_T_FLOAT; +# endif + +# if HAVE_UINT128 case PSI_T_UINT128: res->fval = v1->fval - v2->u128; return PSI_T_FLOAT; +# endif + case PSI_T_FLOAT: res->fval = v1->fval - v2->fval; return PSI_T_FLOAT; @@ -1248,12 +1403,18 @@ static inline token_t psi_calc_sub(token_t t1, impl_val *v1, token_t t2, impl_va case PSI_T_UINT64: res->dval = v1->dval - v2->u64; return PSI_T_DOUBLE; +# if HAVE_INT128 case PSI_T_INT128: res->dval = v1->dval - v2->i128; return PSI_T_DOUBLE; +# endif + +# if HAVE_UINT128 case PSI_T_UINT128: res->dval = v1->dval - v2->u128; return PSI_T_DOUBLE; +# endif + case PSI_T_FLOAT: res->dval = v1->dval - v2->fval; return PSI_T_DOUBLE; @@ -1298,12 +1459,18 @@ static inline token_t psi_calc_sub(token_t t1, impl_val *v1, token_t t2, impl_va case PSI_T_UINT64: res->ldval = v1->ldval - v2->u64; return PSI_T_LONG_DOUBLE; +# if HAVE_INT128 case PSI_T_INT128: res->ldval = v1->ldval - v2->i128; return PSI_T_LONG_DOUBLE; +# endif + +# if HAVE_UINT128 case PSI_T_UINT128: res->ldval = v1->ldval - v2->u128; return PSI_T_LONG_DOUBLE; +# endif + case PSI_T_FLOAT: res->ldval = v1->ldval - v2->fval; return PSI_T_LONG_DOUBLE; @@ -1360,12 +1527,18 @@ static inline token_t psi_calc_mul(token_t t1, impl_val *v1, token_t t2, impl_va case PSI_T_UINT64: res->i64 = v1->i8 * v2->u64; return PSI_T_INT64; +# if HAVE_INT128 case PSI_T_INT128: res->i128 = v1->i8 * v2->i128; return PSI_T_INT128; +# endif + +# if HAVE_UINT128 case PSI_T_UINT128: res->u128 = v1->i8 * v2->u128; return PSI_T_UINT128; +# endif + case PSI_T_FLOAT: res->fval = v1->i8 * v2->fval; return PSI_T_FLOAT; @@ -1409,12 +1582,18 @@ static inline token_t psi_calc_mul(token_t t1, impl_val *v1, token_t t2, impl_va case PSI_T_UINT64: res->u64 = v1->u8 * v2->u64; return PSI_T_UINT64; +# if HAVE_INT128 case PSI_T_INT128: res->i128 = v1->u8 * v2->i128; return PSI_T_INT128; +# endif + +# if HAVE_UINT128 case PSI_T_UINT128: res->u128 = v1->u8 * v2->u128; return PSI_T_UINT128; +# endif + case PSI_T_FLOAT: res->fval = v1->u8 * v2->fval; return PSI_T_FLOAT; @@ -1458,12 +1637,18 @@ static inline token_t psi_calc_mul(token_t t1, impl_val *v1, token_t t2, impl_va case PSI_T_UINT64: res->i64 = v1->i16 * v2->u64; return PSI_T_INT64; +# if HAVE_INT128 case PSI_T_INT128: res->i128 = v1->i16 * v2->i128; return PSI_T_INT128; +# endif + +# if HAVE_UINT128 case PSI_T_UINT128: res->u128 = v1->i16 * v2->u128; return PSI_T_UINT128; +# endif + case PSI_T_FLOAT: res->fval = v1->i16 * v2->fval; return PSI_T_FLOAT; @@ -1507,12 +1692,18 @@ static inline token_t psi_calc_mul(token_t t1, impl_val *v1, token_t t2, impl_va case PSI_T_UINT64: res->u64 = v1->u16 * v2->u64; return PSI_T_UINT64; +# if HAVE_INT128 case PSI_T_INT128: res->i128 = v1->u16 * v2->i128; return PSI_T_INT128; +# endif + +# if HAVE_UINT128 case PSI_T_UINT128: res->u128 = v1->u16 * v2->u128; return PSI_T_UINT128; +# endif + case PSI_T_FLOAT: res->fval = v1->u16 * v2->fval; return PSI_T_FLOAT; @@ -1556,12 +1747,18 @@ static inline token_t psi_calc_mul(token_t t1, impl_val *v1, token_t t2, impl_va case PSI_T_UINT64: res->i64 = v1->i32 * v2->u64; return PSI_T_INT64; +# if HAVE_INT128 case PSI_T_INT128: res->i128 = v1->i32 * v2->i128; return PSI_T_INT128; +# endif + +# if HAVE_UINT128 case PSI_T_UINT128: res->u128 = v1->i32 * v2->u128; return PSI_T_UINT128; +# endif + case PSI_T_FLOAT: res->fval = v1->i32 * v2->fval; return PSI_T_FLOAT; @@ -1605,12 +1802,18 @@ static inline token_t psi_calc_mul(token_t t1, impl_val *v1, token_t t2, impl_va case PSI_T_UINT64: res->u64 = v1->u32 * v2->u64; return PSI_T_UINT64; +# if HAVE_INT128 case PSI_T_INT128: res->i128 = v1->u32 * v2->i128; return PSI_T_INT128; +# endif + +# if HAVE_UINT128 case PSI_T_UINT128: res->u128 = v1->u32 * v2->u128; return PSI_T_UINT128; +# endif + case PSI_T_FLOAT: res->fval = v1->u32 * v2->fval; return PSI_T_FLOAT; @@ -1654,12 +1857,18 @@ static inline token_t psi_calc_mul(token_t t1, impl_val *v1, token_t t2, impl_va case PSI_T_UINT64: res->i64 = v1->i64 * v2->u64; return PSI_T_INT64; +# if HAVE_INT128 case PSI_T_INT128: res->i128 = v1->i64 * v2->i128; return PSI_T_INT128; +# endif + +# if HAVE_UINT128 case PSI_T_UINT128: res->u128 = v1->i64 * v2->u128; return PSI_T_UINT128; +# endif + case PSI_T_FLOAT: res->fval = v1->i64 * v2->fval; return PSI_T_FLOAT; @@ -1703,12 +1912,18 @@ static inline token_t psi_calc_mul(token_t t1, impl_val *v1, token_t t2, impl_va case PSI_T_UINT64: res->u64 = v1->u64 * v2->u64; return PSI_T_UINT64; +# if HAVE_INT128 case PSI_T_INT128: res->i128 = v1->u64 * v2->i128; return PSI_T_INT128; +# endif + +# if HAVE_UINT128 case PSI_T_UINT128: res->u128 = v1->u64 * v2->u128; return PSI_T_UINT128; +# endif + case PSI_T_FLOAT: res->fval = v1->u64 * v2->fval; return PSI_T_FLOAT; @@ -1726,6 +1941,7 @@ static inline token_t psi_calc_mul(token_t t1, impl_val *v1, token_t t2, impl_va break; } break; +#if HAVE_INT128 case PSI_T_INT128: switch (t2) { case PSI_T_INT8: @@ -1752,12 +1968,18 @@ static inline token_t psi_calc_mul(token_t t1, impl_val *v1, token_t t2, impl_va case PSI_T_UINT64: res->i128 = v1->i128 * v2->u64; return PSI_T_INT128; +# if HAVE_INT128 case PSI_T_INT128: res->i128 = v1->i128 * v2->i128; return PSI_T_INT128; +# endif + +# if HAVE_UINT128 case PSI_T_UINT128: res->u128 = v1->i128 * v2->u128; return PSI_T_UINT128; +# endif + case PSI_T_FLOAT: res->fval = v1->i128 * v2->fval; return PSI_T_FLOAT; @@ -1775,6 +1997,9 @@ static inline token_t psi_calc_mul(token_t t1, impl_val *v1, token_t t2, impl_va break; } break; +#endif + +#if HAVE_UINT128 case PSI_T_UINT128: switch (t2) { case PSI_T_INT8: @@ -1801,12 +2026,18 @@ static inline token_t psi_calc_mul(token_t t1, impl_val *v1, token_t t2, impl_va case PSI_T_UINT64: res->u128 = v1->u128 * v2->u64; return PSI_T_UINT128; +# if HAVE_INT128 case PSI_T_INT128: res->u128 = v1->u128 * v2->i128; return PSI_T_UINT128; +# endif + +# if HAVE_UINT128 case PSI_T_UINT128: res->u128 = v1->u128 * v2->u128; return PSI_T_UINT128; +# endif + case PSI_T_FLOAT: res->fval = v1->u128 * v2->fval; return PSI_T_FLOAT; @@ -1824,6 +2055,8 @@ static inline token_t psi_calc_mul(token_t t1, impl_val *v1, token_t t2, impl_va break; } break; +#endif + case PSI_T_FLOAT: switch (t2) { case PSI_T_INT8: @@ -1850,12 +2083,18 @@ static inline token_t psi_calc_mul(token_t t1, impl_val *v1, token_t t2, impl_va case PSI_T_UINT64: res->fval = v1->fval * v2->u64; return PSI_T_FLOAT; +# if HAVE_INT128 case PSI_T_INT128: res->fval = v1->fval * v2->i128; return PSI_T_FLOAT; +# endif + +# if HAVE_UINT128 case PSI_T_UINT128: res->fval = v1->fval * v2->u128; return PSI_T_FLOAT; +# endif + case PSI_T_FLOAT: res->fval = v1->fval * v2->fval; return PSI_T_FLOAT; @@ -1899,12 +2138,18 @@ static inline token_t psi_calc_mul(token_t t1, impl_val *v1, token_t t2, impl_va case PSI_T_UINT64: res->dval = v1->dval * v2->u64; return PSI_T_DOUBLE; +# if HAVE_INT128 case PSI_T_INT128: res->dval = v1->dval * v2->i128; return PSI_T_DOUBLE; +# endif + +# if HAVE_UINT128 case PSI_T_UINT128: res->dval = v1->dval * v2->u128; return PSI_T_DOUBLE; +# endif + case PSI_T_FLOAT: res->dval = v1->dval * v2->fval; return PSI_T_DOUBLE; @@ -1949,12 +2194,18 @@ static inline token_t psi_calc_mul(token_t t1, impl_val *v1, token_t t2, impl_va case PSI_T_UINT64: res->ldval = v1->ldval * v2->u64; return PSI_T_LONG_DOUBLE; +# if HAVE_INT128 case PSI_T_INT128: res->ldval = v1->ldval * v2->i128; return PSI_T_LONG_DOUBLE; +# endif + +# if HAVE_UINT128 case PSI_T_UINT128: res->ldval = v1->ldval * v2->u128; return PSI_T_LONG_DOUBLE; +# endif + case PSI_T_FLOAT: res->ldval = v1->ldval * v2->fval; return PSI_T_LONG_DOUBLE; @@ -2011,12 +2262,18 @@ static inline token_t psi_calc_div(token_t t1, impl_val *v1, token_t t2, impl_va case PSI_T_UINT64: res->i64 = v1->i8 / v2->u64; return PSI_T_INT64; +# if HAVE_INT128 case PSI_T_INT128: res->i128 = v1->i8 / v2->i128; return PSI_T_INT128; +# endif + +# if HAVE_UINT128 case PSI_T_UINT128: res->u128 = v1->i8 / v2->u128; return PSI_T_UINT128; +# endif + case PSI_T_FLOAT: res->fval = v1->i8 / v2->fval; return PSI_T_FLOAT; @@ -2060,12 +2317,18 @@ static inline token_t psi_calc_div(token_t t1, impl_val *v1, token_t t2, impl_va case PSI_T_UINT64: res->u64 = v1->u8 / v2->u64; return PSI_T_UINT64; +# if HAVE_INT128 case PSI_T_INT128: res->i128 = v1->u8 / v2->i128; return PSI_T_INT128; +# endif + +# if HAVE_UINT128 case PSI_T_UINT128: res->u128 = v1->u8 / v2->u128; return PSI_T_UINT128; +# endif + case PSI_T_FLOAT: res->fval = v1->u8 / v2->fval; return PSI_T_FLOAT; @@ -2109,12 +2372,18 @@ static inline token_t psi_calc_div(token_t t1, impl_val *v1, token_t t2, impl_va case PSI_T_UINT64: res->i64 = v1->i16 / v2->u64; return PSI_T_INT64; +# if HAVE_INT128 case PSI_T_INT128: res->i128 = v1->i16 / v2->i128; return PSI_T_INT128; +# endif + +# if HAVE_UINT128 case PSI_T_UINT128: res->u128 = v1->i16 / v2->u128; return PSI_T_UINT128; +# endif + case PSI_T_FLOAT: res->fval = v1->i16 / v2->fval; return PSI_T_FLOAT; @@ -2158,12 +2427,18 @@ static inline token_t psi_calc_div(token_t t1, impl_val *v1, token_t t2, impl_va case PSI_T_UINT64: res->u64 = v1->u16 / v2->u64; return PSI_T_UINT64; +# if HAVE_INT128 case PSI_T_INT128: res->i128 = v1->u16 / v2->i128; return PSI_T_INT128; +# endif + +# if HAVE_UINT128 case PSI_T_UINT128: res->u128 = v1->u16 / v2->u128; return PSI_T_UINT128; +# endif + case PSI_T_FLOAT: res->fval = v1->u16 / v2->fval; return PSI_T_FLOAT; @@ -2207,12 +2482,18 @@ static inline token_t psi_calc_div(token_t t1, impl_val *v1, token_t t2, impl_va case PSI_T_UINT64: res->i64 = v1->i32 / v2->u64; return PSI_T_INT64; +# if HAVE_INT128 case PSI_T_INT128: res->i128 = v1->i32 / v2->i128; return PSI_T_INT128; +# endif + +# if HAVE_UINT128 case PSI_T_UINT128: res->u128 = v1->i32 / v2->u128; return PSI_T_UINT128; +# endif + case PSI_T_FLOAT: res->fval = v1->i32 / v2->fval; return PSI_T_FLOAT; @@ -2256,12 +2537,18 @@ static inline token_t psi_calc_div(token_t t1, impl_val *v1, token_t t2, impl_va case PSI_T_UINT64: res->u64 = v1->u32 / v2->u64; return PSI_T_UINT64; +# if HAVE_INT128 case PSI_T_INT128: res->i128 = v1->u32 / v2->i128; return PSI_T_INT128; +# endif + +# if HAVE_UINT128 case PSI_T_UINT128: res->u128 = v1->u32 / v2->u128; return PSI_T_UINT128; +# endif + case PSI_T_FLOAT: res->fval = v1->u32 / v2->fval; return PSI_T_FLOAT; @@ -2305,12 +2592,18 @@ static inline token_t psi_calc_div(token_t t1, impl_val *v1, token_t t2, impl_va case PSI_T_UINT64: res->i64 = v1->i64 / v2->u64; return PSI_T_INT64; +# if HAVE_INT128 case PSI_T_INT128: res->i128 = v1->i64 / v2->i128; return PSI_T_INT128; +# endif + +# if HAVE_UINT128 case PSI_T_UINT128: res->u128 = v1->i64 / v2->u128; return PSI_T_UINT128; +# endif + case PSI_T_FLOAT: res->fval = v1->i64 / v2->fval; return PSI_T_FLOAT; @@ -2354,12 +2647,18 @@ static inline token_t psi_calc_div(token_t t1, impl_val *v1, token_t t2, impl_va case PSI_T_UINT64: res->u64 = v1->u64 / v2->u64; return PSI_T_UINT64; +# if HAVE_INT128 case PSI_T_INT128: res->i128 = v1->u64 / v2->i128; return PSI_T_INT128; +# endif + +# if HAVE_UINT128 case PSI_T_UINT128: res->u128 = v1->u64 / v2->u128; return PSI_T_UINT128; +# endif + case PSI_T_FLOAT: res->fval = v1->u64 / v2->fval; return PSI_T_FLOAT; @@ -2377,6 +2676,7 @@ static inline token_t psi_calc_div(token_t t1, impl_val *v1, token_t t2, impl_va break; } break; +#if HAVE_INT128 case PSI_T_INT128: switch (t2) { case PSI_T_INT8: @@ -2403,12 +2703,18 @@ static inline token_t psi_calc_div(token_t t1, impl_val *v1, token_t t2, impl_va case PSI_T_UINT64: res->i128 = v1->i128 / v2->u64; return PSI_T_INT128; +# if HAVE_INT128 case PSI_T_INT128: res->i128 = v1->i128 / v2->i128; return PSI_T_INT128; +# endif + +# if HAVE_UINT128 case PSI_T_UINT128: res->u128 = v1->i128 / v2->u128; return PSI_T_UINT128; +# endif + case PSI_T_FLOAT: res->fval = v1->i128 / v2->fval; return PSI_T_FLOAT; @@ -2426,6 +2732,9 @@ static inline token_t psi_calc_div(token_t t1, impl_val *v1, token_t t2, impl_va break; } break; +#endif + +#if HAVE_UINT128 case PSI_T_UINT128: switch (t2) { case PSI_T_INT8: @@ -2452,12 +2761,18 @@ static inline token_t psi_calc_div(token_t t1, impl_val *v1, token_t t2, impl_va case PSI_T_UINT64: res->u128 = v1->u128 / v2->u64; return PSI_T_UINT128; +# if HAVE_INT128 case PSI_T_INT128: res->u128 = v1->u128 / v2->i128; return PSI_T_UINT128; +# endif + +# if HAVE_UINT128 case PSI_T_UINT128: res->u128 = v1->u128 / v2->u128; return PSI_T_UINT128; +# endif + case PSI_T_FLOAT: res->fval = v1->u128 / v2->fval; return PSI_T_FLOAT; @@ -2475,6 +2790,8 @@ static inline token_t psi_calc_div(token_t t1, impl_val *v1, token_t t2, impl_va break; } break; +#endif + case PSI_T_FLOAT: switch (t2) { case PSI_T_INT8: @@ -2501,12 +2818,18 @@ static inline token_t psi_calc_div(token_t t1, impl_val *v1, token_t t2, impl_va case PSI_T_UINT64: res->fval = v1->fval / v2->u64; return PSI_T_FLOAT; +# if HAVE_INT128 case PSI_T_INT128: res->fval = v1->fval / v2->i128; return PSI_T_FLOAT; +# endif + +# if HAVE_UINT128 case PSI_T_UINT128: res->fval = v1->fval / v2->u128; return PSI_T_FLOAT; +# endif + case PSI_T_FLOAT: res->fval = v1->fval / v2->fval; return PSI_T_FLOAT; @@ -2550,12 +2873,18 @@ static inline token_t psi_calc_div(token_t t1, impl_val *v1, token_t t2, impl_va case PSI_T_UINT64: res->dval = v1->dval / v2->u64; return PSI_T_DOUBLE; +# if HAVE_INT128 case PSI_T_INT128: res->dval = v1->dval / v2->i128; return PSI_T_DOUBLE; +# endif + +# if HAVE_UINT128 case PSI_T_UINT128: res->dval = v1->dval / v2->u128; return PSI_T_DOUBLE; +# endif + case PSI_T_FLOAT: res->dval = v1->dval / v2->fval; return PSI_T_DOUBLE; @@ -2600,12 +2929,18 @@ static inline token_t psi_calc_div(token_t t1, impl_val *v1, token_t t2, impl_va case PSI_T_UINT64: res->ldval = v1->ldval / v2->u64; return PSI_T_LONG_DOUBLE; +# if HAVE_INT128 case PSI_T_INT128: res->ldval = v1->ldval / v2->i128; return PSI_T_LONG_DOUBLE; +# endif + +# if HAVE_UINT128 case PSI_T_UINT128: res->ldval = v1->ldval / v2->u128; return PSI_T_LONG_DOUBLE; +# endif + case PSI_T_FLOAT: res->ldval = v1->ldval / v2->fval; return PSI_T_LONG_DOUBLE; @@ -2671,14 +3006,20 @@ static inline token_t psi_calc_mod(token_t t1, impl_val *v1, token_t t2, impl_va i1.i64 = v1->u64; break; +#if HAVE_INT128 case PSI_T_INT128: i1.i64 = v1->i128; break; +#endif + +#if HAVE_UINT128 case PSI_T_UINT128: i1.i64 = v1->u128; break; +#endif + case PSI_T_FLOAT: i1.i64 = v1->fval; break; @@ -2724,12 +3065,18 @@ static inline token_t psi_calc_mod(token_t t1, impl_val *v1, token_t t2, impl_va case PSI_T_UINT64: i2.i64 = v2->u64; break; +#if HAVE_INT128 case PSI_T_INT128: i2.i64 = v2->i128; break; +#endif + +#if HAVE_UINT128 case PSI_T_UINT128: i2.i64 = v2->u128; break; +#endif + case PSI_T_FLOAT: i2.i64 = v2->fval; break;