CAMLprim value uint40_of_uint128(value v) { CAMLparam1(v); #ifdef HAVE_UINT128 CAMLreturn (copy_uint64(((uint64_t)Uint128_val(v)) << 24)); #else failwith("unimplemented"); CAMLreturn(Val_unit); #endif }
CAMLprim value nativeint_of_uint128(value v) { CAMLparam1(v); #ifdef HAVE_UINT128 CAMLreturn (caml_copy_nativeint((int)Uint128_val(v))); #else failwith("unimplemented"); CAMLreturn(Val_unit); #endif }
CAMLprim value int32_of_uint128(value v) { CAMLparam1(v); #ifdef HAVE_UINT128 CAMLreturn (copy_int32((int32_t)Uint128_val(v))); #else failwith("unimplemented"); CAMLreturn(Val_unit); #endif }
CAMLprim value nativeint_of_uint128(value v) { CAMLparam1(v); CAMLreturn (caml_copy_nativeint((int)Uint128_val(v))); }
CAMLprim value float_of_uint128(value v) { CAMLparam1(v); CAMLreturn (caml_copy_double((double)Uint128_val(v))); }
CAMLprim value int8_of_uint128(value v) { CAMLparam1(v); CAMLreturn (copy_int8((int8_t)Uint128_val(v))); }