ifdef HAVE_INT128
authorMichael Wallner <mike@php.net>
Tue, 17 Apr 2018 11:27:05 +0000 (13:27 +0200)
committerMichael Wallner <mike@php.net>
Tue, 17 Apr 2018 11:27:05 +0000 (13:27 +0200)
Makefile.frag
scripts/_include.php
scripts/gen_calc_basic.php
scripts/gen_calc_bin.php
src/calc/basic.h
src/calc/bin.h
src/calc/bool.h
src/calc/cast.h
src/calc/cmp.h
src/calc/unary.h
src/marshal.c

index 91499f6459c5ad24268a05cca2479fd65cc4ba54..1cd17bd25cc5296e3d40fe58bdda5e9ab620d6a5 100644 (file)
@@ -24,7 +24,7 @@ $(PHP_PSI_SRCDIR)/src/parser.c: $(PHP_PSI_SRCDIR)/src/parser.re
        # trickery needed for relative #line directives
        cd $(PHP_PSI_SRCDIR) && $(RE2C) -o $(patsubst $(PHP_PSI_SRCDIR)/%,%,$@) $(patsubst $(PHP_PSI_SRCDIR)/%,%,$<)
 
-$(PHP_PSI_SRCDIR)/src/calc/%.h: $(PHP_PSI_SRCDIR)/scripts/gen_calc_%.php
+$(PHP_PSI_SRCDIR)/src/calc/%.h: $(PHP_PSI_SRCDIR)/scripts/gen_calc_%.php $(PHP_PSI_SRCDIR)/scripts/_include.php
        $(PHP_EXECUTABLE) $< >$@
 
 $(PHP_PSI_SRCDIR)/src/calc.h: | $(PHP_PSI_SRCDIR)/src/calc/basic.h $(PHP_PSI_SRCDIR)/src/calc/bin.h $(PHP_PSI_SRCDIR)/src/calc/bool.h $(PHP_PSI_SRCDIR)/src/calc/unary.h $(PHP_PSI_SRCDIR)/src/calc/cast.h $(PHP_PSI_SRCDIR)/src/calc/cmp.h $(PHP_PSI_SRCDIR)/src/calc/oper.h
index 67a73ca8ed69d7eaf51c48f3b261463be87d32e7..f918dab8390abb1d7069aae49c776756c690eb8b 100644 (file)
@@ -31,8 +31,8 @@ function t_is_int($t) {
 
 function t_is_special($t) {
        switch ($t) {
-               case "INT128_T":
-               case "UINT128_T":
+               case "INT128":
+               case "UINT128":
                case "LONG_DOUBLE":
                        return true;
                default:
index 0af83a8ec4b98221991598edd32d1c0d2a0aae8f..d08c79b3f32a8d5c3f4f8437d62cc15f2c441337 100644 (file)
@@ -127,11 +127,11 @@ static inline token_t psi_calc_mod(token_t t1, impl_val *v1, token_t t2, impl_va
        case PSI_T_<?=$t2?>:
                i2.i64 = v2-><?=$v2?>;
                break;<?php /*nobr*/ ?>
-       <?php endforeach; ?>
        <?php if (t_is_special($t2)) : ?>
 
 #endif
        <?php endif; ?>
+       <?php endforeach; ?>
 
        default:
                assert(0);
index 5ee92a87553fc3f3ed1ad7b21e590b8928131c0e..6dfece75de8679b3cb028b5bd5fe96b881ae3225 100644 (file)
@@ -49,11 +49,11 @@ static inline token_t psi_calc_bin_<?=$op_name?>(token_t t1, impl_val *v1, token
        case PSI_T_<?=$t2?>:
                i2.u64 = v2-><?=$v2?>;
                break;<?php /*nobr*/ ?>
-       <?php endforeach; ?>
        <?php if (t_is_special($t2)) : ?>
 
 #endif
        <?php endif; ?>
+       <?php endforeach; ?>
 
        default:
                assert(0);
index ec42112b1922bbfb408d459a1b458d345f83b8d1..04660b5c1709f3683dd66b0a16762a5673d43a7b 100644 (file)
@@ -58,12 +58,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 +113,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 +168,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 +223,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 +278,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 +333,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 +388,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 +443,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 +472,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 +499,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 +528,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 +557,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 +586,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 +614,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 +669,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 +725,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 +793,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 +848,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 +903,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 +958,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 +1013,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 +1068,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 +1123,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 +1178,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 +1207,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 +1234,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 +1263,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 +1292,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 +1321,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 +1349,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 +1404,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 +1460,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 +1528,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 +1583,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 +1638,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 +1693,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 +1748,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 +1803,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 +1858,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 +1913,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 +1942,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 +1969,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 +1998,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 +2027,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 +2056,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 +2084,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 +2139,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 +2195,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 +2263,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 +2318,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 +2373,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 +2428,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 +2483,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 +2538,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 +2593,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 +2648,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 +2677,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 +2704,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 +2733,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 +2762,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 +2791,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 +2819,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 +2874,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 +2930,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 +3007,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 +3066,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;
index 772bd9863d52955753d331bf6ebdd8ce76a7bf93..ab79f21206cdb9783b9bba512ea31826cd854ee3 100644 (file)
@@ -65,14 +65,20 @@ static inline token_t psi_calc_bin_lshift(token_t t1, impl_val *v1, token_t t2,
                i1.u64 = v1->u64;
                break;
 
+#if HAVE_INT128
        case PSI_T_INT128:
                i1.u64 = v1->i128;
                break;
 
+#endif
+
+#if HAVE_UINT128
        case PSI_T_UINT128:
                i1.u64 = v1->u128;
                break;
 
+#endif
+
        case PSI_T_FLOAT:
                i1.u64 = v1->fval;
                break;
@@ -118,12 +124,18 @@ static inline token_t psi_calc_bin_lshift(token_t t1, impl_val *v1, token_t t2,
        case PSI_T_UINT64:
                i2.u64 = v2->u64;
                break;
+#if HAVE_INT128
        case PSI_T_INT128:
                i2.u64 = v2->i128;
                break;
+#endif
+
+#if HAVE_UINT128
        case PSI_T_UINT128:
                i2.u64 = v2->u128;
                break;
+#endif
+
        case PSI_T_FLOAT:
                i2.u64 = v2->fval;
                break;
@@ -182,14 +194,20 @@ static inline token_t psi_calc_bin_rshift(token_t t1, impl_val *v1, token_t t2,
                i1.u64 = v1->u64;
                break;
 
+#if HAVE_INT128
        case PSI_T_INT128:
                i1.u64 = v1->i128;
                break;
 
+#endif
+
+#if HAVE_UINT128
        case PSI_T_UINT128:
                i1.u64 = v1->u128;
                break;
 
+#endif
+
        case PSI_T_FLOAT:
                i1.u64 = v1->fval;
                break;
@@ -235,12 +253,18 @@ static inline token_t psi_calc_bin_rshift(token_t t1, impl_val *v1, token_t t2,
        case PSI_T_UINT64:
                i2.u64 = v2->u64;
                break;
+#if HAVE_INT128
        case PSI_T_INT128:
                i2.u64 = v2->i128;
                break;
+#endif
+
+#if HAVE_UINT128
        case PSI_T_UINT128:
                i2.u64 = v2->u128;
                break;
+#endif
+
        case PSI_T_FLOAT:
                i2.u64 = v2->fval;
                break;
@@ -299,14 +323,20 @@ static inline token_t psi_calc_bin_and(token_t t1, impl_val *v1, token_t t2, imp
                i1.u64 = v1->u64;
                break;
 
+#if HAVE_INT128
        case PSI_T_INT128:
                i1.u64 = v1->i128;
                break;
 
+#endif
+
+#if HAVE_UINT128
        case PSI_T_UINT128:
                i1.u64 = v1->u128;
                break;
 
+#endif
+
        case PSI_T_FLOAT:
                i1.u64 = v1->fval;
                break;
@@ -352,12 +382,18 @@ static inline token_t psi_calc_bin_and(token_t t1, impl_val *v1, token_t t2, imp
        case PSI_T_UINT64:
                i2.u64 = v2->u64;
                break;
+#if HAVE_INT128
        case PSI_T_INT128:
                i2.u64 = v2->i128;
                break;
+#endif
+
+#if HAVE_UINT128
        case PSI_T_UINT128:
                i2.u64 = v2->u128;
                break;
+#endif
+
        case PSI_T_FLOAT:
                i2.u64 = v2->fval;
                break;
@@ -416,14 +452,20 @@ static inline token_t psi_calc_bin_xor(token_t t1, impl_val *v1, token_t t2, imp
                i1.u64 = v1->u64;
                break;
 
+#if HAVE_INT128
        case PSI_T_INT128:
                i1.u64 = v1->i128;
                break;
 
+#endif
+
+#if HAVE_UINT128
        case PSI_T_UINT128:
                i1.u64 = v1->u128;
                break;
 
+#endif
+
        case PSI_T_FLOAT:
                i1.u64 = v1->fval;
                break;
@@ -469,12 +511,18 @@ static inline token_t psi_calc_bin_xor(token_t t1, impl_val *v1, token_t t2, imp
        case PSI_T_UINT64:
                i2.u64 = v2->u64;
                break;
+#if HAVE_INT128
        case PSI_T_INT128:
                i2.u64 = v2->i128;
                break;
+#endif
+
+#if HAVE_UINT128
        case PSI_T_UINT128:
                i2.u64 = v2->u128;
                break;
+#endif
+
        case PSI_T_FLOAT:
                i2.u64 = v2->fval;
                break;
@@ -533,14 +581,20 @@ static inline token_t psi_calc_bin_or(token_t t1, impl_val *v1, token_t t2, impl
                i1.u64 = v1->u64;
                break;
 
+#if HAVE_INT128
        case PSI_T_INT128:
                i1.u64 = v1->i128;
                break;
 
+#endif
+
+#if HAVE_UINT128
        case PSI_T_UINT128:
                i1.u64 = v1->u128;
                break;
 
+#endif
+
        case PSI_T_FLOAT:
                i1.u64 = v1->fval;
                break;
@@ -586,12 +640,18 @@ static inline token_t psi_calc_bin_or(token_t t1, impl_val *v1, token_t t2, impl
        case PSI_T_UINT64:
                i2.u64 = v2->u64;
                break;
+#if HAVE_INT128
        case PSI_T_INT128:
                i2.u64 = v2->i128;
                break;
+#endif
+
+#if HAVE_UINT128
        case PSI_T_UINT128:
                i2.u64 = v2->u128;
                break;
+#endif
+
        case PSI_T_FLOAT:
                i2.u64 = v2->fval;
                break;
index 5fe0ce7294451dc817298f0b904c0bdc41351ccf..7560021d1e364dd49e6d0ecacd5cf6623cd3082b 100644 (file)
@@ -62,14 +62,20 @@ 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;
+#if HAVE_INT128
        case PSI_T_INT128:
                if (v1->i128)
                        goto return_true;
                break;
+#endif
+
+#if HAVE_UINT128
        case PSI_T_UINT128:
                if (v1->u128)
                        goto return_true;
                break;
+#endif
+
        case PSI_T_FLOAT:
                if (v1->fval)
                        goto return_true;
@@ -123,14 +129,20 @@ 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;
+#if HAVE_INT128
        case PSI_T_INT128:
                if (v2->i128)
                        goto return_true;
                break;
+#endif
+
+#if HAVE_UINT128
        case PSI_T_UINT128:
                if (v2->u128)
                        goto return_true;
                break;
+#endif
+
        case PSI_T_FLOAT:
                if (v2->fval)
                        goto return_true;
@@ -194,14 +206,20 @@ 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;
+#if HAVE_INT128
        case PSI_T_INT128:
                if (!v1->i128)
                        goto return_false;
                break;
+#endif
+
+#if HAVE_UINT128
        case PSI_T_UINT128:
                if (!v1->u128)
                        goto return_false;
                break;
+#endif
+
        case PSI_T_FLOAT:
                if (!v1->fval)
                        goto return_false;
@@ -255,14 +273,20 @@ 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;
+#if HAVE_INT128
        case PSI_T_INT128:
                if (!v2->i128)
                        goto return_false;
                break;
+#endif
+
+#if HAVE_UINT128
        case PSI_T_UINT128:
                if (!v2->u128)
                        goto return_false;
                break;
+#endif
+
        case PSI_T_FLOAT:
                if (!v2->fval)
                        goto return_false;
index eb93b3b66774980f7d44aca4ea1d84e1532f2247..2d6f3f6dd3c2e7f9f5826f2f98ed17010426ed29 100644 (file)
@@ -57,12 +57,18 @@ static inline void psi_calc_cast(token_t in_type, impl_val *in_val, token_t out_
                case PSI_T_UINT64:
                        out_val->i8 = in_val->u64;
                        break;
+#      if HAVE_INT128
                case PSI_T_INT128:
                        out_val->i8 = in_val->i128;
                        break;
+#      endif
+
+#      if HAVE_UINT128
                case PSI_T_UINT128:
                        out_val->i8 = in_val->u128;
                        break;
+#      endif
+
                case PSI_T_FLOAT:
                        out_val->i8 = in_val->fval;
                        break;
@@ -106,12 +112,18 @@ static inline void psi_calc_cast(token_t in_type, impl_val *in_val, token_t out_
                case PSI_T_UINT64:
                        out_val->u8 = in_val->u64;
                        break;
+#      if HAVE_INT128
                case PSI_T_INT128:
                        out_val->u8 = in_val->i128;
                        break;
+#      endif
+
+#      if HAVE_UINT128
                case PSI_T_UINT128:
                        out_val->u8 = in_val->u128;
                        break;
+#      endif
+
                case PSI_T_FLOAT:
                        out_val->u8 = in_val->fval;
                        break;
@@ -155,12 +167,18 @@ static inline void psi_calc_cast(token_t in_type, impl_val *in_val, token_t out_
                case PSI_T_UINT64:
                        out_val->i16 = in_val->u64;
                        break;
+#      if HAVE_INT128
                case PSI_T_INT128:
                        out_val->i16 = in_val->i128;
                        break;
+#      endif
+
+#      if HAVE_UINT128
                case PSI_T_UINT128:
                        out_val->i16 = in_val->u128;
                        break;
+#      endif
+
                case PSI_T_FLOAT:
                        out_val->i16 = in_val->fval;
                        break;
@@ -204,12 +222,18 @@ static inline void psi_calc_cast(token_t in_type, impl_val *in_val, token_t out_
                case PSI_T_UINT64:
                        out_val->u16 = in_val->u64;
                        break;
+#      if HAVE_INT128
                case PSI_T_INT128:
                        out_val->u16 = in_val->i128;
                        break;
+#      endif
+
+#      if HAVE_UINT128
                case PSI_T_UINT128:
                        out_val->u16 = in_val->u128;
                        break;
+#      endif
+
                case PSI_T_FLOAT:
                        out_val->u16 = in_val->fval;
                        break;
@@ -253,12 +277,18 @@ static inline void psi_calc_cast(token_t in_type, impl_val *in_val, token_t out_
                case PSI_T_UINT64:
                        out_val->i32 = in_val->u64;
                        break;
+#      if HAVE_INT128
                case PSI_T_INT128:
                        out_val->i32 = in_val->i128;
                        break;
+#      endif
+
+#      if HAVE_UINT128
                case PSI_T_UINT128:
                        out_val->i32 = in_val->u128;
                        break;
+#      endif
+
                case PSI_T_FLOAT:
                        out_val->i32 = in_val->fval;
                        break;
@@ -302,12 +332,18 @@ static inline void psi_calc_cast(token_t in_type, impl_val *in_val, token_t out_
                case PSI_T_UINT64:
                        out_val->u32 = in_val->u64;
                        break;
+#      if HAVE_INT128
                case PSI_T_INT128:
                        out_val->u32 = in_val->i128;
                        break;
+#      endif
+
+#      if HAVE_UINT128
                case PSI_T_UINT128:
                        out_val->u32 = in_val->u128;
                        break;
+#      endif
+
                case PSI_T_FLOAT:
                        out_val->u32 = in_val->fval;
                        break;
@@ -351,12 +387,18 @@ static inline void psi_calc_cast(token_t in_type, impl_val *in_val, token_t out_
                case PSI_T_UINT64:
                        out_val->i64 = in_val->u64;
                        break;
+#      if HAVE_INT128
                case PSI_T_INT128:
                        out_val->i64 = in_val->i128;
                        break;
+#      endif
+
+#      if HAVE_UINT128
                case PSI_T_UINT128:
                        out_val->i64 = in_val->u128;
                        break;
+#      endif
+
                case PSI_T_FLOAT:
                        out_val->i64 = in_val->fval;
                        break;
@@ -400,12 +442,18 @@ static inline void psi_calc_cast(token_t in_type, impl_val *in_val, token_t out_
                case PSI_T_UINT64:
                        out_val->u64 = in_val->u64;
                        break;
+#      if HAVE_INT128
                case PSI_T_INT128:
                        out_val->u64 = in_val->i128;
                        break;
+#      endif
+
+#      if HAVE_UINT128
                case PSI_T_UINT128:
                        out_val->u64 = in_val->u128;
                        break;
+#      endif
+
                case PSI_T_FLOAT:
                        out_val->u64 = in_val->fval;
                        break;
@@ -423,6 +471,7 @@ static inline void psi_calc_cast(token_t in_type, impl_val *in_val, token_t out_
                        break;
                }
                break;
+#if HAVE_INT128
        case PSI_T_INT128:
                switch (in_type) {
                case PSI_T_INT8:
@@ -449,12 +498,18 @@ static inline void psi_calc_cast(token_t in_type, impl_val *in_val, token_t out_
                case PSI_T_UINT64:
                        out_val->i128 = in_val->u64;
                        break;
+#      if HAVE_INT128
                case PSI_T_INT128:
                        out_val->i128 = in_val->i128;
                        break;
+#      endif
+
+#      if HAVE_UINT128
                case PSI_T_UINT128:
                        out_val->i128 = in_val->u128;
                        break;
+#      endif
+
                case PSI_T_FLOAT:
                        out_val->i128 = in_val->fval;
                        break;
@@ -472,6 +527,9 @@ static inline void psi_calc_cast(token_t in_type, impl_val *in_val, token_t out_
                        break;
                }
                break;
+#endif
+
+#if HAVE_UINT128
        case PSI_T_UINT128:
                switch (in_type) {
                case PSI_T_INT8:
@@ -498,12 +556,18 @@ static inline void psi_calc_cast(token_t in_type, impl_val *in_val, token_t out_
                case PSI_T_UINT64:
                        out_val->u128 = in_val->u64;
                        break;
+#      if HAVE_INT128
                case PSI_T_INT128:
                        out_val->u128 = in_val->i128;
                        break;
+#      endif
+
+#      if HAVE_UINT128
                case PSI_T_UINT128:
                        out_val->u128 = in_val->u128;
                        break;
+#      endif
+
                case PSI_T_FLOAT:
                        out_val->u128 = in_val->fval;
                        break;
@@ -521,6 +585,8 @@ static inline void psi_calc_cast(token_t in_type, impl_val *in_val, token_t out_
                        break;
                }
                break;
+#endif
+
        case PSI_T_FLOAT:
                switch (in_type) {
                case PSI_T_INT8:
@@ -547,12 +613,18 @@ static inline void psi_calc_cast(token_t in_type, impl_val *in_val, token_t out_
                case PSI_T_UINT64:
                        out_val->fval = in_val->u64;
                        break;
+#      if HAVE_INT128
                case PSI_T_INT128:
                        out_val->fval = in_val->i128;
                        break;
+#      endif
+
+#      if HAVE_UINT128
                case PSI_T_UINT128:
                        out_val->fval = in_val->u128;
                        break;
+#      endif
+
                case PSI_T_FLOAT:
                        out_val->fval = in_val->fval;
                        break;
@@ -596,12 +668,18 @@ static inline void psi_calc_cast(token_t in_type, impl_val *in_val, token_t out_
                case PSI_T_UINT64:
                        out_val->dval = in_val->u64;
                        break;
+#      if HAVE_INT128
                case PSI_T_INT128:
                        out_val->dval = in_val->i128;
                        break;
+#      endif
+
+#      if HAVE_UINT128
                case PSI_T_UINT128:
                        out_val->dval = in_val->u128;
                        break;
+#      endif
+
                case PSI_T_FLOAT:
                        out_val->dval = in_val->fval;
                        break;
@@ -646,12 +724,18 @@ static inline void psi_calc_cast(token_t in_type, impl_val *in_val, token_t out_
                case PSI_T_UINT64:
                        out_val->ldval = in_val->u64;
                        break;
+#      if HAVE_INT128
                case PSI_T_INT128:
                        out_val->ldval = in_val->i128;
                        break;
+#      endif
+
+#      if HAVE_UINT128
                case PSI_T_UINT128:
                        out_val->ldval = in_val->u128;
                        break;
+#      endif
+
                case PSI_T_FLOAT:
                        out_val->ldval = in_val->fval;
                        break;
index 30bc0c9eccb5785463002a48880a0efb002731c7..5eaa648cfe98245b986efe4be171cb5bf0daed49 100644 (file)
@@ -57,12 +57,18 @@ static inline token_t psi_calc_cmp_eq(token_t t1, impl_val *v1, token_t t2, impl
                case PSI_T_UINT64:
                        res->u8 = v1->i8 == v2->u64;
                        break;
+#      if HAVE_INT128
                case PSI_T_INT128:
                        res->u8 = v1->i8 == v2->i128;
                        break;
+#      endif
+
+#      if HAVE_UINT128
                case PSI_T_UINT128:
                        res->u8 = v1->i8 == v2->u128;
                        break;
+#      endif
+
                case PSI_T_FLOAT:
                        res->u8 = v1->i8 == v2->fval;
                        break;
@@ -106,12 +112,18 @@ static inline token_t psi_calc_cmp_eq(token_t t1, impl_val *v1, token_t t2, impl
                case PSI_T_UINT64:
                        res->u8 = v1->u8 == v2->u64;
                        break;
+#      if HAVE_INT128
                case PSI_T_INT128:
                        res->u8 = v1->u8 == v2->i128;
                        break;
+#      endif
+
+#      if HAVE_UINT128
                case PSI_T_UINT128:
                        res->u8 = v1->u8 == v2->u128;
                        break;
+#      endif
+
                case PSI_T_FLOAT:
                        res->u8 = v1->u8 == v2->fval;
                        break;
@@ -155,12 +167,18 @@ static inline token_t psi_calc_cmp_eq(token_t t1, impl_val *v1, token_t t2, impl
                case PSI_T_UINT64:
                        res->u8 = v1->i16 == v2->u64;
                        break;
+#      if HAVE_INT128
                case PSI_T_INT128:
                        res->u8 = v1->i16 == v2->i128;
                        break;
+#      endif
+
+#      if HAVE_UINT128
                case PSI_T_UINT128:
                        res->u8 = v1->i16 == v2->u128;
                        break;
+#      endif
+
                case PSI_T_FLOAT:
                        res->u8 = v1->i16 == v2->fval;
                        break;
@@ -204,12 +222,18 @@ static inline token_t psi_calc_cmp_eq(token_t t1, impl_val *v1, token_t t2, impl
                case PSI_T_UINT64:
                        res->u8 = v1->u16 == v2->u64;
                        break;
+#      if HAVE_INT128
                case PSI_T_INT128:
                        res->u8 = v1->u16 == v2->i128;
                        break;
+#      endif
+
+#      if HAVE_UINT128
                case PSI_T_UINT128:
                        res->u8 = v1->u16 == v2->u128;
                        break;
+#      endif
+
                case PSI_T_FLOAT:
                        res->u8 = v1->u16 == v2->fval;
                        break;
@@ -253,12 +277,18 @@ static inline token_t psi_calc_cmp_eq(token_t t1, impl_val *v1, token_t t2, impl
                case PSI_T_UINT64:
                        res->u8 = v1->i32 == v2->u64;
                        break;
+#      if HAVE_INT128
                case PSI_T_INT128:
                        res->u8 = v1->i32 == v2->i128;
                        break;
+#      endif
+
+#      if HAVE_UINT128
                case PSI_T_UINT128:
                        res->u8 = v1->i32 == v2->u128;
                        break;
+#      endif
+
                case PSI_T_FLOAT:
                        res->u8 = v1->i32 == v2->fval;
                        break;
@@ -302,12 +332,18 @@ static inline token_t psi_calc_cmp_eq(token_t t1, impl_val *v1, token_t t2, impl
                case PSI_T_UINT64:
                        res->u8 = v1->u32 == v2->u64;
                        break;
+#      if HAVE_INT128
                case PSI_T_INT128:
                        res->u8 = v1->u32 == v2->i128;
                        break;
+#      endif
+
+#      if HAVE_UINT128
                case PSI_T_UINT128:
                        res->u8 = v1->u32 == v2->u128;
                        break;
+#      endif
+
                case PSI_T_FLOAT:
                        res->u8 = v1->u32 == v2->fval;
                        break;
@@ -351,12 +387,18 @@ static inline token_t psi_calc_cmp_eq(token_t t1, impl_val *v1, token_t t2, impl
                case PSI_T_UINT64:
                        res->u8 = v1->i64 == v2->u64;
                        break;
+#      if HAVE_INT128
                case PSI_T_INT128:
                        res->u8 = v1->i64 == v2->i128;
                        break;
+#      endif
+
+#      if HAVE_UINT128
                case PSI_T_UINT128:
                        res->u8 = v1->i64 == v2->u128;
                        break;
+#      endif
+
                case PSI_T_FLOAT:
                        res->u8 = v1->i64 == v2->fval;
                        break;
@@ -400,12 +442,18 @@ static inline token_t psi_calc_cmp_eq(token_t t1, impl_val *v1, token_t t2, impl
                case PSI_T_UINT64:
                        res->u8 = v1->u64 == v2->u64;
                        break;
+#      if HAVE_INT128
                case PSI_T_INT128:
                        res->u8 = v1->u64 == v2->i128;
                        break;
+#      endif
+
+#      if HAVE_UINT128
                case PSI_T_UINT128:
                        res->u8 = v1->u64 == v2->u128;
                        break;
+#      endif
+
                case PSI_T_FLOAT:
                        res->u8 = v1->u64 == v2->fval;
                        break;
@@ -423,6 +471,7 @@ static inline token_t psi_calc_cmp_eq(token_t t1, impl_val *v1, token_t t2, impl
                        break;
                }
                break;
+#if HAVE_INT128
        case PSI_T_INT128:
                switch (t2) {
                case PSI_T_INT8:
@@ -449,12 +498,18 @@ static inline token_t psi_calc_cmp_eq(token_t t1, impl_val *v1, token_t t2, impl
                case PSI_T_UINT64:
                        res->u8 = v1->i128 == v2->u64;
                        break;
+#      if HAVE_INT128
                case PSI_T_INT128:
                        res->u8 = v1->i128 == v2->i128;
                        break;
+#      endif
+
+#      if HAVE_UINT128
                case PSI_T_UINT128:
                        res->u8 = v1->i128 == v2->u128;
                        break;
+#      endif
+
                case PSI_T_FLOAT:
                        res->u8 = v1->i128 == v2->fval;
                        break;
@@ -472,6 +527,9 @@ static inline token_t psi_calc_cmp_eq(token_t t1, impl_val *v1, token_t t2, impl
                        break;
                }
                break;
+#endif
+
+#if HAVE_UINT128
        case PSI_T_UINT128:
                switch (t2) {
                case PSI_T_INT8:
@@ -498,12 +556,18 @@ static inline token_t psi_calc_cmp_eq(token_t t1, impl_val *v1, token_t t2, impl
                case PSI_T_UINT64:
                        res->u8 = v1->u128 == v2->u64;
                        break;
+#      if HAVE_INT128
                case PSI_T_INT128:
                        res->u8 = v1->u128 == v2->i128;
                        break;
+#      endif
+
+#      if HAVE_UINT128
                case PSI_T_UINT128:
                        res->u8 = v1->u128 == v2->u128;
                        break;
+#      endif
+
                case PSI_T_FLOAT:
                        res->u8 = v1->u128 == v2->fval;
                        break;
@@ -521,6 +585,8 @@ static inline token_t psi_calc_cmp_eq(token_t t1, impl_val *v1, token_t t2, impl
                        break;
                }
                break;
+#endif
+
        case PSI_T_FLOAT:
                switch (t2) {
                case PSI_T_INT8:
@@ -547,12 +613,18 @@ static inline token_t psi_calc_cmp_eq(token_t t1, impl_val *v1, token_t t2, impl
                case PSI_T_UINT64:
                        res->u8 = v1->fval == v2->u64;
                        break;
+#      if HAVE_INT128
                case PSI_T_INT128:
                        res->u8 = v1->fval == v2->i128;
                        break;
+#      endif
+
+#      if HAVE_UINT128
                case PSI_T_UINT128:
                        res->u8 = v1->fval == v2->u128;
                        break;
+#      endif
+
                case PSI_T_FLOAT:
                        res->u8 = v1->fval == v2->fval;
                        break;
@@ -596,12 +668,18 @@ static inline token_t psi_calc_cmp_eq(token_t t1, impl_val *v1, token_t t2, impl
                case PSI_T_UINT64:
                        res->u8 = v1->dval == v2->u64;
                        break;
+#      if HAVE_INT128
                case PSI_T_INT128:
                        res->u8 = v1->dval == v2->i128;
                        break;
+#      endif
+
+#      if HAVE_UINT128
                case PSI_T_UINT128:
                        res->u8 = v1->dval == v2->u128;
                        break;
+#      endif
+
                case PSI_T_FLOAT:
                        res->u8 = v1->dval == v2->fval;
                        break;
@@ -646,12 +724,18 @@ static inline token_t psi_calc_cmp_eq(token_t t1, impl_val *v1, token_t t2, impl
                case PSI_T_UINT64:
                        res->u8 = v1->ldval == v2->u64;
                        break;
+#      if HAVE_INT128
                case PSI_T_INT128:
                        res->u8 = v1->ldval == v2->i128;
                        break;
+#      endif
+
+#      if HAVE_UINT128
                case PSI_T_UINT128:
                        res->u8 = v1->ldval == v2->u128;
                        break;
+#      endif
+
                case PSI_T_FLOAT:
                        res->u8 = v1->ldval == v2->fval;
                        break;
@@ -707,12 +791,18 @@ static inline token_t psi_calc_cmp_ne(token_t t1, impl_val *v1, token_t t2, impl
                case PSI_T_UINT64:
                        res->u8 = v1->i8 != v2->u64;
                        break;
+#      if HAVE_INT128
                case PSI_T_INT128:
                        res->u8 = v1->i8 != v2->i128;
                        break;
+#      endif
+
+#      if HAVE_UINT128
                case PSI_T_UINT128:
                        res->u8 = v1->i8 != v2->u128;
                        break;
+#      endif
+
                case PSI_T_FLOAT:
                        res->u8 = v1->i8 != v2->fval;
                        break;
@@ -756,12 +846,18 @@ static inline token_t psi_calc_cmp_ne(token_t t1, impl_val *v1, token_t t2, impl
                case PSI_T_UINT64:
                        res->u8 = v1->u8 != v2->u64;
                        break;
+#      if HAVE_INT128
                case PSI_T_INT128:
                        res->u8 = v1->u8 != v2->i128;
                        break;
+#      endif
+
+#      if HAVE_UINT128
                case PSI_T_UINT128:
                        res->u8 = v1->u8 != v2->u128;
                        break;
+#      endif
+
                case PSI_T_FLOAT:
                        res->u8 = v1->u8 != v2->fval;
                        break;
@@ -805,12 +901,18 @@ static inline token_t psi_calc_cmp_ne(token_t t1, impl_val *v1, token_t t2, impl
                case PSI_T_UINT64:
                        res->u8 = v1->i16 != v2->u64;
                        break;
+#      if HAVE_INT128
                case PSI_T_INT128:
                        res->u8 = v1->i16 != v2->i128;
                        break;
+#      endif
+
+#      if HAVE_UINT128
                case PSI_T_UINT128:
                        res->u8 = v1->i16 != v2->u128;
                        break;
+#      endif
+
                case PSI_T_FLOAT:
                        res->u8 = v1->i16 != v2->fval;
                        break;
@@ -854,12 +956,18 @@ static inline token_t psi_calc_cmp_ne(token_t t1, impl_val *v1, token_t t2, impl
                case PSI_T_UINT64:
                        res->u8 = v1->u16 != v2->u64;
                        break;
+#      if HAVE_INT128
                case PSI_T_INT128:
                        res->u8 = v1->u16 != v2->i128;
                        break;
+#      endif
+
+#      if HAVE_UINT128
                case PSI_T_UINT128:
                        res->u8 = v1->u16 != v2->u128;
                        break;
+#      endif
+
                case PSI_T_FLOAT:
                        res->u8 = v1->u16 != v2->fval;
                        break;
@@ -903,12 +1011,18 @@ static inline token_t psi_calc_cmp_ne(token_t t1, impl_val *v1, token_t t2, impl
                case PSI_T_UINT64:
                        res->u8 = v1->i32 != v2->u64;
                        break;
+#      if HAVE_INT128
                case PSI_T_INT128:
                        res->u8 = v1->i32 != v2->i128;
                        break;
+#      endif
+
+#      if HAVE_UINT128
                case PSI_T_UINT128:
                        res->u8 = v1->i32 != v2->u128;
                        break;
+#      endif
+
                case PSI_T_FLOAT:
                        res->u8 = v1->i32 != v2->fval;
                        break;
@@ -952,12 +1066,18 @@ static inline token_t psi_calc_cmp_ne(token_t t1, impl_val *v1, token_t t2, impl
                case PSI_T_UINT64:
                        res->u8 = v1->u32 != v2->u64;
                        break;
+#      if HAVE_INT128
                case PSI_T_INT128:
                        res->u8 = v1->u32 != v2->i128;
                        break;
+#      endif
+
+#      if HAVE_UINT128
                case PSI_T_UINT128:
                        res->u8 = v1->u32 != v2->u128;
                        break;
+#      endif
+
                case PSI_T_FLOAT:
                        res->u8 = v1->u32 != v2->fval;
                        break;
@@ -1001,12 +1121,18 @@ static inline token_t psi_calc_cmp_ne(token_t t1, impl_val *v1, token_t t2, impl
                case PSI_T_UINT64:
                        res->u8 = v1->i64 != v2->u64;
                        break;
+#      if HAVE_INT128
                case PSI_T_INT128:
                        res->u8 = v1->i64 != v2->i128;
                        break;
+#      endif
+
+#      if HAVE_UINT128
                case PSI_T_UINT128:
                        res->u8 = v1->i64 != v2->u128;
                        break;
+#      endif
+
                case PSI_T_FLOAT:
                        res->u8 = v1->i64 != v2->fval;
                        break;
@@ -1050,12 +1176,18 @@ static inline token_t psi_calc_cmp_ne(token_t t1, impl_val *v1, token_t t2, impl
                case PSI_T_UINT64:
                        res->u8 = v1->u64 != v2->u64;
                        break;
+#      if HAVE_INT128
                case PSI_T_INT128:
                        res->u8 = v1->u64 != v2->i128;
                        break;
+#      endif
+
+#      if HAVE_UINT128
                case PSI_T_UINT128:
                        res->u8 = v1->u64 != v2->u128;
                        break;
+#      endif
+
                case PSI_T_FLOAT:
                        res->u8 = v1->u64 != v2->fval;
                        break;
@@ -1073,6 +1205,7 @@ static inline token_t psi_calc_cmp_ne(token_t t1, impl_val *v1, token_t t2, impl
                        break;
                }
                break;
+#if HAVE_INT128
        case PSI_T_INT128:
                switch (t2) {
                case PSI_T_INT8:
@@ -1099,12 +1232,18 @@ static inline token_t psi_calc_cmp_ne(token_t t1, impl_val *v1, token_t t2, impl
                case PSI_T_UINT64:
                        res->u8 = v1->i128 != v2->u64;
                        break;
+#      if HAVE_INT128
                case PSI_T_INT128:
                        res->u8 = v1->i128 != v2->i128;
                        break;
+#      endif
+
+#      if HAVE_UINT128
                case PSI_T_UINT128:
                        res->u8 = v1->i128 != v2->u128;
                        break;
+#      endif
+
                case PSI_T_FLOAT:
                        res->u8 = v1->i128 != v2->fval;
                        break;
@@ -1122,6 +1261,9 @@ static inline token_t psi_calc_cmp_ne(token_t t1, impl_val *v1, token_t t2, impl
                        break;
                }
                break;
+#endif
+
+#if HAVE_UINT128
        case PSI_T_UINT128:
                switch (t2) {
                case PSI_T_INT8:
@@ -1148,12 +1290,18 @@ static inline token_t psi_calc_cmp_ne(token_t t1, impl_val *v1, token_t t2, impl
                case PSI_T_UINT64:
                        res->u8 = v1->u128 != v2->u64;
                        break;
+#      if HAVE_INT128
                case PSI_T_INT128:
                        res->u8 = v1->u128 != v2->i128;
                        break;
+#      endif
+
+#      if HAVE_UINT128
                case PSI_T_UINT128:
                        res->u8 = v1->u128 != v2->u128;
                        break;
+#      endif
+
                case PSI_T_FLOAT:
                        res->u8 = v1->u128 != v2->fval;
                        break;
@@ -1171,6 +1319,8 @@ static inline token_t psi_calc_cmp_ne(token_t t1, impl_val *v1, token_t t2, impl
                        break;
                }
                break;
+#endif
+
        case PSI_T_FLOAT:
                switch (t2) {
                case PSI_T_INT8:
@@ -1197,12 +1347,18 @@ static inline token_t psi_calc_cmp_ne(token_t t1, impl_val *v1, token_t t2, impl
                case PSI_T_UINT64:
                        res->u8 = v1->fval != v2->u64;
                        break;
+#      if HAVE_INT128
                case PSI_T_INT128:
                        res->u8 = v1->fval != v2->i128;
                        break;
+#      endif
+
+#      if HAVE_UINT128
                case PSI_T_UINT128:
                        res->u8 = v1->fval != v2->u128;
                        break;
+#      endif
+
                case PSI_T_FLOAT:
                        res->u8 = v1->fval != v2->fval;
                        break;
@@ -1246,12 +1402,18 @@ static inline token_t psi_calc_cmp_ne(token_t t1, impl_val *v1, token_t t2, impl
                case PSI_T_UINT64:
                        res->u8 = v1->dval != v2->u64;
                        break;
+#      if HAVE_INT128
                case PSI_T_INT128:
                        res->u8 = v1->dval != v2->i128;
                        break;
+#      endif
+
+#      if HAVE_UINT128
                case PSI_T_UINT128:
                        res->u8 = v1->dval != v2->u128;
                        break;
+#      endif
+
                case PSI_T_FLOAT:
                        res->u8 = v1->dval != v2->fval;
                        break;
@@ -1296,12 +1458,18 @@ static inline token_t psi_calc_cmp_ne(token_t t1, impl_val *v1, token_t t2, impl
                case PSI_T_UINT64:
                        res->u8 = v1->ldval != v2->u64;
                        break;
+#      if HAVE_INT128
                case PSI_T_INT128:
                        res->u8 = v1->ldval != v2->i128;
                        break;
+#      endif
+
+#      if HAVE_UINT128
                case PSI_T_UINT128:
                        res->u8 = v1->ldval != v2->u128;
                        break;
+#      endif
+
                case PSI_T_FLOAT:
                        res->u8 = v1->ldval != v2->fval;
                        break;
@@ -1357,12 +1525,18 @@ static inline token_t psi_calc_cmp_lt(token_t t1, impl_val *v1, token_t t2, impl
                case PSI_T_UINT64:
                        res->u8 = v1->i8 < v2->u64;
                        break;
+#      if HAVE_INT128
                case PSI_T_INT128:
                        res->u8 = v1->i8 < v2->i128;
                        break;
+#      endif
+
+#      if HAVE_UINT128
                case PSI_T_UINT128:
                        res->u8 = v1->i8 < v2->u128;
                        break;
+#      endif
+
                case PSI_T_FLOAT:
                        res->u8 = v1->i8 < v2->fval;
                        break;
@@ -1406,12 +1580,18 @@ static inline token_t psi_calc_cmp_lt(token_t t1, impl_val *v1, token_t t2, impl
                case PSI_T_UINT64:
                        res->u8 = v1->u8 < v2->u64;
                        break;
+#      if HAVE_INT128
                case PSI_T_INT128:
                        res->u8 = v1->u8 < v2->i128;
                        break;
+#      endif
+
+#      if HAVE_UINT128
                case PSI_T_UINT128:
                        res->u8 = v1->u8 < v2->u128;
                        break;
+#      endif
+
                case PSI_T_FLOAT:
                        res->u8 = v1->u8 < v2->fval;
                        break;
@@ -1455,12 +1635,18 @@ static inline token_t psi_calc_cmp_lt(token_t t1, impl_val *v1, token_t t2, impl
                case PSI_T_UINT64:
                        res->u8 = v1->i16 < v2->u64;
                        break;
+#      if HAVE_INT128
                case PSI_T_INT128:
                        res->u8 = v1->i16 < v2->i128;
                        break;
+#      endif
+
+#      if HAVE_UINT128
                case PSI_T_UINT128:
                        res->u8 = v1->i16 < v2->u128;
                        break;
+#      endif
+
                case PSI_T_FLOAT:
                        res->u8 = v1->i16 < v2->fval;
                        break;
@@ -1504,12 +1690,18 @@ static inline token_t psi_calc_cmp_lt(token_t t1, impl_val *v1, token_t t2, impl
                case PSI_T_UINT64:
                        res->u8 = v1->u16 < v2->u64;
                        break;
+#      if HAVE_INT128
                case PSI_T_INT128:
                        res->u8 = v1->u16 < v2->i128;
                        break;
+#      endif
+
+#      if HAVE_UINT128
                case PSI_T_UINT128:
                        res->u8 = v1->u16 < v2->u128;
                        break;
+#      endif
+
                case PSI_T_FLOAT:
                        res->u8 = v1->u16 < v2->fval;
                        break;
@@ -1553,12 +1745,18 @@ static inline token_t psi_calc_cmp_lt(token_t t1, impl_val *v1, token_t t2, impl
                case PSI_T_UINT64:
                        res->u8 = v1->i32 < v2->u64;
                        break;
+#      if HAVE_INT128
                case PSI_T_INT128:
                        res->u8 = v1->i32 < v2->i128;
                        break;
+#      endif
+
+#      if HAVE_UINT128
                case PSI_T_UINT128:
                        res->u8 = v1->i32 < v2->u128;
                        break;
+#      endif
+
                case PSI_T_FLOAT:
                        res->u8 = v1->i32 < v2->fval;
                        break;
@@ -1602,12 +1800,18 @@ static inline token_t psi_calc_cmp_lt(token_t t1, impl_val *v1, token_t t2, impl
                case PSI_T_UINT64:
                        res->u8 = v1->u32 < v2->u64;
                        break;
+#      if HAVE_INT128
                case PSI_T_INT128:
                        res->u8 = v1->u32 < v2->i128;
                        break;
+#      endif
+
+#      if HAVE_UINT128
                case PSI_T_UINT128:
                        res->u8 = v1->u32 < v2->u128;
                        break;
+#      endif
+
                case PSI_T_FLOAT:
                        res->u8 = v1->u32 < v2->fval;
                        break;
@@ -1651,12 +1855,18 @@ static inline token_t psi_calc_cmp_lt(token_t t1, impl_val *v1, token_t t2, impl
                case PSI_T_UINT64:
                        res->u8 = v1->i64 < v2->u64;
                        break;
+#      if HAVE_INT128
                case PSI_T_INT128:
                        res->u8 = v1->i64 < v2->i128;
                        break;
+#      endif
+
+#      if HAVE_UINT128
                case PSI_T_UINT128:
                        res->u8 = v1->i64 < v2->u128;
                        break;
+#      endif
+
                case PSI_T_FLOAT:
                        res->u8 = v1->i64 < v2->fval;
                        break;
@@ -1700,12 +1910,18 @@ static inline token_t psi_calc_cmp_lt(token_t t1, impl_val *v1, token_t t2, impl
                case PSI_T_UINT64:
                        res->u8 = v1->u64 < v2->u64;
                        break;
+#      if HAVE_INT128
                case PSI_T_INT128:
                        res->u8 = v1->u64 < v2->i128;
                        break;
+#      endif
+
+#      if HAVE_UINT128
                case PSI_T_UINT128:
                        res->u8 = v1->u64 < v2->u128;
                        break;
+#      endif
+
                case PSI_T_FLOAT:
                        res->u8 = v1->u64 < v2->fval;
                        break;
@@ -1723,6 +1939,7 @@ static inline token_t psi_calc_cmp_lt(token_t t1, impl_val *v1, token_t t2, impl
                        break;
                }
                break;
+#if HAVE_INT128
        case PSI_T_INT128:
                switch (t2) {
                case PSI_T_INT8:
@@ -1749,12 +1966,18 @@ static inline token_t psi_calc_cmp_lt(token_t t1, impl_val *v1, token_t t2, impl
                case PSI_T_UINT64:
                        res->u8 = v1->i128 < v2->u64;
                        break;
+#      if HAVE_INT128
                case PSI_T_INT128:
                        res->u8 = v1->i128 < v2->i128;
                        break;
+#      endif
+
+#      if HAVE_UINT128
                case PSI_T_UINT128:
                        res->u8 = v1->i128 < v2->u128;
                        break;
+#      endif
+
                case PSI_T_FLOAT:
                        res->u8 = v1->i128 < v2->fval;
                        break;
@@ -1772,6 +1995,9 @@ static inline token_t psi_calc_cmp_lt(token_t t1, impl_val *v1, token_t t2, impl
                        break;
                }
                break;
+#endif
+
+#if HAVE_UINT128
        case PSI_T_UINT128:
                switch (t2) {
                case PSI_T_INT8:
@@ -1798,12 +2024,18 @@ static inline token_t psi_calc_cmp_lt(token_t t1, impl_val *v1, token_t t2, impl
                case PSI_T_UINT64:
                        res->u8 = v1->u128 < v2->u64;
                        break;
+#      if HAVE_INT128
                case PSI_T_INT128:
                        res->u8 = v1->u128 < v2->i128;
                        break;
+#      endif
+
+#      if HAVE_UINT128
                case PSI_T_UINT128:
                        res->u8 = v1->u128 < v2->u128;
                        break;
+#      endif
+
                case PSI_T_FLOAT:
                        res->u8 = v1->u128 < v2->fval;
                        break;
@@ -1821,6 +2053,8 @@ static inline token_t psi_calc_cmp_lt(token_t t1, impl_val *v1, token_t t2, impl
                        break;
                }
                break;
+#endif
+
        case PSI_T_FLOAT:
                switch (t2) {
                case PSI_T_INT8:
@@ -1847,12 +2081,18 @@ static inline token_t psi_calc_cmp_lt(token_t t1, impl_val *v1, token_t t2, impl
                case PSI_T_UINT64:
                        res->u8 = v1->fval < v2->u64;
                        break;
+#      if HAVE_INT128
                case PSI_T_INT128:
                        res->u8 = v1->fval < v2->i128;
                        break;
+#      endif
+
+#      if HAVE_UINT128
                case PSI_T_UINT128:
                        res->u8 = v1->fval < v2->u128;
                        break;
+#      endif
+
                case PSI_T_FLOAT:
                        res->u8 = v1->fval < v2->fval;
                        break;
@@ -1896,12 +2136,18 @@ static inline token_t psi_calc_cmp_lt(token_t t1, impl_val *v1, token_t t2, impl
                case PSI_T_UINT64:
                        res->u8 = v1->dval < v2->u64;
                        break;
+#      if HAVE_INT128
                case PSI_T_INT128:
                        res->u8 = v1->dval < v2->i128;
                        break;
+#      endif
+
+#      if HAVE_UINT128
                case PSI_T_UINT128:
                        res->u8 = v1->dval < v2->u128;
                        break;
+#      endif
+
                case PSI_T_FLOAT:
                        res->u8 = v1->dval < v2->fval;
                        break;
@@ -1946,12 +2192,18 @@ static inline token_t psi_calc_cmp_lt(token_t t1, impl_val *v1, token_t t2, impl
                case PSI_T_UINT64:
                        res->u8 = v1->ldval < v2->u64;
                        break;
+#      if HAVE_INT128
                case PSI_T_INT128:
                        res->u8 = v1->ldval < v2->i128;
                        break;
+#      endif
+
+#      if HAVE_UINT128
                case PSI_T_UINT128:
                        res->u8 = v1->ldval < v2->u128;
                        break;
+#      endif
+
                case PSI_T_FLOAT:
                        res->u8 = v1->ldval < v2->fval;
                        break;
@@ -2007,12 +2259,18 @@ static inline token_t psi_calc_cmp_gt(token_t t1, impl_val *v1, token_t t2, impl
                case PSI_T_UINT64:
                        res->u8 = v1->i8 > v2->u64;
                        break;
+#      if HAVE_INT128
                case PSI_T_INT128:
                        res->u8 = v1->i8 > v2->i128;
                        break;
+#      endif
+
+#      if HAVE_UINT128
                case PSI_T_UINT128:
                        res->u8 = v1->i8 > v2->u128;
                        break;
+#      endif
+
                case PSI_T_FLOAT:
                        res->u8 = v1->i8 > v2->fval;
                        break;
@@ -2056,12 +2314,18 @@ static inline token_t psi_calc_cmp_gt(token_t t1, impl_val *v1, token_t t2, impl
                case PSI_T_UINT64:
                        res->u8 = v1->u8 > v2->u64;
                        break;
+#      if HAVE_INT128
                case PSI_T_INT128:
                        res->u8 = v1->u8 > v2->i128;
                        break;
+#      endif
+
+#      if HAVE_UINT128
                case PSI_T_UINT128:
                        res->u8 = v1->u8 > v2->u128;
                        break;
+#      endif
+
                case PSI_T_FLOAT:
                        res->u8 = v1->u8 > v2->fval;
                        break;
@@ -2105,12 +2369,18 @@ static inline token_t psi_calc_cmp_gt(token_t t1, impl_val *v1, token_t t2, impl
                case PSI_T_UINT64:
                        res->u8 = v1->i16 > v2->u64;
                        break;
+#      if HAVE_INT128
                case PSI_T_INT128:
                        res->u8 = v1->i16 > v2->i128;
                        break;
+#      endif
+
+#      if HAVE_UINT128
                case PSI_T_UINT128:
                        res->u8 = v1->i16 > v2->u128;
                        break;
+#      endif
+
                case PSI_T_FLOAT:
                        res->u8 = v1->i16 > v2->fval;
                        break;
@@ -2154,12 +2424,18 @@ static inline token_t psi_calc_cmp_gt(token_t t1, impl_val *v1, token_t t2, impl
                case PSI_T_UINT64:
                        res->u8 = v1->u16 > v2->u64;
                        break;
+#      if HAVE_INT128
                case PSI_T_INT128:
                        res->u8 = v1->u16 > v2->i128;
                        break;
+#      endif
+
+#      if HAVE_UINT128
                case PSI_T_UINT128:
                        res->u8 = v1->u16 > v2->u128;
                        break;
+#      endif
+
                case PSI_T_FLOAT:
                        res->u8 = v1->u16 > v2->fval;
                        break;
@@ -2203,12 +2479,18 @@ static inline token_t psi_calc_cmp_gt(token_t t1, impl_val *v1, token_t t2, impl
                case PSI_T_UINT64:
                        res->u8 = v1->i32 > v2->u64;
                        break;
+#      if HAVE_INT128
                case PSI_T_INT128:
                        res->u8 = v1->i32 > v2->i128;
                        break;
+#      endif
+
+#      if HAVE_UINT128
                case PSI_T_UINT128:
                        res->u8 = v1->i32 > v2->u128;
                        break;
+#      endif
+
                case PSI_T_FLOAT:
                        res->u8 = v1->i32 > v2->fval;
                        break;
@@ -2252,12 +2534,18 @@ static inline token_t psi_calc_cmp_gt(token_t t1, impl_val *v1, token_t t2, impl
                case PSI_T_UINT64:
                        res->u8 = v1->u32 > v2->u64;
                        break;
+#      if HAVE_INT128
                case PSI_T_INT128:
                        res->u8 = v1->u32 > v2->i128;
                        break;
+#      endif
+
+#      if HAVE_UINT128
                case PSI_T_UINT128:
                        res->u8 = v1->u32 > v2->u128;
                        break;
+#      endif
+
                case PSI_T_FLOAT:
                        res->u8 = v1->u32 > v2->fval;
                        break;
@@ -2301,12 +2589,18 @@ static inline token_t psi_calc_cmp_gt(token_t t1, impl_val *v1, token_t t2, impl
                case PSI_T_UINT64:
                        res->u8 = v1->i64 > v2->u64;
                        break;
+#      if HAVE_INT128
                case PSI_T_INT128:
                        res->u8 = v1->i64 > v2->i128;
                        break;
+#      endif
+
+#      if HAVE_UINT128
                case PSI_T_UINT128:
                        res->u8 = v1->i64 > v2->u128;
                        break;
+#      endif
+
                case PSI_T_FLOAT:
                        res->u8 = v1->i64 > v2->fval;
                        break;
@@ -2350,12 +2644,18 @@ static inline token_t psi_calc_cmp_gt(token_t t1, impl_val *v1, token_t t2, impl
                case PSI_T_UINT64:
                        res->u8 = v1->u64 > v2->u64;
                        break;
+#      if HAVE_INT128
                case PSI_T_INT128:
                        res->u8 = v1->u64 > v2->i128;
                        break;
+#      endif
+
+#      if HAVE_UINT128
                case PSI_T_UINT128:
                        res->u8 = v1->u64 > v2->u128;
                        break;
+#      endif
+
                case PSI_T_FLOAT:
                        res->u8 = v1->u64 > v2->fval;
                        break;
@@ -2373,6 +2673,7 @@ static inline token_t psi_calc_cmp_gt(token_t t1, impl_val *v1, token_t t2, impl
                        break;
                }
                break;
+#if HAVE_INT128
        case PSI_T_INT128:
                switch (t2) {
                case PSI_T_INT8:
@@ -2399,12 +2700,18 @@ static inline token_t psi_calc_cmp_gt(token_t t1, impl_val *v1, token_t t2, impl
                case PSI_T_UINT64:
                        res->u8 = v1->i128 > v2->u64;
                        break;
+#      if HAVE_INT128
                case PSI_T_INT128:
                        res->u8 = v1->i128 > v2->i128;
                        break;
+#      endif
+
+#      if HAVE_UINT128
                case PSI_T_UINT128:
                        res->u8 = v1->i128 > v2->u128;
                        break;
+#      endif
+
                case PSI_T_FLOAT:
                        res->u8 = v1->i128 > v2->fval;
                        break;
@@ -2422,6 +2729,9 @@ static inline token_t psi_calc_cmp_gt(token_t t1, impl_val *v1, token_t t2, impl
                        break;
                }
                break;
+#endif
+
+#if HAVE_UINT128
        case PSI_T_UINT128:
                switch (t2) {
                case PSI_T_INT8:
@@ -2448,12 +2758,18 @@ static inline token_t psi_calc_cmp_gt(token_t t1, impl_val *v1, token_t t2, impl
                case PSI_T_UINT64:
                        res->u8 = v1->u128 > v2->u64;
                        break;
+#      if HAVE_INT128
                case PSI_T_INT128:
                        res->u8 = v1->u128 > v2->i128;
                        break;
+#      endif
+
+#      if HAVE_UINT128
                case PSI_T_UINT128:
                        res->u8 = v1->u128 > v2->u128;
                        break;
+#      endif
+
                case PSI_T_FLOAT:
                        res->u8 = v1->u128 > v2->fval;
                        break;
@@ -2471,6 +2787,8 @@ static inline token_t psi_calc_cmp_gt(token_t t1, impl_val *v1, token_t t2, impl
                        break;
                }
                break;
+#endif
+
        case PSI_T_FLOAT:
                switch (t2) {
                case PSI_T_INT8:
@@ -2497,12 +2815,18 @@ static inline token_t psi_calc_cmp_gt(token_t t1, impl_val *v1, token_t t2, impl
                case PSI_T_UINT64:
                        res->u8 = v1->fval > v2->u64;
                        break;
+#      if HAVE_INT128
                case PSI_T_INT128:
                        res->u8 = v1->fval > v2->i128;
                        break;
+#      endif
+
+#      if HAVE_UINT128
                case PSI_T_UINT128:
                        res->u8 = v1->fval > v2->u128;
                        break;
+#      endif
+
                case PSI_T_FLOAT:
                        res->u8 = v1->fval > v2->fval;
                        break;
@@ -2546,12 +2870,18 @@ static inline token_t psi_calc_cmp_gt(token_t t1, impl_val *v1, token_t t2, impl
                case PSI_T_UINT64:
                        res->u8 = v1->dval > v2->u64;
                        break;
+#      if HAVE_INT128
                case PSI_T_INT128:
                        res->u8 = v1->dval > v2->i128;
                        break;
+#      endif
+
+#      if HAVE_UINT128
                case PSI_T_UINT128:
                        res->u8 = v1->dval > v2->u128;
                        break;
+#      endif
+
                case PSI_T_FLOAT:
                        res->u8 = v1->dval > v2->fval;
                        break;
@@ -2596,12 +2926,18 @@ static inline token_t psi_calc_cmp_gt(token_t t1, impl_val *v1, token_t t2, impl
                case PSI_T_UINT64:
                        res->u8 = v1->ldval > v2->u64;
                        break;
+#      if HAVE_INT128
                case PSI_T_INT128:
                        res->u8 = v1->ldval > v2->i128;
                        break;
+#      endif
+
+#      if HAVE_UINT128
                case PSI_T_UINT128:
                        res->u8 = v1->ldval > v2->u128;
                        break;
+#      endif
+
                case PSI_T_FLOAT:
                        res->u8 = v1->ldval > v2->fval;
                        break;
@@ -2657,12 +2993,18 @@ static inline token_t psi_calc_cmp_le(token_t t1, impl_val *v1, token_t t2, impl
                case PSI_T_UINT64:
                        res->u8 = v1->i8 <= v2->u64;
                        break;
+#      if HAVE_INT128
                case PSI_T_INT128:
                        res->u8 = v1->i8 <= v2->i128;
                        break;
+#      endif
+
+#      if HAVE_UINT128
                case PSI_T_UINT128:
                        res->u8 = v1->i8 <= v2->u128;
                        break;
+#      endif
+
                case PSI_T_FLOAT:
                        res->u8 = v1->i8 <= v2->fval;
                        break;
@@ -2706,12 +3048,18 @@ static inline token_t psi_calc_cmp_le(token_t t1, impl_val *v1, token_t t2, impl
                case PSI_T_UINT64:
                        res->u8 = v1->u8 <= v2->u64;
                        break;
+#      if HAVE_INT128
                case PSI_T_INT128:
                        res->u8 = v1->u8 <= v2->i128;
                        break;
+#      endif
+
+#      if HAVE_UINT128
                case PSI_T_UINT128:
                        res->u8 = v1->u8 <= v2->u128;
                        break;
+#      endif
+
                case PSI_T_FLOAT:
                        res->u8 = v1->u8 <= v2->fval;
                        break;
@@ -2755,12 +3103,18 @@ static inline token_t psi_calc_cmp_le(token_t t1, impl_val *v1, token_t t2, impl
                case PSI_T_UINT64:
                        res->u8 = v1->i16 <= v2->u64;
                        break;
+#      if HAVE_INT128
                case PSI_T_INT128:
                        res->u8 = v1->i16 <= v2->i128;
                        break;
+#      endif
+
+#      if HAVE_UINT128
                case PSI_T_UINT128:
                        res->u8 = v1->i16 <= v2->u128;
                        break;
+#      endif
+
                case PSI_T_FLOAT:
                        res->u8 = v1->i16 <= v2->fval;
                        break;
@@ -2804,12 +3158,18 @@ static inline token_t psi_calc_cmp_le(token_t t1, impl_val *v1, token_t t2, impl
                case PSI_T_UINT64:
                        res->u8 = v1->u16 <= v2->u64;
                        break;
+#      if HAVE_INT128
                case PSI_T_INT128:
                        res->u8 = v1->u16 <= v2->i128;
                        break;
+#      endif
+
+#      if HAVE_UINT128
                case PSI_T_UINT128:
                        res->u8 = v1->u16 <= v2->u128;
                        break;
+#      endif
+
                case PSI_T_FLOAT:
                        res->u8 = v1->u16 <= v2->fval;
                        break;
@@ -2853,12 +3213,18 @@ static inline token_t psi_calc_cmp_le(token_t t1, impl_val *v1, token_t t2, impl
                case PSI_T_UINT64:
                        res->u8 = v1->i32 <= v2->u64;
                        break;
+#      if HAVE_INT128
                case PSI_T_INT128:
                        res->u8 = v1->i32 <= v2->i128;
                        break;
+#      endif
+
+#      if HAVE_UINT128
                case PSI_T_UINT128:
                        res->u8 = v1->i32 <= v2->u128;
                        break;
+#      endif
+
                case PSI_T_FLOAT:
                        res->u8 = v1->i32 <= v2->fval;
                        break;
@@ -2902,12 +3268,18 @@ static inline token_t psi_calc_cmp_le(token_t t1, impl_val *v1, token_t t2, impl
                case PSI_T_UINT64:
                        res->u8 = v1->u32 <= v2->u64;
                        break;
+#      if HAVE_INT128
                case PSI_T_INT128:
                        res->u8 = v1->u32 <= v2->i128;
                        break;
+#      endif
+
+#      if HAVE_UINT128
                case PSI_T_UINT128:
                        res->u8 = v1->u32 <= v2->u128;
                        break;
+#      endif
+
                case PSI_T_FLOAT:
                        res->u8 = v1->u32 <= v2->fval;
                        break;
@@ -2951,12 +3323,18 @@ static inline token_t psi_calc_cmp_le(token_t t1, impl_val *v1, token_t t2, impl
                case PSI_T_UINT64:
                        res->u8 = v1->i64 <= v2->u64;
                        break;
+#      if HAVE_INT128
                case PSI_T_INT128:
                        res->u8 = v1->i64 <= v2->i128;
                        break;
+#      endif
+
+#      if HAVE_UINT128
                case PSI_T_UINT128:
                        res->u8 = v1->i64 <= v2->u128;
                        break;
+#      endif
+
                case PSI_T_FLOAT:
                        res->u8 = v1->i64 <= v2->fval;
                        break;
@@ -3000,12 +3378,18 @@ static inline token_t psi_calc_cmp_le(token_t t1, impl_val *v1, token_t t2, impl
                case PSI_T_UINT64:
                        res->u8 = v1->u64 <= v2->u64;
                        break;
+#      if HAVE_INT128
                case PSI_T_INT128:
                        res->u8 = v1->u64 <= v2->i128;
                        break;
+#      endif
+
+#      if HAVE_UINT128
                case PSI_T_UINT128:
                        res->u8 = v1->u64 <= v2->u128;
                        break;
+#      endif
+
                case PSI_T_FLOAT:
                        res->u8 = v1->u64 <= v2->fval;
                        break;
@@ -3023,6 +3407,7 @@ static inline token_t psi_calc_cmp_le(token_t t1, impl_val *v1, token_t t2, impl
                        break;
                }
                break;
+#if HAVE_INT128
        case PSI_T_INT128:
                switch (t2) {
                case PSI_T_INT8:
@@ -3049,12 +3434,18 @@ static inline token_t psi_calc_cmp_le(token_t t1, impl_val *v1, token_t t2, impl
                case PSI_T_UINT64:
                        res->u8 = v1->i128 <= v2->u64;
                        break;
+#      if HAVE_INT128
                case PSI_T_INT128:
                        res->u8 = v1->i128 <= v2->i128;
                        break;
+#      endif
+
+#      if HAVE_UINT128
                case PSI_T_UINT128:
                        res->u8 = v1->i128 <= v2->u128;
                        break;
+#      endif
+
                case PSI_T_FLOAT:
                        res->u8 = v1->i128 <= v2->fval;
                        break;
@@ -3072,6 +3463,9 @@ static inline token_t psi_calc_cmp_le(token_t t1, impl_val *v1, token_t t2, impl
                        break;
                }
                break;
+#endif
+
+#if HAVE_UINT128
        case PSI_T_UINT128:
                switch (t2) {
                case PSI_T_INT8:
@@ -3098,12 +3492,18 @@ static inline token_t psi_calc_cmp_le(token_t t1, impl_val *v1, token_t t2, impl
                case PSI_T_UINT64:
                        res->u8 = v1->u128 <= v2->u64;
                        break;
+#      if HAVE_INT128
                case PSI_T_INT128:
                        res->u8 = v1->u128 <= v2->i128;
                        break;
+#      endif
+
+#      if HAVE_UINT128
                case PSI_T_UINT128:
                        res->u8 = v1->u128 <= v2->u128;
                        break;
+#      endif
+
                case PSI_T_FLOAT:
                        res->u8 = v1->u128 <= v2->fval;
                        break;
@@ -3121,6 +3521,8 @@ static inline token_t psi_calc_cmp_le(token_t t1, impl_val *v1, token_t t2, impl
                        break;
                }
                break;
+#endif
+
        case PSI_T_FLOAT:
                switch (t2) {
                case PSI_T_INT8:
@@ -3147,12 +3549,18 @@ static inline token_t psi_calc_cmp_le(token_t t1, impl_val *v1, token_t t2, impl
                case PSI_T_UINT64:
                        res->u8 = v1->fval <= v2->u64;
                        break;
+#      if HAVE_INT128
                case PSI_T_INT128:
                        res->u8 = v1->fval <= v2->i128;
                        break;
+#      endif
+
+#      if HAVE_UINT128
                case PSI_T_UINT128:
                        res->u8 = v1->fval <= v2->u128;
                        break;
+#      endif
+
                case PSI_T_FLOAT:
                        res->u8 = v1->fval <= v2->fval;
                        break;
@@ -3196,12 +3604,18 @@ static inline token_t psi_calc_cmp_le(token_t t1, impl_val *v1, token_t t2, impl
                case PSI_T_UINT64:
                        res->u8 = v1->dval <= v2->u64;
                        break;
+#      if HAVE_INT128
                case PSI_T_INT128:
                        res->u8 = v1->dval <= v2->i128;
                        break;
+#      endif
+
+#      if HAVE_UINT128
                case PSI_T_UINT128:
                        res->u8 = v1->dval <= v2->u128;
                        break;
+#      endif
+
                case PSI_T_FLOAT:
                        res->u8 = v1->dval <= v2->fval;
                        break;
@@ -3246,12 +3660,18 @@ static inline token_t psi_calc_cmp_le(token_t t1, impl_val *v1, token_t t2, impl
                case PSI_T_UINT64:
                        res->u8 = v1->ldval <= v2->u64;
                        break;
+#      if HAVE_INT128
                case PSI_T_INT128:
                        res->u8 = v1->ldval <= v2->i128;
                        break;
+#      endif
+
+#      if HAVE_UINT128
                case PSI_T_UINT128:
                        res->u8 = v1->ldval <= v2->u128;
                        break;
+#      endif
+
                case PSI_T_FLOAT:
                        res->u8 = v1->ldval <= v2->fval;
                        break;
@@ -3307,12 +3727,18 @@ static inline token_t psi_calc_cmp_ge(token_t t1, impl_val *v1, token_t t2, impl
                case PSI_T_UINT64:
                        res->u8 = v1->i8 >= v2->u64;
                        break;
+#      if HAVE_INT128
                case PSI_T_INT128:
                        res->u8 = v1->i8 >= v2->i128;
                        break;
+#      endif
+
+#      if HAVE_UINT128
                case PSI_T_UINT128:
                        res->u8 = v1->i8 >= v2->u128;
                        break;
+#      endif
+
                case PSI_T_FLOAT:
                        res->u8 = v1->i8 >= v2->fval;
                        break;
@@ -3356,12 +3782,18 @@ static inline token_t psi_calc_cmp_ge(token_t t1, impl_val *v1, token_t t2, impl
                case PSI_T_UINT64:
                        res->u8 = v1->u8 >= v2->u64;
                        break;
+#      if HAVE_INT128
                case PSI_T_INT128:
                        res->u8 = v1->u8 >= v2->i128;
                        break;
+#      endif
+
+#      if HAVE_UINT128
                case PSI_T_UINT128:
                        res->u8 = v1->u8 >= v2->u128;
                        break;
+#      endif
+
                case PSI_T_FLOAT:
                        res->u8 = v1->u8 >= v2->fval;
                        break;
@@ -3405,12 +3837,18 @@ static inline token_t psi_calc_cmp_ge(token_t t1, impl_val *v1, token_t t2, impl
                case PSI_T_UINT64:
                        res->u8 = v1->i16 >= v2->u64;
                        break;
+#      if HAVE_INT128
                case PSI_T_INT128:
                        res->u8 = v1->i16 >= v2->i128;
                        break;
+#      endif
+
+#      if HAVE_UINT128
                case PSI_T_UINT128:
                        res->u8 = v1->i16 >= v2->u128;
                        break;
+#      endif
+
                case PSI_T_FLOAT:
                        res->u8 = v1->i16 >= v2->fval;
                        break;
@@ -3454,12 +3892,18 @@ static inline token_t psi_calc_cmp_ge(token_t t1, impl_val *v1, token_t t2, impl
                case PSI_T_UINT64:
                        res->u8 = v1->u16 >= v2->u64;
                        break;
+#      if HAVE_INT128
                case PSI_T_INT128:
                        res->u8 = v1->u16 >= v2->i128;
                        break;
+#      endif
+
+#      if HAVE_UINT128
                case PSI_T_UINT128:
                        res->u8 = v1->u16 >= v2->u128;
                        break;
+#      endif
+
                case PSI_T_FLOAT:
                        res->u8 = v1->u16 >= v2->fval;
                        break;
@@ -3503,12 +3947,18 @@ static inline token_t psi_calc_cmp_ge(token_t t1, impl_val *v1, token_t t2, impl
                case PSI_T_UINT64:
                        res->u8 = v1->i32 >= v2->u64;
                        break;
+#      if HAVE_INT128
                case PSI_T_INT128:
                        res->u8 = v1->i32 >= v2->i128;
                        break;
+#      endif
+
+#      if HAVE_UINT128
                case PSI_T_UINT128:
                        res->u8 = v1->i32 >= v2->u128;
                        break;
+#      endif
+
                case PSI_T_FLOAT:
                        res->u8 = v1->i32 >= v2->fval;
                        break;
@@ -3552,12 +4002,18 @@ static inline token_t psi_calc_cmp_ge(token_t t1, impl_val *v1, token_t t2, impl
                case PSI_T_UINT64:
                        res->u8 = v1->u32 >= v2->u64;
                        break;
+#      if HAVE_INT128
                case PSI_T_INT128:
                        res->u8 = v1->u32 >= v2->i128;
                        break;
+#      endif
+
+#      if HAVE_UINT128
                case PSI_T_UINT128:
                        res->u8 = v1->u32 >= v2->u128;
                        break;
+#      endif
+
                case PSI_T_FLOAT:
                        res->u8 = v1->u32 >= v2->fval;
                        break;
@@ -3601,12 +4057,18 @@ static inline token_t psi_calc_cmp_ge(token_t t1, impl_val *v1, token_t t2, impl
                case PSI_T_UINT64:
                        res->u8 = v1->i64 >= v2->u64;
                        break;
+#      if HAVE_INT128
                case PSI_T_INT128:
                        res->u8 = v1->i64 >= v2->i128;
                        break;
+#      endif
+
+#      if HAVE_UINT128
                case PSI_T_UINT128:
                        res->u8 = v1->i64 >= v2->u128;
                        break;
+#      endif
+
                case PSI_T_FLOAT:
                        res->u8 = v1->i64 >= v2->fval;
                        break;
@@ -3650,12 +4112,18 @@ static inline token_t psi_calc_cmp_ge(token_t t1, impl_val *v1, token_t t2, impl
                case PSI_T_UINT64:
                        res->u8 = v1->u64 >= v2->u64;
                        break;
+#      if HAVE_INT128
                case PSI_T_INT128:
                        res->u8 = v1->u64 >= v2->i128;
                        break;
+#      endif
+
+#      if HAVE_UINT128
                case PSI_T_UINT128:
                        res->u8 = v1->u64 >= v2->u128;
                        break;
+#      endif
+
                case PSI_T_FLOAT:
                        res->u8 = v1->u64 >= v2->fval;
                        break;
@@ -3673,6 +4141,7 @@ static inline token_t psi_calc_cmp_ge(token_t t1, impl_val *v1, token_t t2, impl
                        break;
                }
                break;
+#if HAVE_INT128
        case PSI_T_INT128:
                switch (t2) {
                case PSI_T_INT8:
@@ -3699,12 +4168,18 @@ static inline token_t psi_calc_cmp_ge(token_t t1, impl_val *v1, token_t t2, impl
                case PSI_T_UINT64:
                        res->u8 = v1->i128 >= v2->u64;
                        break;
+#      if HAVE_INT128
                case PSI_T_INT128:
                        res->u8 = v1->i128 >= v2->i128;
                        break;
+#      endif
+
+#      if HAVE_UINT128
                case PSI_T_UINT128:
                        res->u8 = v1->i128 >= v2->u128;
                        break;
+#      endif
+
                case PSI_T_FLOAT:
                        res->u8 = v1->i128 >= v2->fval;
                        break;
@@ -3722,6 +4197,9 @@ static inline token_t psi_calc_cmp_ge(token_t t1, impl_val *v1, token_t t2, impl
                        break;
                }
                break;
+#endif
+
+#if HAVE_UINT128
        case PSI_T_UINT128:
                switch (t2) {
                case PSI_T_INT8:
@@ -3748,12 +4226,18 @@ static inline token_t psi_calc_cmp_ge(token_t t1, impl_val *v1, token_t t2, impl
                case PSI_T_UINT64:
                        res->u8 = v1->u128 >= v2->u64;
                        break;
+#      if HAVE_INT128
                case PSI_T_INT128:
                        res->u8 = v1->u128 >= v2->i128;
                        break;
+#      endif
+
+#      if HAVE_UINT128
                case PSI_T_UINT128:
                        res->u8 = v1->u128 >= v2->u128;
                        break;
+#      endif
+
                case PSI_T_FLOAT:
                        res->u8 = v1->u128 >= v2->fval;
                        break;
@@ -3771,6 +4255,8 @@ static inline token_t psi_calc_cmp_ge(token_t t1, impl_val *v1, token_t t2, impl
                        break;
                }
                break;
+#endif
+
        case PSI_T_FLOAT:
                switch (t2) {
                case PSI_T_INT8:
@@ -3797,12 +4283,18 @@ static inline token_t psi_calc_cmp_ge(token_t t1, impl_val *v1, token_t t2, impl
                case PSI_T_UINT64:
                        res->u8 = v1->fval >= v2->u64;
                        break;
+#      if HAVE_INT128
                case PSI_T_INT128:
                        res->u8 = v1->fval >= v2->i128;
                        break;
+#      endif
+
+#      if HAVE_UINT128
                case PSI_T_UINT128:
                        res->u8 = v1->fval >= v2->u128;
                        break;
+#      endif
+
                case PSI_T_FLOAT:
                        res->u8 = v1->fval >= v2->fval;
                        break;
@@ -3846,12 +4338,18 @@ static inline token_t psi_calc_cmp_ge(token_t t1, impl_val *v1, token_t t2, impl
                case PSI_T_UINT64:
                        res->u8 = v1->dval >= v2->u64;
                        break;
+#      if HAVE_INT128
                case PSI_T_INT128:
                        res->u8 = v1->dval >= v2->i128;
                        break;
+#      endif
+
+#      if HAVE_UINT128
                case PSI_T_UINT128:
                        res->u8 = v1->dval >= v2->u128;
                        break;
+#      endif
+
                case PSI_T_FLOAT:
                        res->u8 = v1->dval >= v2->fval;
                        break;
@@ -3896,12 +4394,18 @@ static inline token_t psi_calc_cmp_ge(token_t t1, impl_val *v1, token_t t2, impl
                case PSI_T_UINT64:
                        res->u8 = v1->ldval >= v2->u64;
                        break;
+#      if HAVE_INT128
                case PSI_T_INT128:
                        res->u8 = v1->ldval >= v2->i128;
                        break;
+#      endif
+
+#      if HAVE_UINT128
                case PSI_T_UINT128:
                        res->u8 = v1->ldval >= v2->u128;
                        break;
+#      endif
+
                case PSI_T_FLOAT:
                        res->u8 = v1->ldval >= v2->fval;
                        break;
index 72a82e1f2ac80e64c0b51da947127cb62fb2d604..358f65f9645a50822cfa3e999513da8c70d94257 100644 (file)
@@ -57,12 +57,18 @@ static inline token_t psi_calc_minus(token_t t1, impl_val *v1, token_t t2, impl_
        case PSI_T_UINT64:
                res->u64 = -v1->u64;
                break;
+#if HAVE_INT128
        case PSI_T_INT128:
                res->i128 = -v1->i128;
                break;
+#endif
+
+#if HAVE_UINT128
        case PSI_T_UINT128:
                res->u128 = -v1->u128;
                break;
+#endif
+
        case PSI_T_FLOAT:
                res->fval = -v1->fval;
                break;
@@ -113,12 +119,18 @@ static inline token_t psi_calc_bool_not(token_t t1, impl_val *v1, token_t t2, im
        case PSI_T_UINT64:
                res->u8 = !v1->u64;
                break;
+#if HAVE_INT128
        case PSI_T_INT128:
                res->u8 = !v1->i128;
                break;
+#endif
+
+#if HAVE_UINT128
        case PSI_T_UINT128:
                res->u8 = !v1->u128;
                break;
+#endif
+
        case PSI_T_FLOAT:
                res->u8 = !v1->fval;
                break;
@@ -179,14 +191,20 @@ static inline token_t psi_calc_bin_not(token_t t1, impl_val *v1, token_t t2, imp
                i1.u64 = v1->u64;
                break;
 
+#if HAVE_INT128
        case PSI_T_INT128:
                i1.u64 = v1->i128;
                break;
 
+#endif
+
+#if HAVE_UINT128
        case PSI_T_UINT128:
                i1.u64 = v1->u128;
                break;
 
+#endif
+
        case PSI_T_FLOAT:
                i1.u64 = v1->fval;
                break;
index 6473eca10a23b2e11021783d0e4d442ebd8811bb..d48cb8bd28bd5144ea728bbc769292340c22a47a 100644 (file)
@@ -226,6 +226,7 @@ impl_val *psi_let_boolval(impl_val *tmp, struct psi_decl_arg *spec, token_t impl
        return psi_val_boolval(tmp, real_type, boolval);
 }
 
+#if HAVE_INT128
 static inline char *psi_u128_to_buf(char *buf, unsigned __int128 u128)
 {
        for (*buf = 0; u128 > 0; u128 /= 10) {
@@ -245,7 +246,6 @@ static inline char *psi_i128_to_buf(char *buf, __int128 i128)
        return psi_u128_to_buf(buf, i128);
 }
 
-#if HAVE_INT128
 # define RETVAL_LONG_STR(V, s) do {\
                char buf[0x30] = {0}; \
                if (s && V >= ZEND_LONG_MIN && V <= ZEND_LONG_MAX) { \