Merge branch 'slimconfigure'
[m6w6/ext-psi] / src / calc / cmp.h
index 8fac2f3..30bc0c9 100644 (file)
@@ -57,6 +57,12 @@ 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;
+               case PSI_T_INT128:
+                       res->u8 = v1->i8 == v2->i128;
+                       break;
+               case PSI_T_UINT128:
+                       res->u8 = v1->i8 == v2->u128;
+                       break;
                case PSI_T_FLOAT:
                        res->u8 = v1->i8 == v2->fval;
                        break;
@@ -100,6 +106,12 @@ 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;
+               case PSI_T_INT128:
+                       res->u8 = v1->u8 == v2->i128;
+                       break;
+               case PSI_T_UINT128:
+                       res->u8 = v1->u8 == v2->u128;
+                       break;
                case PSI_T_FLOAT:
                        res->u8 = v1->u8 == v2->fval;
                        break;
@@ -143,6 +155,12 @@ 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;
+               case PSI_T_INT128:
+                       res->u8 = v1->i16 == v2->i128;
+                       break;
+               case PSI_T_UINT128:
+                       res->u8 = v1->i16 == v2->u128;
+                       break;
                case PSI_T_FLOAT:
                        res->u8 = v1->i16 == v2->fval;
                        break;
@@ -186,6 +204,12 @@ 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;
+               case PSI_T_INT128:
+                       res->u8 = v1->u16 == v2->i128;
+                       break;
+               case PSI_T_UINT128:
+                       res->u8 = v1->u16 == v2->u128;
+                       break;
                case PSI_T_FLOAT:
                        res->u8 = v1->u16 == v2->fval;
                        break;
@@ -229,6 +253,12 @@ 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;
+               case PSI_T_INT128:
+                       res->u8 = v1->i32 == v2->i128;
+                       break;
+               case PSI_T_UINT128:
+                       res->u8 = v1->i32 == v2->u128;
+                       break;
                case PSI_T_FLOAT:
                        res->u8 = v1->i32 == v2->fval;
                        break;
@@ -272,6 +302,12 @@ 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;
+               case PSI_T_INT128:
+                       res->u8 = v1->u32 == v2->i128;
+                       break;
+               case PSI_T_UINT128:
+                       res->u8 = v1->u32 == v2->u128;
+                       break;
                case PSI_T_FLOAT:
                        res->u8 = v1->u32 == v2->fval;
                        break;
@@ -315,6 +351,12 @@ 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;
+               case PSI_T_INT128:
+                       res->u8 = v1->i64 == v2->i128;
+                       break;
+               case PSI_T_UINT128:
+                       res->u8 = v1->i64 == v2->u128;
+                       break;
                case PSI_T_FLOAT:
                        res->u8 = v1->i64 == v2->fval;
                        break;
@@ -358,6 +400,12 @@ 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;
+               case PSI_T_INT128:
+                       res->u8 = v1->u64 == v2->i128;
+                       break;
+               case PSI_T_UINT128:
+                       res->u8 = v1->u64 == v2->u128;
+                       break;
                case PSI_T_FLOAT:
                        res->u8 = v1->u64 == v2->fval;
                        break;
@@ -370,6 +418,104 @@ static inline token_t psi_calc_cmp_eq(token_t t1, impl_val *v1, token_t t2, impl
                        break;
 #      endif
 
+               default:
+                       assert(0);
+                       break;
+               }
+               break;
+       case PSI_T_INT128:
+               switch (t2) {
+               case PSI_T_INT8:
+                       res->u8 = v1->i128 == v2->i8;
+                       break;
+               case PSI_T_UINT8:
+                       res->u8 = v1->i128 == v2->u8;
+                       break;
+               case PSI_T_INT16:
+                       res->u8 = v1->i128 == v2->i16;
+                       break;
+               case PSI_T_UINT16:
+                       res->u8 = v1->i128 == v2->u16;
+                       break;
+               case PSI_T_INT32:
+                       res->u8 = v1->i128 == v2->i32;
+                       break;
+               case PSI_T_UINT32:
+                       res->u8 = v1->i128 == v2->u32;
+                       break;
+               case PSI_T_INT64:
+                       res->u8 = v1->i128 == v2->i64;
+                       break;
+               case PSI_T_UINT64:
+                       res->u8 = v1->i128 == v2->u64;
+                       break;
+               case PSI_T_INT128:
+                       res->u8 = v1->i128 == v2->i128;
+                       break;
+               case PSI_T_UINT128:
+                       res->u8 = v1->i128 == v2->u128;
+                       break;
+               case PSI_T_FLOAT:
+                       res->u8 = v1->i128 == v2->fval;
+                       break;
+               case PSI_T_DOUBLE:
+                       res->u8 = v1->i128 == v2->dval;
+                       break;
+#      if HAVE_LONG_DOUBLE
+               case PSI_T_LONG_DOUBLE:
+                       res->u8 = v1->i128 == v2->ldval;
+                       break;
+#      endif
+
+               default:
+                       assert(0);
+                       break;
+               }
+               break;
+       case PSI_T_UINT128:
+               switch (t2) {
+               case PSI_T_INT8:
+                       res->u8 = v1->u128 == v2->i8;
+                       break;
+               case PSI_T_UINT8:
+                       res->u8 = v1->u128 == v2->u8;
+                       break;
+               case PSI_T_INT16:
+                       res->u8 = v1->u128 == v2->i16;
+                       break;
+               case PSI_T_UINT16:
+                       res->u8 = v1->u128 == v2->u16;
+                       break;
+               case PSI_T_INT32:
+                       res->u8 = v1->u128 == v2->i32;
+                       break;
+               case PSI_T_UINT32:
+                       res->u8 = v1->u128 == v2->u32;
+                       break;
+               case PSI_T_INT64:
+                       res->u8 = v1->u128 == v2->i64;
+                       break;
+               case PSI_T_UINT64:
+                       res->u8 = v1->u128 == v2->u64;
+                       break;
+               case PSI_T_INT128:
+                       res->u8 = v1->u128 == v2->i128;
+                       break;
+               case PSI_T_UINT128:
+                       res->u8 = v1->u128 == v2->u128;
+                       break;
+               case PSI_T_FLOAT:
+                       res->u8 = v1->u128 == v2->fval;
+                       break;
+               case PSI_T_DOUBLE:
+                       res->u8 = v1->u128 == v2->dval;
+                       break;
+#      if HAVE_LONG_DOUBLE
+               case PSI_T_LONG_DOUBLE:
+                       res->u8 = v1->u128 == v2->ldval;
+                       break;
+#      endif
+
                default:
                        assert(0);
                        break;
@@ -401,6 +547,12 @@ 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;
+               case PSI_T_INT128:
+                       res->u8 = v1->fval == v2->i128;
+                       break;
+               case PSI_T_UINT128:
+                       res->u8 = v1->fval == v2->u128;
+                       break;
                case PSI_T_FLOAT:
                        res->u8 = v1->fval == v2->fval;
                        break;
@@ -444,6 +596,12 @@ 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;
+               case PSI_T_INT128:
+                       res->u8 = v1->dval == v2->i128;
+                       break;
+               case PSI_T_UINT128:
+                       res->u8 = v1->dval == v2->u128;
+                       break;
                case PSI_T_FLOAT:
                        res->u8 = v1->dval == v2->fval;
                        break;
@@ -488,6 +646,12 @@ 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;
+               case PSI_T_INT128:
+                       res->u8 = v1->ldval == v2->i128;
+                       break;
+               case PSI_T_UINT128:
+                       res->u8 = v1->ldval == v2->u128;
+                       break;
                case PSI_T_FLOAT:
                        res->u8 = v1->ldval == v2->fval;
                        break;
@@ -543,6 +707,12 @@ 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;
+               case PSI_T_INT128:
+                       res->u8 = v1->i8 != v2->i128;
+                       break;
+               case PSI_T_UINT128:
+                       res->u8 = v1->i8 != v2->u128;
+                       break;
                case PSI_T_FLOAT:
                        res->u8 = v1->i8 != v2->fval;
                        break;
@@ -586,6 +756,12 @@ 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;
+               case PSI_T_INT128:
+                       res->u8 = v1->u8 != v2->i128;
+                       break;
+               case PSI_T_UINT128:
+                       res->u8 = v1->u8 != v2->u128;
+                       break;
                case PSI_T_FLOAT:
                        res->u8 = v1->u8 != v2->fval;
                        break;
@@ -629,6 +805,12 @@ 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;
+               case PSI_T_INT128:
+                       res->u8 = v1->i16 != v2->i128;
+                       break;
+               case PSI_T_UINT128:
+                       res->u8 = v1->i16 != v2->u128;
+                       break;
                case PSI_T_FLOAT:
                        res->u8 = v1->i16 != v2->fval;
                        break;
@@ -672,6 +854,12 @@ 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;
+               case PSI_T_INT128:
+                       res->u8 = v1->u16 != v2->i128;
+                       break;
+               case PSI_T_UINT128:
+                       res->u8 = v1->u16 != v2->u128;
+                       break;
                case PSI_T_FLOAT:
                        res->u8 = v1->u16 != v2->fval;
                        break;
@@ -715,6 +903,12 @@ 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;
+               case PSI_T_INT128:
+                       res->u8 = v1->i32 != v2->i128;
+                       break;
+               case PSI_T_UINT128:
+                       res->u8 = v1->i32 != v2->u128;
+                       break;
                case PSI_T_FLOAT:
                        res->u8 = v1->i32 != v2->fval;
                        break;
@@ -758,6 +952,12 @@ 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;
+               case PSI_T_INT128:
+                       res->u8 = v1->u32 != v2->i128;
+                       break;
+               case PSI_T_UINT128:
+                       res->u8 = v1->u32 != v2->u128;
+                       break;
                case PSI_T_FLOAT:
                        res->u8 = v1->u32 != v2->fval;
                        break;
@@ -801,6 +1001,12 @@ 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;
+               case PSI_T_INT128:
+                       res->u8 = v1->i64 != v2->i128;
+                       break;
+               case PSI_T_UINT128:
+                       res->u8 = v1->i64 != v2->u128;
+                       break;
                case PSI_T_FLOAT:
                        res->u8 = v1->i64 != v2->fval;
                        break;
@@ -844,6 +1050,12 @@ 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;
+               case PSI_T_INT128:
+                       res->u8 = v1->u64 != v2->i128;
+                       break;
+               case PSI_T_UINT128:
+                       res->u8 = v1->u64 != v2->u128;
+                       break;
                case PSI_T_FLOAT:
                        res->u8 = v1->u64 != v2->fval;
                        break;
@@ -856,6 +1068,104 @@ static inline token_t psi_calc_cmp_ne(token_t t1, impl_val *v1, token_t t2, impl
                        break;
 #      endif
 
+               default:
+                       assert(0);
+                       break;
+               }
+               break;
+       case PSI_T_INT128:
+               switch (t2) {
+               case PSI_T_INT8:
+                       res->u8 = v1->i128 != v2->i8;
+                       break;
+               case PSI_T_UINT8:
+                       res->u8 = v1->i128 != v2->u8;
+                       break;
+               case PSI_T_INT16:
+                       res->u8 = v1->i128 != v2->i16;
+                       break;
+               case PSI_T_UINT16:
+                       res->u8 = v1->i128 != v2->u16;
+                       break;
+               case PSI_T_INT32:
+                       res->u8 = v1->i128 != v2->i32;
+                       break;
+               case PSI_T_UINT32:
+                       res->u8 = v1->i128 != v2->u32;
+                       break;
+               case PSI_T_INT64:
+                       res->u8 = v1->i128 != v2->i64;
+                       break;
+               case PSI_T_UINT64:
+                       res->u8 = v1->i128 != v2->u64;
+                       break;
+               case PSI_T_INT128:
+                       res->u8 = v1->i128 != v2->i128;
+                       break;
+               case PSI_T_UINT128:
+                       res->u8 = v1->i128 != v2->u128;
+                       break;
+               case PSI_T_FLOAT:
+                       res->u8 = v1->i128 != v2->fval;
+                       break;
+               case PSI_T_DOUBLE:
+                       res->u8 = v1->i128 != v2->dval;
+                       break;
+#      if HAVE_LONG_DOUBLE
+               case PSI_T_LONG_DOUBLE:
+                       res->u8 = v1->i128 != v2->ldval;
+                       break;
+#      endif
+
+               default:
+                       assert(0);
+                       break;
+               }
+               break;
+       case PSI_T_UINT128:
+               switch (t2) {
+               case PSI_T_INT8:
+                       res->u8 = v1->u128 != v2->i8;
+                       break;
+               case PSI_T_UINT8:
+                       res->u8 = v1->u128 != v2->u8;
+                       break;
+               case PSI_T_INT16:
+                       res->u8 = v1->u128 != v2->i16;
+                       break;
+               case PSI_T_UINT16:
+                       res->u8 = v1->u128 != v2->u16;
+                       break;
+               case PSI_T_INT32:
+                       res->u8 = v1->u128 != v2->i32;
+                       break;
+               case PSI_T_UINT32:
+                       res->u8 = v1->u128 != v2->u32;
+                       break;
+               case PSI_T_INT64:
+                       res->u8 = v1->u128 != v2->i64;
+                       break;
+               case PSI_T_UINT64:
+                       res->u8 = v1->u128 != v2->u64;
+                       break;
+               case PSI_T_INT128:
+                       res->u8 = v1->u128 != v2->i128;
+                       break;
+               case PSI_T_UINT128:
+                       res->u8 = v1->u128 != v2->u128;
+                       break;
+               case PSI_T_FLOAT:
+                       res->u8 = v1->u128 != v2->fval;
+                       break;
+               case PSI_T_DOUBLE:
+                       res->u8 = v1->u128 != v2->dval;
+                       break;
+#      if HAVE_LONG_DOUBLE
+               case PSI_T_LONG_DOUBLE:
+                       res->u8 = v1->u128 != v2->ldval;
+                       break;
+#      endif
+
                default:
                        assert(0);
                        break;
@@ -887,6 +1197,12 @@ 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;
+               case PSI_T_INT128:
+                       res->u8 = v1->fval != v2->i128;
+                       break;
+               case PSI_T_UINT128:
+                       res->u8 = v1->fval != v2->u128;
+                       break;
                case PSI_T_FLOAT:
                        res->u8 = v1->fval != v2->fval;
                        break;
@@ -930,6 +1246,12 @@ 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;
+               case PSI_T_INT128:
+                       res->u8 = v1->dval != v2->i128;
+                       break;
+               case PSI_T_UINT128:
+                       res->u8 = v1->dval != v2->u128;
+                       break;
                case PSI_T_FLOAT:
                        res->u8 = v1->dval != v2->fval;
                        break;
@@ -974,6 +1296,12 @@ 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;
+               case PSI_T_INT128:
+                       res->u8 = v1->ldval != v2->i128;
+                       break;
+               case PSI_T_UINT128:
+                       res->u8 = v1->ldval != v2->u128;
+                       break;
                case PSI_T_FLOAT:
                        res->u8 = v1->ldval != v2->fval;
                        break;
@@ -1029,6 +1357,12 @@ 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;
+               case PSI_T_INT128:
+                       res->u8 = v1->i8 < v2->i128;
+                       break;
+               case PSI_T_UINT128:
+                       res->u8 = v1->i8 < v2->u128;
+                       break;
                case PSI_T_FLOAT:
                        res->u8 = v1->i8 < v2->fval;
                        break;
@@ -1072,6 +1406,12 @@ 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;
+               case PSI_T_INT128:
+                       res->u8 = v1->u8 < v2->i128;
+                       break;
+               case PSI_T_UINT128:
+                       res->u8 = v1->u8 < v2->u128;
+                       break;
                case PSI_T_FLOAT:
                        res->u8 = v1->u8 < v2->fval;
                        break;
@@ -1115,6 +1455,12 @@ 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;
+               case PSI_T_INT128:
+                       res->u8 = v1->i16 < v2->i128;
+                       break;
+               case PSI_T_UINT128:
+                       res->u8 = v1->i16 < v2->u128;
+                       break;
                case PSI_T_FLOAT:
                        res->u8 = v1->i16 < v2->fval;
                        break;
@@ -1158,6 +1504,12 @@ 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;
+               case PSI_T_INT128:
+                       res->u8 = v1->u16 < v2->i128;
+                       break;
+               case PSI_T_UINT128:
+                       res->u8 = v1->u16 < v2->u128;
+                       break;
                case PSI_T_FLOAT:
                        res->u8 = v1->u16 < v2->fval;
                        break;
@@ -1201,6 +1553,12 @@ 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;
+               case PSI_T_INT128:
+                       res->u8 = v1->i32 < v2->i128;
+                       break;
+               case PSI_T_UINT128:
+                       res->u8 = v1->i32 < v2->u128;
+                       break;
                case PSI_T_FLOAT:
                        res->u8 = v1->i32 < v2->fval;
                        break;
@@ -1244,6 +1602,12 @@ 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;
+               case PSI_T_INT128:
+                       res->u8 = v1->u32 < v2->i128;
+                       break;
+               case PSI_T_UINT128:
+                       res->u8 = v1->u32 < v2->u128;
+                       break;
                case PSI_T_FLOAT:
                        res->u8 = v1->u32 < v2->fval;
                        break;
@@ -1287,6 +1651,12 @@ 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;
+               case PSI_T_INT128:
+                       res->u8 = v1->i64 < v2->i128;
+                       break;
+               case PSI_T_UINT128:
+                       res->u8 = v1->i64 < v2->u128;
+                       break;
                case PSI_T_FLOAT:
                        res->u8 = v1->i64 < v2->fval;
                        break;
@@ -1330,6 +1700,12 @@ 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;
+               case PSI_T_INT128:
+                       res->u8 = v1->u64 < v2->i128;
+                       break;
+               case PSI_T_UINT128:
+                       res->u8 = v1->u64 < v2->u128;
+                       break;
                case PSI_T_FLOAT:
                        res->u8 = v1->u64 < v2->fval;
                        break;
@@ -1347,41 +1723,47 @@ static inline token_t psi_calc_cmp_lt(token_t t1, impl_val *v1, token_t t2, impl
                        break;
                }
                break;
-       case PSI_T_FLOAT:
+       case PSI_T_INT128:
                switch (t2) {
                case PSI_T_INT8:
-                       res->u8 = v1->fval < v2->i8;
+                       res->u8 = v1->i128 < v2->i8;
                        break;
                case PSI_T_UINT8:
-                       res->u8 = v1->fval < v2->u8;
+                       res->u8 = v1->i128 < v2->u8;
                        break;
                case PSI_T_INT16:
-                       res->u8 = v1->fval < v2->i16;
+                       res->u8 = v1->i128 < v2->i16;
                        break;
                case PSI_T_UINT16:
-                       res->u8 = v1->fval < v2->u16;
+                       res->u8 = v1->i128 < v2->u16;
                        break;
                case PSI_T_INT32:
-                       res->u8 = v1->fval < v2->i32;
+                       res->u8 = v1->i128 < v2->i32;
                        break;
                case PSI_T_UINT32:
-                       res->u8 = v1->fval < v2->u32;
+                       res->u8 = v1->i128 < v2->u32;
                        break;
                case PSI_T_INT64:
-                       res->u8 = v1->fval < v2->i64;
+                       res->u8 = v1->i128 < v2->i64;
                        break;
                case PSI_T_UINT64:
-                       res->u8 = v1->fval < v2->u64;
+                       res->u8 = v1->i128 < v2->u64;
+                       break;
+               case PSI_T_INT128:
+                       res->u8 = v1->i128 < v2->i128;
+                       break;
+               case PSI_T_UINT128:
+                       res->u8 = v1->i128 < v2->u128;
                        break;
                case PSI_T_FLOAT:
-                       res->u8 = v1->fval < v2->fval;
+                       res->u8 = v1->i128 < v2->fval;
                        break;
                case PSI_T_DOUBLE:
-                       res->u8 = v1->fval < v2->dval;
+                       res->u8 = v1->i128 < v2->dval;
                        break;
 #      if HAVE_LONG_DOUBLE
                case PSI_T_LONG_DOUBLE:
-                       res->u8 = v1->fval < v2->ldval;
+                       res->u8 = v1->i128 < v2->ldval;
                        break;
 #      endif
 
@@ -1390,41 +1772,47 @@ static inline token_t psi_calc_cmp_lt(token_t t1, impl_val *v1, token_t t2, impl
                        break;
                }
                break;
-       case PSI_T_DOUBLE:
+       case PSI_T_UINT128:
                switch (t2) {
                case PSI_T_INT8:
-                       res->u8 = v1->dval < v2->i8;
+                       res->u8 = v1->u128 < v2->i8;
                        break;
                case PSI_T_UINT8:
-                       res->u8 = v1->dval < v2->u8;
+                       res->u8 = v1->u128 < v2->u8;
                        break;
                case PSI_T_INT16:
-                       res->u8 = v1->dval < v2->i16;
+                       res->u8 = v1->u128 < v2->i16;
                        break;
                case PSI_T_UINT16:
-                       res->u8 = v1->dval < v2->u16;
+                       res->u8 = v1->u128 < v2->u16;
                        break;
                case PSI_T_INT32:
-                       res->u8 = v1->dval < v2->i32;
+                       res->u8 = v1->u128 < v2->i32;
                        break;
                case PSI_T_UINT32:
-                       res->u8 = v1->dval < v2->u32;
+                       res->u8 = v1->u128 < v2->u32;
                        break;
                case PSI_T_INT64:
-                       res->u8 = v1->dval < v2->i64;
+                       res->u8 = v1->u128 < v2->i64;
                        break;
                case PSI_T_UINT64:
-                       res->u8 = v1->dval < v2->u64;
+                       res->u8 = v1->u128 < v2->u64;
+                       break;
+               case PSI_T_INT128:
+                       res->u8 = v1->u128 < v2->i128;
+                       break;
+               case PSI_T_UINT128:
+                       res->u8 = v1->u128 < v2->u128;
                        break;
                case PSI_T_FLOAT:
-                       res->u8 = v1->dval < v2->fval;
+                       res->u8 = v1->u128 < v2->fval;
                        break;
                case PSI_T_DOUBLE:
-                       res->u8 = v1->dval < v2->dval;
+                       res->u8 = v1->u128 < v2->dval;
                        break;
 #      if HAVE_LONG_DOUBLE
                case PSI_T_LONG_DOUBLE:
-                       res->u8 = v1->dval < v2->ldval;
+                       res->u8 = v1->u128 < v2->ldval;
                        break;
 #      endif
 
@@ -1433,42 +1821,47 @@ static inline token_t psi_calc_cmp_lt(token_t t1, impl_val *v1, token_t t2, impl
                        break;
                }
                break;
-#if HAVE_LONG_DOUBLE
-       case PSI_T_LONG_DOUBLE:
+       case PSI_T_FLOAT:
                switch (t2) {
                case PSI_T_INT8:
-                       res->u8 = v1->ldval < v2->i8;
+                       res->u8 = v1->fval < v2->i8;
                        break;
                case PSI_T_UINT8:
-                       res->u8 = v1->ldval < v2->u8;
+                       res->u8 = v1->fval < v2->u8;
                        break;
                case PSI_T_INT16:
-                       res->u8 = v1->ldval < v2->i16;
+                       res->u8 = v1->fval < v2->i16;
                        break;
                case PSI_T_UINT16:
-                       res->u8 = v1->ldval < v2->u16;
+                       res->u8 = v1->fval < v2->u16;
                        break;
                case PSI_T_INT32:
-                       res->u8 = v1->ldval < v2->i32;
+                       res->u8 = v1->fval < v2->i32;
                        break;
                case PSI_T_UINT32:
-                       res->u8 = v1->ldval < v2->u32;
+                       res->u8 = v1->fval < v2->u32;
                        break;
                case PSI_T_INT64:
-                       res->u8 = v1->ldval < v2->i64;
+                       res->u8 = v1->fval < v2->i64;
                        break;
                case PSI_T_UINT64:
-                       res->u8 = v1->ldval < v2->u64;
+                       res->u8 = v1->fval < v2->u64;
+                       break;
+               case PSI_T_INT128:
+                       res->u8 = v1->fval < v2->i128;
+                       break;
+               case PSI_T_UINT128:
+                       res->u8 = v1->fval < v2->u128;
                        break;
                case PSI_T_FLOAT:
-                       res->u8 = v1->ldval < v2->fval;
+                       res->u8 = v1->fval < v2->fval;
                        break;
                case PSI_T_DOUBLE:
-                       res->u8 = v1->ldval < v2->dval;
+                       res->u8 = v1->fval < v2->dval;
                        break;
 #      if HAVE_LONG_DOUBLE
                case PSI_T_LONG_DOUBLE:
-                       res->u8 = v1->ldval < v2->ldval;
+                       res->u8 = v1->fval < v2->ldval;
                        break;
 #      endif
 
@@ -1477,15 +1870,114 @@ static inline token_t psi_calc_cmp_lt(token_t t1, impl_val *v1, token_t t2, impl
                        break;
                }
                break;
-#endif
-
-       default:
-               assert(0);
-               break;
-       }
-       return PSI_T_UINT8;
-}
-
+       case PSI_T_DOUBLE:
+               switch (t2) {
+               case PSI_T_INT8:
+                       res->u8 = v1->dval < v2->i8;
+                       break;
+               case PSI_T_UINT8:
+                       res->u8 = v1->dval < v2->u8;
+                       break;
+               case PSI_T_INT16:
+                       res->u8 = v1->dval < v2->i16;
+                       break;
+               case PSI_T_UINT16:
+                       res->u8 = v1->dval < v2->u16;
+                       break;
+               case PSI_T_INT32:
+                       res->u8 = v1->dval < v2->i32;
+                       break;
+               case PSI_T_UINT32:
+                       res->u8 = v1->dval < v2->u32;
+                       break;
+               case PSI_T_INT64:
+                       res->u8 = v1->dval < v2->i64;
+                       break;
+               case PSI_T_UINT64:
+                       res->u8 = v1->dval < v2->u64;
+                       break;
+               case PSI_T_INT128:
+                       res->u8 = v1->dval < v2->i128;
+                       break;
+               case PSI_T_UINT128:
+                       res->u8 = v1->dval < v2->u128;
+                       break;
+               case PSI_T_FLOAT:
+                       res->u8 = v1->dval < v2->fval;
+                       break;
+               case PSI_T_DOUBLE:
+                       res->u8 = v1->dval < v2->dval;
+                       break;
+#      if HAVE_LONG_DOUBLE
+               case PSI_T_LONG_DOUBLE:
+                       res->u8 = v1->dval < v2->ldval;
+                       break;
+#      endif
+
+               default:
+                       assert(0);
+                       break;
+               }
+               break;
+#if HAVE_LONG_DOUBLE
+       case PSI_T_LONG_DOUBLE:
+               switch (t2) {
+               case PSI_T_INT8:
+                       res->u8 = v1->ldval < v2->i8;
+                       break;
+               case PSI_T_UINT8:
+                       res->u8 = v1->ldval < v2->u8;
+                       break;
+               case PSI_T_INT16:
+                       res->u8 = v1->ldval < v2->i16;
+                       break;
+               case PSI_T_UINT16:
+                       res->u8 = v1->ldval < v2->u16;
+                       break;
+               case PSI_T_INT32:
+                       res->u8 = v1->ldval < v2->i32;
+                       break;
+               case PSI_T_UINT32:
+                       res->u8 = v1->ldval < v2->u32;
+                       break;
+               case PSI_T_INT64:
+                       res->u8 = v1->ldval < v2->i64;
+                       break;
+               case PSI_T_UINT64:
+                       res->u8 = v1->ldval < v2->u64;
+                       break;
+               case PSI_T_INT128:
+                       res->u8 = v1->ldval < v2->i128;
+                       break;
+               case PSI_T_UINT128:
+                       res->u8 = v1->ldval < v2->u128;
+                       break;
+               case PSI_T_FLOAT:
+                       res->u8 = v1->ldval < v2->fval;
+                       break;
+               case PSI_T_DOUBLE:
+                       res->u8 = v1->ldval < v2->dval;
+                       break;
+#      if HAVE_LONG_DOUBLE
+               case PSI_T_LONG_DOUBLE:
+                       res->u8 = v1->ldval < v2->ldval;
+                       break;
+#      endif
+
+               default:
+                       assert(0);
+                       break;
+               }
+               break;
+#endif
+
+       default:
+               assert(0);
+               break;
+       }
+       return PSI_T_UINT8;
+}
+
 static inline token_t psi_calc_cmp_gt(token_t t1, impl_val *v1, token_t t2, impl_val *v2, impl_val *res)
 {
        switch (t1) {
@@ -1515,6 +2007,12 @@ 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;
+               case PSI_T_INT128:
+                       res->u8 = v1->i8 > v2->i128;
+                       break;
+               case PSI_T_UINT128:
+                       res->u8 = v1->i8 > v2->u128;
+                       break;
                case PSI_T_FLOAT:
                        res->u8 = v1->i8 > v2->fval;
                        break;
@@ -1558,6 +2056,12 @@ 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;
+               case PSI_T_INT128:
+                       res->u8 = v1->u8 > v2->i128;
+                       break;
+               case PSI_T_UINT128:
+                       res->u8 = v1->u8 > v2->u128;
+                       break;
                case PSI_T_FLOAT:
                        res->u8 = v1->u8 > v2->fval;
                        break;
@@ -1601,6 +2105,12 @@ 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;
+               case PSI_T_INT128:
+                       res->u8 = v1->i16 > v2->i128;
+                       break;
+               case PSI_T_UINT128:
+                       res->u8 = v1->i16 > v2->u128;
+                       break;
                case PSI_T_FLOAT:
                        res->u8 = v1->i16 > v2->fval;
                        break;
@@ -1644,6 +2154,12 @@ 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;
+               case PSI_T_INT128:
+                       res->u8 = v1->u16 > v2->i128;
+                       break;
+               case PSI_T_UINT128:
+                       res->u8 = v1->u16 > v2->u128;
+                       break;
                case PSI_T_FLOAT:
                        res->u8 = v1->u16 > v2->fval;
                        break;
@@ -1687,6 +2203,12 @@ 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;
+               case PSI_T_INT128:
+                       res->u8 = v1->i32 > v2->i128;
+                       break;
+               case PSI_T_UINT128:
+                       res->u8 = v1->i32 > v2->u128;
+                       break;
                case PSI_T_FLOAT:
                        res->u8 = v1->i32 > v2->fval;
                        break;
@@ -1730,6 +2252,12 @@ 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;
+               case PSI_T_INT128:
+                       res->u8 = v1->u32 > v2->i128;
+                       break;
+               case PSI_T_UINT128:
+                       res->u8 = v1->u32 > v2->u128;
+                       break;
                case PSI_T_FLOAT:
                        res->u8 = v1->u32 > v2->fval;
                        break;
@@ -1773,6 +2301,12 @@ 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;
+               case PSI_T_INT128:
+                       res->u8 = v1->i64 > v2->i128;
+                       break;
+               case PSI_T_UINT128:
+                       res->u8 = v1->i64 > v2->u128;
+                       break;
                case PSI_T_FLOAT:
                        res->u8 = v1->i64 > v2->fval;
                        break;
@@ -1816,6 +2350,12 @@ 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;
+               case PSI_T_INT128:
+                       res->u8 = v1->u64 > v2->i128;
+                       break;
+               case PSI_T_UINT128:
+                       res->u8 = v1->u64 > v2->u128;
+                       break;
                case PSI_T_FLOAT:
                        res->u8 = v1->u64 > v2->fval;
                        break;
@@ -1828,6 +2368,104 @@ static inline token_t psi_calc_cmp_gt(token_t t1, impl_val *v1, token_t t2, impl
                        break;
 #      endif
 
+               default:
+                       assert(0);
+                       break;
+               }
+               break;
+       case PSI_T_INT128:
+               switch (t2) {
+               case PSI_T_INT8:
+                       res->u8 = v1->i128 > v2->i8;
+                       break;
+               case PSI_T_UINT8:
+                       res->u8 = v1->i128 > v2->u8;
+                       break;
+               case PSI_T_INT16:
+                       res->u8 = v1->i128 > v2->i16;
+                       break;
+               case PSI_T_UINT16:
+                       res->u8 = v1->i128 > v2->u16;
+                       break;
+               case PSI_T_INT32:
+                       res->u8 = v1->i128 > v2->i32;
+                       break;
+               case PSI_T_UINT32:
+                       res->u8 = v1->i128 > v2->u32;
+                       break;
+               case PSI_T_INT64:
+                       res->u8 = v1->i128 > v2->i64;
+                       break;
+               case PSI_T_UINT64:
+                       res->u8 = v1->i128 > v2->u64;
+                       break;
+               case PSI_T_INT128:
+                       res->u8 = v1->i128 > v2->i128;
+                       break;
+               case PSI_T_UINT128:
+                       res->u8 = v1->i128 > v2->u128;
+                       break;
+               case PSI_T_FLOAT:
+                       res->u8 = v1->i128 > v2->fval;
+                       break;
+               case PSI_T_DOUBLE:
+                       res->u8 = v1->i128 > v2->dval;
+                       break;
+#      if HAVE_LONG_DOUBLE
+               case PSI_T_LONG_DOUBLE:
+                       res->u8 = v1->i128 > v2->ldval;
+                       break;
+#      endif
+
+               default:
+                       assert(0);
+                       break;
+               }
+               break;
+       case PSI_T_UINT128:
+               switch (t2) {
+               case PSI_T_INT8:
+                       res->u8 = v1->u128 > v2->i8;
+                       break;
+               case PSI_T_UINT8:
+                       res->u8 = v1->u128 > v2->u8;
+                       break;
+               case PSI_T_INT16:
+                       res->u8 = v1->u128 > v2->i16;
+                       break;
+               case PSI_T_UINT16:
+                       res->u8 = v1->u128 > v2->u16;
+                       break;
+               case PSI_T_INT32:
+                       res->u8 = v1->u128 > v2->i32;
+                       break;
+               case PSI_T_UINT32:
+                       res->u8 = v1->u128 > v2->u32;
+                       break;
+               case PSI_T_INT64:
+                       res->u8 = v1->u128 > v2->i64;
+                       break;
+               case PSI_T_UINT64:
+                       res->u8 = v1->u128 > v2->u64;
+                       break;
+               case PSI_T_INT128:
+                       res->u8 = v1->u128 > v2->i128;
+                       break;
+               case PSI_T_UINT128:
+                       res->u8 = v1->u128 > v2->u128;
+                       break;
+               case PSI_T_FLOAT:
+                       res->u8 = v1->u128 > v2->fval;
+                       break;
+               case PSI_T_DOUBLE:
+                       res->u8 = v1->u128 > v2->dval;
+                       break;
+#      if HAVE_LONG_DOUBLE
+               case PSI_T_LONG_DOUBLE:
+                       res->u8 = v1->u128 > v2->ldval;
+                       break;
+#      endif
+
                default:
                        assert(0);
                        break;
@@ -1859,6 +2497,12 @@ 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;
+               case PSI_T_INT128:
+                       res->u8 = v1->fval > v2->i128;
+                       break;
+               case PSI_T_UINT128:
+                       res->u8 = v1->fval > v2->u128;
+                       break;
                case PSI_T_FLOAT:
                        res->u8 = v1->fval > v2->fval;
                        break;
@@ -1902,6 +2546,12 @@ 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;
+               case PSI_T_INT128:
+                       res->u8 = v1->dval > v2->i128;
+                       break;
+               case PSI_T_UINT128:
+                       res->u8 = v1->dval > v2->u128;
+                       break;
                case PSI_T_FLOAT:
                        res->u8 = v1->dval > v2->fval;
                        break;
@@ -1946,6 +2596,12 @@ 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;
+               case PSI_T_INT128:
+                       res->u8 = v1->ldval > v2->i128;
+                       break;
+               case PSI_T_UINT128:
+                       res->u8 = v1->ldval > v2->u128;
+                       break;
                case PSI_T_FLOAT:
                        res->u8 = v1->ldval > v2->fval;
                        break;
@@ -2001,6 +2657,12 @@ 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;
+               case PSI_T_INT128:
+                       res->u8 = v1->i8 <= v2->i128;
+                       break;
+               case PSI_T_UINT128:
+                       res->u8 = v1->i8 <= v2->u128;
+                       break;
                case PSI_T_FLOAT:
                        res->u8 = v1->i8 <= v2->fval;
                        break;
@@ -2044,6 +2706,12 @@ 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;
+               case PSI_T_INT128:
+                       res->u8 = v1->u8 <= v2->i128;
+                       break;
+               case PSI_T_UINT128:
+                       res->u8 = v1->u8 <= v2->u128;
+                       break;
                case PSI_T_FLOAT:
                        res->u8 = v1->u8 <= v2->fval;
                        break;
@@ -2087,6 +2755,12 @@ 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;
+               case PSI_T_INT128:
+                       res->u8 = v1->i16 <= v2->i128;
+                       break;
+               case PSI_T_UINT128:
+                       res->u8 = v1->i16 <= v2->u128;
+                       break;
                case PSI_T_FLOAT:
                        res->u8 = v1->i16 <= v2->fval;
                        break;
@@ -2130,6 +2804,12 @@ 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;
+               case PSI_T_INT128:
+                       res->u8 = v1->u16 <= v2->i128;
+                       break;
+               case PSI_T_UINT128:
+                       res->u8 = v1->u16 <= v2->u128;
+                       break;
                case PSI_T_FLOAT:
                        res->u8 = v1->u16 <= v2->fval;
                        break;
@@ -2173,6 +2853,12 @@ 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;
+               case PSI_T_INT128:
+                       res->u8 = v1->i32 <= v2->i128;
+                       break;
+               case PSI_T_UINT128:
+                       res->u8 = v1->i32 <= v2->u128;
+                       break;
                case PSI_T_FLOAT:
                        res->u8 = v1->i32 <= v2->fval;
                        break;
@@ -2216,6 +2902,12 @@ 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;
+               case PSI_T_INT128:
+                       res->u8 = v1->u32 <= v2->i128;
+                       break;
+               case PSI_T_UINT128:
+                       res->u8 = v1->u32 <= v2->u128;
+                       break;
                case PSI_T_FLOAT:
                        res->u8 = v1->u32 <= v2->fval;
                        break;
@@ -2259,6 +2951,12 @@ 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;
+               case PSI_T_INT128:
+                       res->u8 = v1->i64 <= v2->i128;
+                       break;
+               case PSI_T_UINT128:
+                       res->u8 = v1->i64 <= v2->u128;
+                       break;
                case PSI_T_FLOAT:
                        res->u8 = v1->i64 <= v2->fval;
                        break;
@@ -2302,6 +3000,12 @@ 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;
+               case PSI_T_INT128:
+                       res->u8 = v1->u64 <= v2->i128;
+                       break;
+               case PSI_T_UINT128:
+                       res->u8 = v1->u64 <= v2->u128;
+                       break;
                case PSI_T_FLOAT:
                        res->u8 = v1->u64 <= v2->fval;
                        break;
@@ -2314,6 +3018,104 @@ static inline token_t psi_calc_cmp_le(token_t t1, impl_val *v1, token_t t2, impl
                        break;
 #      endif
 
+               default:
+                       assert(0);
+                       break;
+               }
+               break;
+       case PSI_T_INT128:
+               switch (t2) {
+               case PSI_T_INT8:
+                       res->u8 = v1->i128 <= v2->i8;
+                       break;
+               case PSI_T_UINT8:
+                       res->u8 = v1->i128 <= v2->u8;
+                       break;
+               case PSI_T_INT16:
+                       res->u8 = v1->i128 <= v2->i16;
+                       break;
+               case PSI_T_UINT16:
+                       res->u8 = v1->i128 <= v2->u16;
+                       break;
+               case PSI_T_INT32:
+                       res->u8 = v1->i128 <= v2->i32;
+                       break;
+               case PSI_T_UINT32:
+                       res->u8 = v1->i128 <= v2->u32;
+                       break;
+               case PSI_T_INT64:
+                       res->u8 = v1->i128 <= v2->i64;
+                       break;
+               case PSI_T_UINT64:
+                       res->u8 = v1->i128 <= v2->u64;
+                       break;
+               case PSI_T_INT128:
+                       res->u8 = v1->i128 <= v2->i128;
+                       break;
+               case PSI_T_UINT128:
+                       res->u8 = v1->i128 <= v2->u128;
+                       break;
+               case PSI_T_FLOAT:
+                       res->u8 = v1->i128 <= v2->fval;
+                       break;
+               case PSI_T_DOUBLE:
+                       res->u8 = v1->i128 <= v2->dval;
+                       break;
+#      if HAVE_LONG_DOUBLE
+               case PSI_T_LONG_DOUBLE:
+                       res->u8 = v1->i128 <= v2->ldval;
+                       break;
+#      endif
+
+               default:
+                       assert(0);
+                       break;
+               }
+               break;
+       case PSI_T_UINT128:
+               switch (t2) {
+               case PSI_T_INT8:
+                       res->u8 = v1->u128 <= v2->i8;
+                       break;
+               case PSI_T_UINT8:
+                       res->u8 = v1->u128 <= v2->u8;
+                       break;
+               case PSI_T_INT16:
+                       res->u8 = v1->u128 <= v2->i16;
+                       break;
+               case PSI_T_UINT16:
+                       res->u8 = v1->u128 <= v2->u16;
+                       break;
+               case PSI_T_INT32:
+                       res->u8 = v1->u128 <= v2->i32;
+                       break;
+               case PSI_T_UINT32:
+                       res->u8 = v1->u128 <= v2->u32;
+                       break;
+               case PSI_T_INT64:
+                       res->u8 = v1->u128 <= v2->i64;
+                       break;
+               case PSI_T_UINT64:
+                       res->u8 = v1->u128 <= v2->u64;
+                       break;
+               case PSI_T_INT128:
+                       res->u8 = v1->u128 <= v2->i128;
+                       break;
+               case PSI_T_UINT128:
+                       res->u8 = v1->u128 <= v2->u128;
+                       break;
+               case PSI_T_FLOAT:
+                       res->u8 = v1->u128 <= v2->fval;
+                       break;
+               case PSI_T_DOUBLE:
+                       res->u8 = v1->u128 <= v2->dval;
+                       break;
+#      if HAVE_LONG_DOUBLE
+               case PSI_T_LONG_DOUBLE:
+                       res->u8 = v1->u128 <= v2->ldval;
+                       break;
+#      endif
+
                default:
                        assert(0);
                        break;
@@ -2345,6 +3147,12 @@ 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;
+               case PSI_T_INT128:
+                       res->u8 = v1->fval <= v2->i128;
+                       break;
+               case PSI_T_UINT128:
+                       res->u8 = v1->fval <= v2->u128;
+                       break;
                case PSI_T_FLOAT:
                        res->u8 = v1->fval <= v2->fval;
                        break;
@@ -2388,6 +3196,12 @@ 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;
+               case PSI_T_INT128:
+                       res->u8 = v1->dval <= v2->i128;
+                       break;
+               case PSI_T_UINT128:
+                       res->u8 = v1->dval <= v2->u128;
+                       break;
                case PSI_T_FLOAT:
                        res->u8 = v1->dval <= v2->fval;
                        break;
@@ -2432,6 +3246,12 @@ 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;
+               case PSI_T_INT128:
+                       res->u8 = v1->ldval <= v2->i128;
+                       break;
+               case PSI_T_UINT128:
+                       res->u8 = v1->ldval <= v2->u128;
+                       break;
                case PSI_T_FLOAT:
                        res->u8 = v1->ldval <= v2->fval;
                        break;
@@ -2487,6 +3307,12 @@ 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;
+               case PSI_T_INT128:
+                       res->u8 = v1->i8 >= v2->i128;
+                       break;
+               case PSI_T_UINT128:
+                       res->u8 = v1->i8 >= v2->u128;
+                       break;
                case PSI_T_FLOAT:
                        res->u8 = v1->i8 >= v2->fval;
                        break;
@@ -2530,6 +3356,12 @@ 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;
+               case PSI_T_INT128:
+                       res->u8 = v1->u8 >= v2->i128;
+                       break;
+               case PSI_T_UINT128:
+                       res->u8 = v1->u8 >= v2->u128;
+                       break;
                case PSI_T_FLOAT:
                        res->u8 = v1->u8 >= v2->fval;
                        break;
@@ -2573,6 +3405,12 @@ 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;
+               case PSI_T_INT128:
+                       res->u8 = v1->i16 >= v2->i128;
+                       break;
+               case PSI_T_UINT128:
+                       res->u8 = v1->i16 >= v2->u128;
+                       break;
                case PSI_T_FLOAT:
                        res->u8 = v1->i16 >= v2->fval;
                        break;
@@ -2616,6 +3454,12 @@ 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;
+               case PSI_T_INT128:
+                       res->u8 = v1->u16 >= v2->i128;
+                       break;
+               case PSI_T_UINT128:
+                       res->u8 = v1->u16 >= v2->u128;
+                       break;
                case PSI_T_FLOAT:
                        res->u8 = v1->u16 >= v2->fval;
                        break;
@@ -2659,6 +3503,12 @@ 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;
+               case PSI_T_INT128:
+                       res->u8 = v1->i32 >= v2->i128;
+                       break;
+               case PSI_T_UINT128:
+                       res->u8 = v1->i32 >= v2->u128;
+                       break;
                case PSI_T_FLOAT:
                        res->u8 = v1->i32 >= v2->fval;
                        break;
@@ -2702,6 +3552,12 @@ 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;
+               case PSI_T_INT128:
+                       res->u8 = v1->u32 >= v2->i128;
+                       break;
+               case PSI_T_UINT128:
+                       res->u8 = v1->u32 >= v2->u128;
+                       break;
                case PSI_T_FLOAT:
                        res->u8 = v1->u32 >= v2->fval;
                        break;
@@ -2745,6 +3601,12 @@ 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;
+               case PSI_T_INT128:
+                       res->u8 = v1->i64 >= v2->i128;
+                       break;
+               case PSI_T_UINT128:
+                       res->u8 = v1->i64 >= v2->u128;
+                       break;
                case PSI_T_FLOAT:
                        res->u8 = v1->i64 >= v2->fval;
                        break;
@@ -2788,6 +3650,12 @@ 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;
+               case PSI_T_INT128:
+                       res->u8 = v1->u64 >= v2->i128;
+                       break;
+               case PSI_T_UINT128:
+                       res->u8 = v1->u64 >= v2->u128;
+                       break;
                case PSI_T_FLOAT:
                        res->u8 = v1->u64 >= v2->fval;
                        break;
@@ -2800,6 +3668,104 @@ static inline token_t psi_calc_cmp_ge(token_t t1, impl_val *v1, token_t t2, impl
                        break;
 #      endif
 
+               default:
+                       assert(0);
+                       break;
+               }
+               break;
+       case PSI_T_INT128:
+               switch (t2) {
+               case PSI_T_INT8:
+                       res->u8 = v1->i128 >= v2->i8;
+                       break;
+               case PSI_T_UINT8:
+                       res->u8 = v1->i128 >= v2->u8;
+                       break;
+               case PSI_T_INT16:
+                       res->u8 = v1->i128 >= v2->i16;
+                       break;
+               case PSI_T_UINT16:
+                       res->u8 = v1->i128 >= v2->u16;
+                       break;
+               case PSI_T_INT32:
+                       res->u8 = v1->i128 >= v2->i32;
+                       break;
+               case PSI_T_UINT32:
+                       res->u8 = v1->i128 >= v2->u32;
+                       break;
+               case PSI_T_INT64:
+                       res->u8 = v1->i128 >= v2->i64;
+                       break;
+               case PSI_T_UINT64:
+                       res->u8 = v1->i128 >= v2->u64;
+                       break;
+               case PSI_T_INT128:
+                       res->u8 = v1->i128 >= v2->i128;
+                       break;
+               case PSI_T_UINT128:
+                       res->u8 = v1->i128 >= v2->u128;
+                       break;
+               case PSI_T_FLOAT:
+                       res->u8 = v1->i128 >= v2->fval;
+                       break;
+               case PSI_T_DOUBLE:
+                       res->u8 = v1->i128 >= v2->dval;
+                       break;
+#      if HAVE_LONG_DOUBLE
+               case PSI_T_LONG_DOUBLE:
+                       res->u8 = v1->i128 >= v2->ldval;
+                       break;
+#      endif
+
+               default:
+                       assert(0);
+                       break;
+               }
+               break;
+       case PSI_T_UINT128:
+               switch (t2) {
+               case PSI_T_INT8:
+                       res->u8 = v1->u128 >= v2->i8;
+                       break;
+               case PSI_T_UINT8:
+                       res->u8 = v1->u128 >= v2->u8;
+                       break;
+               case PSI_T_INT16:
+                       res->u8 = v1->u128 >= v2->i16;
+                       break;
+               case PSI_T_UINT16:
+                       res->u8 = v1->u128 >= v2->u16;
+                       break;
+               case PSI_T_INT32:
+                       res->u8 = v1->u128 >= v2->i32;
+                       break;
+               case PSI_T_UINT32:
+                       res->u8 = v1->u128 >= v2->u32;
+                       break;
+               case PSI_T_INT64:
+                       res->u8 = v1->u128 >= v2->i64;
+                       break;
+               case PSI_T_UINT64:
+                       res->u8 = v1->u128 >= v2->u64;
+                       break;
+               case PSI_T_INT128:
+                       res->u8 = v1->u128 >= v2->i128;
+                       break;
+               case PSI_T_UINT128:
+                       res->u8 = v1->u128 >= v2->u128;
+                       break;
+               case PSI_T_FLOAT:
+                       res->u8 = v1->u128 >= v2->fval;
+                       break;
+               case PSI_T_DOUBLE:
+                       res->u8 = v1->u128 >= v2->dval;
+                       break;
+#      if HAVE_LONG_DOUBLE
+               case PSI_T_LONG_DOUBLE:
+                       res->u8 = v1->u128 >= v2->ldval;
+                       break;
+#      endif
+
                default:
                        assert(0);
                        break;
@@ -2831,6 +3797,12 @@ 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;
+               case PSI_T_INT128:
+                       res->u8 = v1->fval >= v2->i128;
+                       break;
+               case PSI_T_UINT128:
+                       res->u8 = v1->fval >= v2->u128;
+                       break;
                case PSI_T_FLOAT:
                        res->u8 = v1->fval >= v2->fval;
                        break;
@@ -2874,6 +3846,12 @@ 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;
+               case PSI_T_INT128:
+                       res->u8 = v1->dval >= v2->i128;
+                       break;
+               case PSI_T_UINT128:
+                       res->u8 = v1->dval >= v2->u128;
+                       break;
                case PSI_T_FLOAT:
                        res->u8 = v1->dval >= v2->fval;
                        break;
@@ -2918,6 +3896,12 @@ 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;
+               case PSI_T_INT128:
+                       res->u8 = v1->ldval >= v2->i128;
+                       break;
+               case PSI_T_UINT128:
+                       res->u8 = v1->ldval >= v2->u128;
+                       break;
                case PSI_T_FLOAT:
                        res->u8 = v1->ldval >= v2->fval;
                        break;