Skip to content
This repository has been archived by the owner on Feb 18, 2024. It is now read-only.

Commit

Permalink
Added missing impl
Browse files Browse the repository at this point in the history
  • Loading branch information
jorgecarleitao committed Aug 4, 2022
1 parent 918fa2d commit b52522b
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/compute/comparison/simd/packed.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use std::convert::TryInto;
use std::simd::{SimdPartialEq, SimdPartialOrd, ToBitMask};

use crate::types::simd::*;
use crate::types::{days_ms, f16, months_days_ns};
use crate::types::{days_ms, f16, i256, months_days_ns};

use super::*;

Expand Down Expand Up @@ -71,6 +71,7 @@ simd8!(i16, i16x8);
simd8!(i32, i32x8);
simd8!(i64, i64x8);
simd8_native_all!(i128);
simd8_native_all!(i256);
simd8_native!(f16);
simd8_native_partial_eq!(f16);
simd8!(f32, f32x8);
Expand Down
10 changes: 10 additions & 0 deletions src/types/native.rs
Original file line number Diff line number Diff line change
Expand Up @@ -587,6 +587,16 @@ impl NativeType for i256 {
let b = i128::from_be_bytes(b);
Self(ethnum::I256::from_words(a, b))
}

#[inline]
fn from_le_bytes(bytes: Self::Bytes) -> Self {
let (b, a) = bytes.split_at(16);
let a: [u8; 16] = a.try_into().unwrap();
let b: [u8; 16] = b.try_into().unwrap();
let a = i128::from_le_bytes(a);
let b = i128::from_le_bytes(b);
Self(ethnum::I256::from_words(a, b))
}
}

#[cfg(test)]
Expand Down

0 comments on commit b52522b

Please sign in to comment.