remove i128OfDec

This commit is contained in:
Fabian Schmalzried 2024-03-19 17:11:30 +01:00
parent f145f73aa0
commit 4269608ebf
No known key found for this signature in database
GPG Key ID: D691D5DA4CEF42E7
7 changed files with 4 additions and 13 deletions

View File

@ -97,12 +97,9 @@ hashI64 = \hasher, n -> addU64 hasher (Num.toU64 n)
hashI128 : a, I128 -> a where a implements Hasher
hashI128 = \hasher, n -> addU128 hasher (Num.toU128 n)
## LOWLEVEL get the i128 representation of a Dec.
i128OfDec : Dec -> I128
## Adds a single [Dec] to a hasher.
hashDec : a, Dec -> a where a implements Hasher
hashDec = \hasher, n -> hashI128 hasher (i128OfDec n)
hashDec = \hasher, n -> hashI128 hasher (Num.withoutDecimalPoint n)
## Adds a container of [Hash]able elements to a [Hasher] by hashing each element.
## The container is iterated using the walk method passed in.

View File

@ -204,7 +204,6 @@ map_symbol_to_lowlevel_and_arity! {
NumCountLeadingZeroBits; NUM_COUNT_LEADING_ZERO_BITS; 1,
NumCountTrailingZeroBits; NUM_COUNT_TRAILING_ZERO_BITS; 1,
NumCountOneBits; NUM_COUNT_ONE_BITS; 1,
I128OfDec; I128_OF_DEC; 1,
NumWithoutDecimalPoint; NUM_WITHOUT_DECIMAL_POINT; 1,
NumWithDecimalPoint; NUM_WITH_DECIMAL_POINT; 1,
NumF32ToParts; NUM_F32_TO_PARTS; 1,

View File

@ -1172,7 +1172,7 @@ pub(crate) fn run_low_level<'a, 'ctx>(
// which could be useful to look at when implementing this.
todo!("implement checked float conversion");
}
I128OfDec | NumWithoutDecimalPoint | NumWithDecimalPoint => {
NumWithoutDecimalPoint | NumWithDecimalPoint => {
arguments!(arg);
arg
}

View File

@ -2017,9 +2017,7 @@ impl<'a> LowLevelCall<'a> {
NumToFloatChecked => {
todo!("implement toF32Checked and toF64Checked");
}
I128OfDec | NumWithoutDecimalPoint => {
self.load_args_and_call_zig(backend, bitcode::DEC_TO_I128)
}
NumWithoutDecimalPoint => self.load_args_and_call_zig(backend, bitcode::DEC_TO_I128),
NumWithDecimalPoint => self.load_args_and_call_zig(backend, bitcode::DEC_FROM_I128),
NumF32ToParts => self.load_args_and_call_zig(backend, bitcode::NUM_F32_TO_PARTS),
NumF64ToParts => self.load_args_and_call_zig(backend, bitcode::NUM_F64_TO_PARTS),

View File

@ -108,7 +108,6 @@ pub enum LowLevel {
NumF64ToParts,
NumF32FromParts,
NumF64FromParts,
I128OfDec,
Eq,
NotEq,
And,
@ -342,7 +341,6 @@ map_symbol_to_lowlevel! {
NumCountLeadingZeroBits <= NUM_COUNT_LEADING_ZERO_BITS;
NumCountTrailingZeroBits <= NUM_COUNT_TRAILING_ZERO_BITS;
NumCountOneBits <= NUM_COUNT_ONE_BITS;
I128OfDec <= I128_OF_DEC;
NumWithoutDecimalPoint <= NUM_WITHOUT_DECIMAL_POINT;
NumWithDecimalPoint <= NUM_WITH_DECIMAL_POINT;
NumF32ToParts <= NUM_F32_TO_PARTS;

View File

@ -1597,7 +1597,7 @@ fn low_level_no_rc(lowlevel: &LowLevel) -> RC {
| NumF64ToParts
| NumF32FromParts
| NumF64FromParts => RC::NoRc,
I128OfDec | NumWithoutDecimalPoint | NumWithDecimalPoint => RC::NoRc,
NumWithoutDecimalPoint | NumWithDecimalPoint => RC::NoRc,
DictPseudoSeed => RC::NoRc,
StrStartsWith | StrEndsWith => RC::NoRc,
StrFromUtf8 => RC::Rc,

View File

@ -1345,7 +1345,6 @@ pub(crate) fn lowlevel_borrow_signature(op: LowLevel) -> &'static [Ownership] {
| NumCountLeadingZeroBits
| NumCountTrailingZeroBits
| NumCountOneBits
| I128OfDec
| NumWithoutDecimalPoint
| NumWithDecimalPoint
| NumF32ToParts