mirror of
https://github.com/urbit/ares.git
synced 2024-11-23 00:25:49 +03:00
Rename u128_pair to u64_pair and clarify SoftFloat intent
This commit is contained in:
parent
44ba80cd33
commit
a2749a71cb
@ -472,7 +472,8 @@ impl IndirectAtom {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub unsafe fn as_u128_pair(self) -> Result<[u64; 2]> {
|
/* SoftFloat-compatible ordered pair of 64-bit words */
|
||||||
|
pub unsafe fn as_u64_pair(self) -> Result<[u64; 2]> {
|
||||||
if self.size() <= 2 {
|
if self.size() <= 2 {
|
||||||
let u128_array = &mut [0u64; 2];
|
let u128_array = &mut [0u64; 2];
|
||||||
u128_array.copy_from_slice(&(self.as_slice()[0..2]));
|
u128_array.copy_from_slice(&(self.as_slice()[0..2]));
|
||||||
@ -764,14 +765,15 @@ impl Atom {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub unsafe fn as_u128_pair(self) -> Result<[u64; 2]> {
|
/* SoftFloat-compatible ordered pair of 64-bit words */
|
||||||
|
pub unsafe fn as_u64_pair(self) -> Result<[u64; 2]> {
|
||||||
if self.is_direct() {
|
if self.is_direct() {
|
||||||
let u128_array = &mut [0u64; 2];
|
let u128_array = &mut [0u64; 2];
|
||||||
u128_array[0] = 0x0_u64;
|
u128_array[0] = 0x0_u64;
|
||||||
u128_array[1] = self.as_direct()?.data();
|
u128_array[1] = self.as_direct()?.data();
|
||||||
Ok(*u128_array)
|
Ok(*u128_array)
|
||||||
} else {
|
} else {
|
||||||
unsafe { self.indirect.as_u128_pair() }
|
unsafe { self.indirect.as_u64_pair() }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user