WARNING! Access to this system is limited to authorised users only.
Unauthorised users may be subject to prosecution.
Unauthorised access to this system is a criminal offence under Australian law (Federal Crimes Act 1914 Part VIA)
It is a criminal offence to:
(1) Obtain access to data without authority. -Penalty 2 years imprisonment.
(2) Damage, delete, alter or insert data without authority. -Penalty 10 years imprisonment.
User activity is monitored and recorded. Anyone using this system expressly consents to such monitoring and recording.

To protect your data, the CISO officer has suggested users to enable 2FA as soon as possible.
Currently 2.7% of users enabled 2FA.

Commit 9a01d171 authored by qinsoon's avatar qinsoon
Browse files

fix urem fail. peepopt should not remove 'mov %ah %al'

parent 62171d49
......@@ -10,4 +10,5 @@ Cargo.lock
.idea
*.pyc
*.o
*.dylib
mu-client-pypy
......@@ -162,6 +162,30 @@ pub fn get_alias_for_length(id: MuID, length: usize) -> P<Value> {
}
}
pub fn is_aliased(id1: MuID, id2: MuID) -> bool {
if get_color_for_precolroed(id1) == get_color_for_precolroed(id2) {
macro_rules! is_match {
($a1: expr, $a2: expr; $b: expr) => {
$a1 == $b.id() || $a2 == $b.id()
}
};
if is_match!(id1, id2; AH) {
return false;
} else if is_match!(id1, id2; BH) {
return false;
} else if is_match!(id1, id2; CH) {
return false;
} else if is_match!(id1, id2; DH) {
return false;
} else {
return true;
}
} else {
return false;
}
}
pub fn get_color_for_precolroed(id: MuID) -> MuID {
if id < FPR_ID_START {
match GPR_ALIAS_LOOKUP.get(&id) {
......
......@@ -25,7 +25,8 @@ pub mod x86_64;
#[cfg(target_arch = "x86_64")]
pub use compiler::backend::x86_64::init_machine_regs_for_func;
#[cfg(target_arch = "x86_64")]
pub use compiler::backend::x86_64::is_aliased;
#[cfg(target_arch = "x86_64")]
pub use compiler::backend::x86_64::get_color_for_precolroed;
#[cfg(target_arch = "x86_64")]
......
......@@ -44,9 +44,8 @@ impl PeepholeOptimization {
}
};
if backend::get_color_for_precolroed(src_machine_reg)
== backend::get_color_for_precolroed(dst_machine_reg) {
trace!("Redundant! removed");
if backend::is_aliased(src_machine_reg, dst_machine_reg) {
trace!("move between {} and {} is redundant! removed", src_machine_reg, dst_machine_reg);
// redundant, remove this move
cf.mc_mut().set_inst_nop(inst);
} else {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment