Clean up big int to LLVM integer code

This commit is contained in:
gingerBill
2021-07-11 16:18:30 +01:00
parent e90e7d4af9
commit 63b572a0ab
5 changed files with 48 additions and 68 deletions
+9
View File
@@ -55,6 +55,8 @@ void big_int_mul_eq(BigInt *dst, BigInt const *x);
void big_int_quo_eq(BigInt *dst, BigInt const *x);
void big_int_rem_eq(BigInt *dst, BigInt const *x);
bool big_int_is_neg(BigInt const *x);
void big_int_add_eq(BigInt *dst, BigInt const *x) {
BigInt res = {};
@@ -450,6 +452,13 @@ void big_int_not(BigInt *dst, BigInt const *x, i32 bit_count, bool is_signed) {
big_int_dealloc(&v);
}
bool big_int_is_neg(BigInt const *x) {
if (x == nullptr) {
return false;
}
return x->sign != MP_ZPOS;
}
char digit_to_char(u8 digit) {
GB_ASSERT(digit < 16);