GitLab will continue to be upgraded from 11.4.5-ce.0 on November 25th 2019 at 4.00pm (AEDT) to 5.00pm (AEDT) due to Critical Security Patch Availability. During the update, GitLab and Mattermost services will not be available.

Commit 64dba9a5 authored by Isaac Oscar Gariano's avatar Isaac Oscar Gariano

Stoped rustfmt from breaking rodal macros

parent e1fab4a1
Pipeline #751 passed with stages
in 30 minutes and 38 seconds
trailing_comma = "Never"
......@@ -94,7 +94,7 @@ pub trait CodeGenerator {
&mut self,
dest1: Reg, /*GPR or FPR*/
dest2: Reg, /*GPR or FPR*/
src: Mem,
src: Mem
); // [base, #simm7]
// Stores
......@@ -114,7 +114,7 @@ pub trait CodeGenerator {
&mut self,
dest: Mem,
src1: Reg, /*GPR or FPR*/
src2: Reg, /*GPR or FPR*/
src2: Reg /*GPR or FPR*/
); // [base, #simm7]
// Calls
......@@ -124,14 +124,14 @@ pub trait CodeGenerator {
func: MuName,
pe: Option<MuName>,
args: Vec<P<Value>>,
is_native: bool,
is_native: bool
) -> ValueLocation;
fn emit_blr(
&mut self,
callsite: String,
func: Reg,
pe: Option<MuName>,
args: Vec<P<Value>>,
args: Vec<P<Value>>
) -> ValueLocation;
// Branches
......@@ -222,7 +222,7 @@ pub trait CodeGenerator {
src1: Reg, /*GPR or SP*/
src2: Reg,
signed: bool,
shift: u8,
shift: u8
);
fn emit_adds_ext(
&mut self,
......@@ -230,7 +230,7 @@ pub trait CodeGenerator {
src1: Reg, /*GPR or SP*/
src2: Reg,
signed: bool,
shift: u8,
shift: u8
);
fn emit_sub_ext(
&mut self,
......@@ -238,7 +238,7 @@ pub trait CodeGenerator {
src1: Reg, /*GPR or SP*/
src2: Reg,
signed: bool,
shift: u8,
shift: u8
);
fn emit_subs_ext(
&mut self,
......@@ -246,7 +246,7 @@ pub trait CodeGenerator {
src1: Reg, /*GPR or SP*/
src2: Reg,
signed: bool,
shift: u8,
shift: u8
);
// Multiplication
......@@ -315,7 +315,7 @@ pub trait CodeGenerator {
dest: Reg, /*GPR or SP*/
src1: Reg, /*GPR or SP*/
src2: u16,
shift: bool,
shift: bool
);
fn emit_adds_imm(&mut self, dest: Reg, src1: Reg /*GPR or SP*/, src2: u16, shift: bool);
fn emit_sub_imm(
......@@ -323,7 +323,7 @@ pub trait CodeGenerator {
dest: Reg, /*GPR or SP*/
src1: Reg, /*GPR or SP*/
src2: u16,
shift: bool,
shift: bool
);
fn emit_subs_imm(&mut self, dest: Reg, src1: Reg /*GPR or SP*/, src2: u16, shift: bool);
......@@ -346,28 +346,28 @@ pub trait CodeGenerator {
dest: Reg, /*64*/
src1: Reg, /*32*/
src2: Reg, /*32*/
src3: Reg, /*64*/
src3: Reg /*64*/
);
fn emit_smsubl(
&mut self,
dest: Reg, /*64*/
src1: Reg, /*32*/
src2: Reg, /*32*/
src3: Reg, /*64*/
src3: Reg /*64*/
);
fn emit_umaddl(
&mut self,
dest: Reg, /*64*/
src1: Reg, /*32*/
src2: Reg, /*32*/
src3: Reg, /*64*/
src3: Reg /*64*/
);
fn emit_umsubl(
&mut self,
dest: Reg, /*64*/
src1: Reg, /*32*/
src2: Reg, /*32*/
src3: Reg, /*64*/
src3: Reg /*64*/
);
fn emit_fmadd(&mut self, dest: Reg, src1: Reg, src2: Reg, src3: Reg);
fn emit_fmsub(&mut self, dest: Reg, src1: Reg, src2: Reg, src3: Reg);
......
This diff is collapsed.
......@@ -226,19 +226,19 @@ pub trait CodeGenerator {
callsite: String,
func: MuName,
pe: Option<MuName>,
is_native: bool,
is_native: bool
) -> ValueLocation;
fn emit_call_near_r64(
&mut self,
callsite: String,
func: &P<Value>,
pe: Option<MuName>,
pe: Option<MuName>
) -> ValueLocation;
fn emit_call_near_mem64(
&mut self,
callsite: String,
func: &P<Value>,
pe: Option<MuName>,
pe: Option<MuName>
) -> ValueLocation;
fn emit_ret(&mut self);
......
......@@ -183,7 +183,7 @@ pub fn get_alias_for_length(id: MuID, length: usize) -> P<Value> {
if id < FPR_ID_START {
let vec = match GPR_ALIAS_TABLE.get(&id) {
Some(vec) => vec,
None => panic!("didnt find {} as GPR", id),
None => panic!("didnt find {} as GPR", id)
};
match length {
......@@ -192,7 +192,7 @@ pub fn get_alias_for_length(id: MuID, length: usize) -> P<Value> {
16 => vec[2].clone(),
8 => vec[3].clone(),
1 => vec[3].clone(),
_ => panic!("unexpected length {} for {}", length, vec[0]),
_ => panic!("unexpected length {} for {}", length, vec[0])
}
} else {
for r in ALL_FPRS.iter() {
......@@ -239,7 +239,7 @@ pub fn get_color_for_precolored(id: MuID) -> MuID {
if id < FPR_ID_START {
match GPR_ALIAS_LOOKUP.get(&id) {
Some(val) => val.id(),
None => panic!("cannot find GPR {}", id),
None => panic!("cannot find GPR {}", id)
}
} else {
// we do not have alias for FPRs
......@@ -256,7 +256,7 @@ pub fn check_op_len(op: &P<Value>) -> usize {
Some(16) => 16,
Some(8) => 8,
Some(1) => 8,
_ => panic!("unsupported register length for x64: {}", op.ty),
_ => panic!("unsupported register length for x64: {}", op.ty)
}
}
......@@ -514,7 +514,7 @@ pub fn number_of_usable_regs_in_group(group: RegGroup) -> usize {
match group {
RegGroup::GPR => ALL_USABLE_GPRS.len(),
RegGroup::GPREX => ALL_USABLE_GPRS.len(),
RegGroup::FPR => ALL_USABLE_FPRS.len(),
RegGroup::FPR => ALL_USABLE_FPRS.len()
}
}
......@@ -603,7 +603,7 @@ pub fn is_valid_x86_imm(op: &P<Value>) -> bool {
match op.v {
Value_::Constant(Constant::Int(val))
if val as i32 >= i32::MIN && val as i32 <= i32::MAX => true,
_ => false,
_ => false
}
} else {
false
......@@ -665,6 +665,6 @@ pub fn estimate_insts_for_ir(inst: &Instruction) -> usize {
PrintHex(_) => 10,
SetRetval(_) => 10,
ExnInstruction { ref inner, .. } => estimate_insts_for_ir(&inner),
_ => unimplemented!(),
_ => unimplemented!()
}
}
......@@ -31,13 +31,13 @@ pub const EMIT_MUIR: bool = true;
pub const EMIT_MC_DOT: bool = true;
pub struct CodeEmission {
name: &'static str,
name: &'static str
}
impl CodeEmission {
pub fn new() -> CodeEmission {
CodeEmission {
name: "Code Emission",
name: "Code Emission"
}
}
}
......@@ -85,7 +85,7 @@ fn create_emit_file(name: String, vm: &VM) -> File {
why
)
}
Ok(file) => file,
Ok(file) => file
}
}
......@@ -105,7 +105,7 @@ pub fn emit_mu_types(suffix: &str, vm: &VM) {
why
)
}
Ok(file) => file,
Ok(file) => file
};
{
......
......@@ -205,7 +205,7 @@ pub struct BackendType {
pub elem_size: Option<ByteSize>,
/// GC type, containing information for GC (this is a temporary design)
/// See Issue#12
pub gc_type: P<GCType>,
pub gc_type: P<GCType>
}
rodal_struct!(BackendType {
......@@ -239,37 +239,37 @@ impl BackendType {
alignment: 1,
struct_layout: None,
elem_size: None,
gc_type: mm::add_gc_type(GCType::new_noreftype(1, 1)),
gc_type: mm::add_gc_type(GCType::new_noreftype(1, 1))
},
9...16 => BackendType {
size: 2,
alignment: 2,
struct_layout: None,
elem_size: None,
gc_type: mm::add_gc_type(GCType::new_noreftype(2, 2)),
gc_type: mm::add_gc_type(GCType::new_noreftype(2, 2))
},
17...32 => BackendType {
size: 4,
alignment: 4,
struct_layout: None,
elem_size: None,
gc_type: mm::add_gc_type(GCType::new_noreftype(4, 4)),
gc_type: mm::add_gc_type(GCType::new_noreftype(4, 4))
},
33...64 => BackendType {
size: 8,
alignment: 8,
struct_layout: None,
elem_size: None,
gc_type: mm::add_gc_type(GCType::new_noreftype(8, 8)),
gc_type: mm::add_gc_type(GCType::new_noreftype(8, 8))
},
128 => BackendType {
size: 16,
alignment: 16,
struct_layout: None,
elem_size: None,
gc_type: mm::add_gc_type(GCType::new_noreftype(16, 16)),
gc_type: mm::add_gc_type(GCType::new_noreftype(16, 16))
},
_ => unimplemented!(),
_ => unimplemented!()
}
}
// reference of any type
......@@ -278,7 +278,7 @@ impl BackendType {
alignment: 8,
struct_layout: None,
elem_size: None,
gc_type: mm::add_gc_type(GCType::new_reftype()),
gc_type: mm::add_gc_type(GCType::new_reftype())
},
// pointer/opque ref
MuType_::UPtr(_) |
......@@ -290,7 +290,7 @@ impl BackendType {
alignment: 8,
struct_layout: None,
elem_size: None,
gc_type: mm::add_gc_type(GCType::new_noreftype(8, 8)),
gc_type: mm::add_gc_type(GCType::new_noreftype(8, 8))
},
// tagref
MuType_::Tagref64 => BackendType {
......@@ -298,7 +298,7 @@ impl BackendType {
alignment: 8,
struct_layout: None,
elem_size: None,
gc_type: mm::add_gc_type(GCType::new_reftype()),
gc_type: mm::add_gc_type(GCType::new_reftype())
},
// floating point
MuType_::Float => BackendType {
......@@ -306,14 +306,14 @@ impl BackendType {
alignment: 4,
struct_layout: None,
elem_size: None,
gc_type: mm::add_gc_type(GCType::new_noreftype(4, 4)),
gc_type: mm::add_gc_type(GCType::new_noreftype(4, 4))
},
MuType_::Double => BackendType {
size: 8,
alignment: 8,
struct_layout: None,
elem_size: None,
gc_type: mm::add_gc_type(GCType::new_noreftype(8, 8)),
gc_type: mm::add_gc_type(GCType::new_noreftype(8, 8))
},
// array
MuType_::Array(ref ty, len) => {
......@@ -341,9 +341,9 @@ impl BackendType {
align,
Some(RefPattern::Repeat {
pattern: Box::new(RefPattern::NestedType(vec![ele_ty.gc_type])),
count: len,
}),
)),
count: len
})
))
}
}
// struct
......@@ -390,10 +390,10 @@ impl BackendType {
alignment: 1,
struct_layout: None,
elem_size: None,
gc_type: mm::add_gc_type(GCType::new_noreftype(0, 1)),
gc_type: mm::add_gc_type(GCType::new_noreftype(0, 1))
},
// vector
MuType_::Vector(_, _) => unimplemented!(),
MuType_::Vector(_, _) => unimplemented!()
}
}
......@@ -451,12 +451,12 @@ impl BackendType {
Some(if use_ref_offsets {
RefPattern::Map {
offsets: ref_offsets,
size: size,
size: size
}
} else {
RefPattern::NestedType(gc_types)
}),
)),
})
))
}
}
......@@ -498,7 +498,7 @@ pub enum RegGroup {
/// requires two general purpose register
GPREX,
/// floating point register
FPR,
FPR
}
rodal_enum!(RegGroup { GPR, GPREX, FPR });
......@@ -524,7 +524,7 @@ impl RegGroup {
MuType_::Float => RegGroup::FPR,
MuType_::Double => RegGroup::FPR,
_ => unimplemented!(),
_ => unimplemented!()
}
}
......
......@@ -21,7 +21,7 @@ use compiler::backend;
use std::any::Any;
pub struct PeepholeOptimization {
name: &'static str,
name: &'static str
}
impl CompilerPass for PeepholeOptimization {
......@@ -67,7 +67,7 @@ impl CompilerPass for PeepholeOptimization {
impl PeepholeOptimization {
pub fn new() -> PeepholeOptimization {
PeepholeOptimization {
name: "Peephole Optimization",
name: "Peephole Optimization"
}
}
......@@ -93,13 +93,13 @@ impl PeepholeOptimization {
let src_machine_reg: MuID = {
match cf.temps.get(&src) {
Some(reg) => *reg,
None => src,
None => src
}
};
let dst_machine_reg: MuID = {
match cf.temps.get(&dst) {
Some(reg) => *reg,
None => dst,
None => dst
}
};
......@@ -180,10 +180,10 @@ impl PeepholeOptimization {
cur_inst = first_inst;
last_dest = Some(dest2.clone());
}
None => break,
None => break
}
}
None => break,
None => break
}
}
last_dest
......
......@@ -92,7 +92,7 @@ pub struct GraphColoring<'a> {
/// we need to log all registers get spilled with their spill location
spill_history: LinkedHashMap<MuID, P<Value>>,
/// we need to know the mapping between scratch temp -> original temp
spill_scratch_temps: LinkedHashMap<MuID, MuID>,
spill_scratch_temps: LinkedHashMap<MuID, MuID>
}
impl<'a> GraphColoring<'a> {
......@@ -100,7 +100,7 @@ impl<'a> GraphColoring<'a> {
pub fn start(
func: &'a mut MuFunctionVersion,
cf: &'a mut CompiledFunction,
vm: &'a VM,
vm: &'a VM
) -> GraphColoring<'a> {
GraphColoring::start_with_spill_history(
LinkedHashMap::new(),
......@@ -108,7 +108,7 @@ impl<'a> GraphColoring<'a> {
0,
func,
cf,
vm,
vm
)
}
......@@ -119,7 +119,7 @@ impl<'a> GraphColoring<'a> {
iteration_count: usize,
func: &'a mut MuFunctionVersion,
cf: &'a mut CompiledFunction,
vm: &'a VM,
vm: &'a VM
) -> GraphColoring<'a> {
assert!(
iteration_count < MAX_REWRITE_ITERATIONS_ALLOWED,
......@@ -163,7 +163,7 @@ impl<'a> GraphColoring<'a> {
worklist_freeze: LinkedHashSet::new(),
frozen_moves: LinkedHashSet::new(),
worklist_simplify: LinkedHashSet::new(),
select_stack: Vec::new(),
select_stack: Vec::new()
};
coloring.regalloc()
......@@ -267,7 +267,7 @@ impl<'a> GraphColoring<'a> {
self.iteration_count,
self.func,
self.cf,
self.vm,
self.vm
);
}
......@@ -374,7 +374,7 @@ impl<'a> GraphColoring<'a> {
// holding an immmutable reference of self(self.ig)
fn movelist_mut(
list: &mut LinkedHashMap<NodeIndex, RefCell<Vec<Move>>>,
node: NodeIndex,
node: NodeIndex
) -> &RefCell<Vec<Move>> {
GraphColoring::movelist_check(list, node);
unsafe { GraphColoring::movelist_nocheck(list, node) }
......@@ -389,7 +389,7 @@ impl<'a> GraphColoring<'a> {
// allows getting the Vec<Move> without a mutable reference of the hashmap
unsafe fn movelist_nocheck(
list: &LinkedHashMap<NodeIndex, RefCell<Vec<Move>>>,
node: NodeIndex,
node: NodeIndex
) -> &RefCell<Vec<Move>> {
list.get(&node).unwrap()
}
......@@ -430,7 +430,7 @@ impl<'a> GraphColoring<'a> {
fn degree(&self, n: NodeIndex) -> usize {
match self.degree.get(&n) {
Some(d) => *d,
None => 0,
None => 0
}
}
......@@ -804,7 +804,7 @@ impl<'a> GraphColoring<'a> {
for reg_id in spills.iter() {
let ssa_entry = match self.func.context.get_value(*reg_id) {
Some(entry) => entry,
None => panic!("The spilled register {} is not in func context", reg_id),
None => panic!("The spilled register {} is not in func context", reg_id)
};
let mem = self.cf
.frame
......
......@@ -30,7 +30,7 @@ use compiler::backend::reg_alloc::validate;
use std::any::Any;
pub struct RegisterAllocation {
name: &'static str,
name: &'static str
}
impl CompilerPass for RegisterAllocation {
......@@ -50,7 +50,7 @@ impl CompilerPass for RegisterAllocation {
impl RegisterAllocation {
pub fn new() -> RegisterAllocation {
RegisterAllocation {
name: "Register Allocation",
name: "Register Allocation"
}
}
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -27,7 +27,7 @@ pub type EntryFuncSig = MuFuncSig;
pub struct RuntimeEntrypoint {
pub sig: P<MuFuncSig>,
pub aot: ValueLocation,
pub jit: RwLock<Option<ValueLocation>>,
pub jit: RwLock<Option<ValueLocation>>
}
lazy_static! {
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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