Various fixes to the complex addressing module
This commit is contained in:
parent
6aa5784e22
commit
dc0fe08dab
@ -3,6 +3,8 @@ use crate::complex_addressing::CacheSlicing::{
|
|||||||
};
|
};
|
||||||
use cpuid::{CPUVendor, MicroArchitecture};
|
use cpuid::{CPUVendor, MicroArchitecture};
|
||||||
|
|
||||||
|
#[cfg(feature = "no_std")]
|
||||||
|
use alloc::collections::VecDeque;
|
||||||
#[cfg(feature = "no_std")]
|
#[cfg(feature = "no_std")]
|
||||||
use hashbrown::HashMap;
|
use hashbrown::HashMap;
|
||||||
#[cfg(feature = "no_std")]
|
#[cfg(feature = "no_std")]
|
||||||
@ -12,6 +14,7 @@ use hashbrown::HashSet;
|
|||||||
use std::collections::HashMap;
|
use std::collections::HashMap;
|
||||||
#[cfg(feature = "use_std")]
|
#[cfg(feature = "use_std")]
|
||||||
use std::collections::HashSet;
|
use std::collections::HashSet;
|
||||||
|
#[cfg(feature = "use_std")]
|
||||||
use std::collections::VecDeque;
|
use std::collections::VecDeque;
|
||||||
|
|
||||||
#[derive(Debug, Copy, Clone)]
|
#[derive(Debug, Copy, Clone)]
|
||||||
@ -165,8 +168,10 @@ impl CacheSlicing {
|
|||||||
if found_pivot {
|
if found_pivot {
|
||||||
for j in 0..matrix.len() {
|
for j in 0..matrix.len() {
|
||||||
if j != i {
|
if j != i {
|
||||||
matrix[j].0 ^= matrix[i].0;
|
if bit & matrix[j].0 != 0 {
|
||||||
matrix[j].1 ^= matrix[i].1;
|
matrix[j].0 ^= matrix[i].0;
|
||||||
|
matrix[j].1 ^= matrix[i].1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
i += 1;
|
i += 1;
|
||||||
@ -189,8 +194,8 @@ impl CacheSlicing {
|
|||||||
|
|
||||||
pub fn image(&self, mask: usize) -> Option<HashSet<u8>> {
|
pub fn image(&self, mask: usize) -> Option<HashSet<u8>> {
|
||||||
match self {
|
match self {
|
||||||
ComplexAddressing(functions) => {
|
ComplexAddressing(_functions) => {
|
||||||
let mut matrix = self.pivot(mask);
|
let matrix = self.pivot(mask);
|
||||||
|
|
||||||
let mut result = HashSet::<u8>::new();
|
let mut result = HashSet::<u8>::new();
|
||||||
result.insert(0);
|
result.insert(0);
|
||||||
@ -210,7 +215,7 @@ impl CacheSlicing {
|
|||||||
|
|
||||||
pub fn kernel_compl_basis(&self, mask: usize) -> Option<HashMap<u8, usize>> {
|
pub fn kernel_compl_basis(&self, mask: usize) -> Option<HashMap<u8, usize>> {
|
||||||
match self {
|
match self {
|
||||||
ComplexAddressing(functions) => {
|
ComplexAddressing(_functions) => {
|
||||||
let matrix = self.pivot(mask);
|
let matrix = self.pivot(mask);
|
||||||
let mut result = HashMap::new();
|
let mut result = HashMap::new();
|
||||||
for (slice, addr) in matrix {
|
for (slice, addr) in matrix {
|
||||||
|
Loading…
Reference in New Issue
Block a user