ecma_bigint_compare_to_bigint (ecma_value_t left_value, /**< left BigInt value */
                               ecma_value_t right_value) /**< right BigInt value */
{
  JERRY_ASSERT (ecma_is_value_bigint (left_value) && ecma_is_value_bigint (right_value));

  if (left_value == ECMA_BIGINT_ZERO)
  {
    if (right_value == ECMA_BIGINT_ZERO)
    {
      return 0;
    }

    ecma_extended_primitive_t *right_p = ecma_get_extended_primitive_from_value (right_value);
    return ECMA_BIGINT_TO_NEGATED_SIGN (right_p->u.bigint_sign_and_size & ECMA_BIGINT_SIGN);
  }

  ecma_extended_primitive_t *left_p = ecma_get_extended_primitive_from_value (left_value);
  uint32_t left_sign = left_p->u.bigint_sign_and_size & ECMA_BIGINT_SIGN;

  if (right_value == ECMA_BIGINT_ZERO)
  {
    return ECMA_BIGINT_TO_SIGN (left_sign);
  }

  ecma_extended_primitive_t *right_p = ecma_get_extended_primitive_from_value (right_value);
  uint32_t right_sign = right_p->u.bigint_sign_and_size & ECMA_BIGINT_SIGN;

  if ((left_sign ^ right_sign) != 0)
  {
    return ECMA_BIGINT_TO_SIGN (left_sign);
  }

  if (left_sign == 0)
  {
    return ecma_big_uint_compare (left_p, right_p);
  }

  return -ecma_big_uint_compare (left_p, right_p);
} /* ecma_bigint_compare_to_bigint */
ecma_bigint_compare_to_bigint (ecma_value_t left_value,  
                               ecma_value_t right_value)  
{
  JERRY_ASSERT (ecma_is_value_bigint (left_value) && ecma_is_value_bigint (right_value));

  if (left_value == ECMA_BIGINT_ZERO)
  {
    if (right_value == ECMA_BIGINT_ZERO)
    {
      return 0;
    }

    ecma_extended_primitive_t *right_p = ecma_get_extended_primitive_from_value (right_value);
    return ECMA_BIGINT_TO_NEGATED_SIGN (right_p->u.bigint_sign_and_size & ECMA_BIGINT_SIGN);
  }

  ecma_extended_primitive_t *left_p = ecma_get_extended_primitive_from_value (left_value);
  uint32_t left_sign = left_p->u.bigint_sign_and_size & ECMA_BIGINT_SIGN;

  if (right_value == ECMA_BIGINT_ZERO)
  {
    return ECMA_BIGINT_TO_SIGN (left_sign);
  }

  ecma_extended_primitive_t *right_p = ecma_get_extended_primitive_from_value (right_value);
  uint32_t right_sign = right_p->u.bigint_sign_and_size & ECMA_BIGINT_SIGN;

  if ((left_sign ^ right_sign) != 0)
  {
    return ECMA_BIGINT_TO_SIGN (left_sign);
  }

  if (left_sign == 0)
  {
    return ecma_big_uint_compare (left_p, right_p);
  }

  return -ecma_big_uint_compare (left_p, right_p);
}  