X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=src%2Fcalc%2Fbool.h;h=5fe0ce7294451dc817298f0b904c0bdc41351ccf;hb=fe451dea5c2e622db1e8610f742752a73a21b865;hp=99f5f0a352315fce0885aacfa3c34983816ab0d4;hpb=52ed5940ed0ab3cafd36fbded2e83c92563e7b2b;p=m6w6%2Fext-psi diff --git a/src/calc/bool.h b/src/calc/bool.h index 99f5f0a..5fe0ce7 100644 --- a/src/calc/bool.h +++ b/src/calc/bool.h @@ -27,56 +27,6 @@ #include #include "token.h" - -static inline token_t psi_calc_bool_not(token_t t1, impl_val *v1, token_t t2, impl_val *v2, impl_val *res) -{ - (void) t2; - (void) v2; - - switch (t1) { - case PSI_T_INT8: - res->u8 = !v1->i8; - break; - case PSI_T_UINT8: - res->u8 = !v1->u8; - break; - case PSI_T_INT16: - res->u8 = !v1->i16; - break; - case PSI_T_UINT16: - res->u8 = !v1->u16; - break; - case PSI_T_INT32: - res->u8 = !v1->i32; - break; - case PSI_T_UINT32: - res->u8 = !v1->u32; - break; - case PSI_T_INT64: - res->u8 = !v1->i64; - break; - case PSI_T_UINT64: - res->u8 = !v1->u64; - break; - case PSI_T_FLOAT: - res->u8 = !v1->fval; - break; - case PSI_T_DOUBLE: - res->u8 = !v1->dval; - break; -#if HAVE_LONG_DOUBLE - case PSI_T_LONG_DOUBLE: - res->u8 = !v1->ldval; - break; -#endif - - default: - assert(0); - break; - } - return PSI_T_UINT8; -} - static inline token_t psi_calc_bool_or(token_t t1, impl_val *v1, token_t t2, impl_val *v2, impl_val *res) { switch (t1) { @@ -112,6 +62,14 @@ static inline token_t psi_calc_bool_or(token_t t1, impl_val *v1, token_t t2, imp if (v1->u64) goto return_true; break; + case PSI_T_INT128: + if (v1->i128) + goto return_true; + break; + case PSI_T_UINT128: + if (v1->u128) + goto return_true; + break; case PSI_T_FLOAT: if (v1->fval) goto return_true; @@ -165,6 +123,14 @@ static inline token_t psi_calc_bool_or(token_t t1, impl_val *v1, token_t t2, imp if (v2->u64) goto return_true; break; + case PSI_T_INT128: + if (v2->i128) + goto return_true; + break; + case PSI_T_UINT128: + if (v2->u128) + goto return_true; + break; case PSI_T_FLOAT: if (v2->fval) goto return_true; @@ -228,6 +194,14 @@ static inline token_t psi_calc_bool_and(token_t t1, impl_val *v1, token_t t2, im if (!v1->u64) goto return_false; break; + case PSI_T_INT128: + if (!v1->i128) + goto return_false; + break; + case PSI_T_UINT128: + if (!v1->u128) + goto return_false; + break; case PSI_T_FLOAT: if (!v1->fval) goto return_false; @@ -281,6 +255,14 @@ static inline token_t psi_calc_bool_and(token_t t1, impl_val *v1, token_t t2, im if (!v2->u64) goto return_false; break; + case PSI_T_INT128: + if (!v2->i128) + goto return_false; + break; + case PSI_T_UINT128: + if (!v2->u128) + goto return_false; + break; case PSI_T_FLOAT: if (!v2->fval) goto return_false;