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.6% of users enabled 2FA.

Commit 59cde7c2 authored by Isaac Oscar Gariano's avatar Isaac Oscar Gariano
Browse files

Updated rustfmtint

parent 29035774
...@@ -90,7 +90,7 @@ pub trait CodeGenerator { ...@@ -90,7 +90,7 @@ pub trait CodeGenerator {
&mut self, &mut self,
dest1: Reg, /*GPR or FPR*/ dest1: Reg, /*GPR or FPR*/
dest2: Reg, /*GPR or FPR*/ dest2: Reg, /*GPR or FPR*/
src: Mem src: Mem,
); // [base, #simm7] ); // [base, #simm7]
// Stores // Stores
...@@ -108,7 +108,7 @@ pub trait CodeGenerator { ...@@ -108,7 +108,7 @@ pub trait CodeGenerator {
&mut self, &mut self,
dest: Mem, dest: Mem,
src1: Reg, /*GPR or FPR*/ src1: Reg, /*GPR or FPR*/
src2: Reg /*GPR or FPR*/ src2: Reg, /*GPR or FPR*/
); // [base, #simm7] ); // [base, #simm7]
// Calls // Calls
...@@ -118,14 +118,14 @@ pub trait CodeGenerator { ...@@ -118,14 +118,14 @@ pub trait CodeGenerator {
func: MuName, func: MuName,
pe: Option<MuName>, pe: Option<MuName>,
args: Vec<P<Value>>, args: Vec<P<Value>>,
is_native: bool is_native: bool,
) -> ValueLocation; ) -> ValueLocation;
fn emit_blr( fn emit_blr(
&mut self, &mut self,
callsite: String, callsite: String,
func: Reg, func: Reg,
pe: Option<MuName>, pe: Option<MuName>,
args: Vec<P<Value>> args: Vec<P<Value>>,
) -> ValueLocation; ) -> ValueLocation;
// Branches // Branches
...@@ -214,7 +214,7 @@ pub trait CodeGenerator { ...@@ -214,7 +214,7 @@ pub trait CodeGenerator {
src1: Reg, /*GPR or SP*/ src1: Reg, /*GPR or SP*/
src2: Reg, src2: Reg,
signed: bool, signed: bool,
shift: u8 shift: u8,
); );
fn emit_adds_ext( fn emit_adds_ext(
&mut self, &mut self,
...@@ -222,7 +222,7 @@ pub trait CodeGenerator { ...@@ -222,7 +222,7 @@ pub trait CodeGenerator {
src1: Reg, /*GPR or SP*/ src1: Reg, /*GPR or SP*/
src2: Reg, src2: Reg,
signed: bool, signed: bool,
shift: u8 shift: u8,
); );
fn emit_sub_ext( fn emit_sub_ext(
&mut self, &mut self,
...@@ -230,7 +230,7 @@ pub trait CodeGenerator { ...@@ -230,7 +230,7 @@ pub trait CodeGenerator {
src1: Reg, /*GPR or SP*/ src1: Reg, /*GPR or SP*/
src2: Reg, src2: Reg,
signed: bool, signed: bool,
shift: u8 shift: u8,
); );
fn emit_subs_ext( fn emit_subs_ext(
&mut self, &mut self,
...@@ -238,7 +238,7 @@ pub trait CodeGenerator { ...@@ -238,7 +238,7 @@ pub trait CodeGenerator {
src1: Reg, /*GPR or SP*/ src1: Reg, /*GPR or SP*/
src2: Reg, src2: Reg,
signed: bool, signed: bool,
shift: u8 shift: u8,
); );
// Multiplication // Multiplication
...@@ -307,7 +307,7 @@ pub trait CodeGenerator { ...@@ -307,7 +307,7 @@ pub trait CodeGenerator {
dest: Reg, /*GPR or SP*/ dest: Reg, /*GPR or SP*/
src1: Reg, /*GPR or SP*/ src1: Reg, /*GPR or SP*/
src2: u16, 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_adds_imm(&mut self, dest: Reg, src1: Reg /*GPR or SP*/, src2: u16, shift: bool);
fn emit_sub_imm( fn emit_sub_imm(
...@@ -315,7 +315,7 @@ pub trait CodeGenerator { ...@@ -315,7 +315,7 @@ pub trait CodeGenerator {
dest: Reg, /*GPR or SP*/ dest: Reg, /*GPR or SP*/
src1: Reg, /*GPR or SP*/ src1: Reg, /*GPR or SP*/
src2: u16, src2: u16,
shift: bool shift: bool,
); );
fn emit_subs_imm(&mut self, dest: Reg, src1: Reg /*GPR or SP*/, src2: u16, shift: bool); fn emit_subs_imm(&mut self, dest: Reg, src1: Reg /*GPR or SP*/, src2: u16, shift: bool);
...@@ -338,28 +338,28 @@ pub trait CodeGenerator { ...@@ -338,28 +338,28 @@ pub trait CodeGenerator {
dest: Reg, /*64*/ dest: Reg, /*64*/
src1: Reg, /*32*/ src1: Reg, /*32*/
src2: Reg, /*32*/ src2: Reg, /*32*/
src3: Reg /*64*/ src3: Reg, /*64*/
); );
fn emit_smsubl( fn emit_smsubl(
&mut self, &mut self,
dest: Reg, /*64*/ dest: Reg, /*64*/
src1: Reg, /*32*/ src1: Reg, /*32*/
src2: Reg, /*32*/ src2: Reg, /*32*/
src3: Reg /*64*/ src3: Reg, /*64*/
); );
fn emit_umaddl( fn emit_umaddl(
&mut self, &mut self,
dest: Reg, /*64*/ dest: Reg, /*64*/
src1: Reg, /*32*/ src1: Reg, /*32*/
src2: Reg, /*32*/ src2: Reg, /*32*/
src3: Reg /*64*/ src3: Reg, /*64*/
); );
fn emit_umsubl( fn emit_umsubl(
&mut self, &mut self,
dest: Reg, /*64*/ dest: Reg, /*64*/
src1: Reg, /*32*/ src1: Reg, /*32*/
src2: 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_fmadd(&mut self, dest: Reg, src1: Reg, src2: Reg, src3: Reg);
fn emit_fmsub(&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.
...@@ -227,21 +227,21 @@ pub trait CodeGenerator { ...@@ -227,21 +227,21 @@ pub trait CodeGenerator {
func: MuName, func: MuName,
pe: Option<MuName>, pe: Option<MuName>,
args: Vec<P<Value>>, args: Vec<P<Value>>,
is_native: bool is_native: bool,
) -> ValueLocation; ) -> ValueLocation;
fn emit_call_near_r64( fn emit_call_near_r64(
&mut self, &mut self,
callsite: String, callsite: String,
func: &P<Value>, func: &P<Value>,
pe: Option<MuName>, pe: Option<MuName>,
args: Vec<P<Value>> args: Vec<P<Value>>,
) -> ValueLocation; ) -> ValueLocation;
fn emit_call_near_mem64( fn emit_call_near_mem64(
&mut self, &mut self,
callsite: String, callsite: String,
func: &P<Value>, func: &P<Value>,
pe: Option<MuName>, pe: Option<MuName>,
args: Vec<P<Value>> args: Vec<P<Value>>,
) -> ValueLocation; ) -> ValueLocation;
fn emit_ret(&mut self); fn emit_ret(&mut self);
......
...@@ -179,7 +179,7 @@ pub fn get_alias_for_length(id: MuID, length: usize) -> P<Value> { ...@@ -179,7 +179,7 @@ pub fn get_alias_for_length(id: MuID, length: usize) -> P<Value> {
if id < FPR_ID_START { if id < FPR_ID_START {
let vec = match GPR_ALIAS_TABLE.get(&id) { let vec = match GPR_ALIAS_TABLE.get(&id) {
Some(vec) => vec, Some(vec) => vec,
None => panic!("didnt find {} as GPR", id) None => panic!("didnt find {} as GPR", id),
}; };
match length { match length {
...@@ -188,7 +188,7 @@ pub fn get_alias_for_length(id: MuID, length: usize) -> P<Value> { ...@@ -188,7 +188,7 @@ pub fn get_alias_for_length(id: MuID, length: usize) -> P<Value> {
16 => vec[2].clone(), 16 => vec[2].clone(),
8 => vec[3].clone(), 8 => vec[3].clone(),
1 => vec[3].clone(), 1 => vec[3].clone(),
_ => panic!("unexpected length {} for {}", length, vec[0]) _ => panic!("unexpected length {} for {}", length, vec[0]),
} }
} else { } else {
for r in ALL_FPRS.iter() { for r in ALL_FPRS.iter() {
...@@ -235,7 +235,7 @@ pub fn get_color_for_precolored(id: MuID) -> MuID { ...@@ -235,7 +235,7 @@ pub fn get_color_for_precolored(id: MuID) -> MuID {
if id < FPR_ID_START { if id < FPR_ID_START {
match GPR_ALIAS_LOOKUP.get(&id) { match GPR_ALIAS_LOOKUP.get(&id) {
Some(val) => val.id(), Some(val) => val.id(),
None => panic!("cannot find GPR {}", id) None => panic!("cannot find GPR {}", id),
} }
} else { } else {
// we do not have alias for FPRs // we do not have alias for FPRs
...@@ -252,7 +252,7 @@ pub fn check_op_len(op: &P<Value>) -> usize { ...@@ -252,7 +252,7 @@ pub fn check_op_len(op: &P<Value>) -> usize {
Some(16) => 16, Some(16) => 16,
Some(8) => 8, Some(8) => 8,
Some(1) => 8, Some(1) => 8,
_ => panic!("unsupported register length for x64: {}", op.ty) _ => panic!("unsupported register length for x64: {}", op.ty),
} }
} }
...@@ -510,7 +510,7 @@ pub fn number_of_usable_regs_in_group(group: RegGroup) -> usize { ...@@ -510,7 +510,7 @@ pub fn number_of_usable_regs_in_group(group: RegGroup) -> usize {
match group { match group {
RegGroup::GPR => ALL_USABLE_GPRS.len(), RegGroup::GPR => ALL_USABLE_GPRS.len(),
RegGroup::GPREX => ALL_USABLE_GPRS.len(), RegGroup::GPREX => ALL_USABLE_GPRS.len(),
RegGroup::FPR => ALL_USABLE_FPRS.len() RegGroup::FPR => ALL_USABLE_FPRS.len(),
} }
} }
...@@ -599,7 +599,7 @@ pub fn is_valid_x86_imm(op: &P<Value>) -> bool { ...@@ -599,7 +599,7 @@ pub fn is_valid_x86_imm(op: &P<Value>) -> bool {
match op.v { match op.v {
Value_::Constant(Constant::Int(val)) Value_::Constant(Constant::Int(val))
if val as i32 >= i32::MIN && val as i32 <= i32::MAX => true, if val as i32 >= i32::MIN && val as i32 <= i32::MAX => true,
_ => false _ => false,
} }
} else { } else {
false false
...@@ -661,6 +661,6 @@ pub fn estimate_insts_for_ir(inst: &Instruction) -> usize { ...@@ -661,6 +661,6 @@ pub fn estimate_insts_for_ir(inst: &Instruction) -> usize {
PrintHex(_) => 10, PrintHex(_) => 10,
SetRetval(_) => 10, SetRetval(_) => 10,
ExnInstruction { ref inner, .. } => estimate_insts_for_ir(&inner), ExnInstruction { ref inner, .. } => estimate_insts_for_ir(&inner),
_ => unimplemented!() _ => unimplemented!(),
} }
} }
...@@ -31,13 +31,13 @@ pub const EMIT_MUIR: bool = true; ...@@ -31,13 +31,13 @@ pub const EMIT_MUIR: bool = true;
pub const EMIT_MC_DOT: bool = true; pub const EMIT_MC_DOT: bool = true;
pub struct CodeEmission { pub struct CodeEmission {
name: &'static str name: &'static str,
} }
impl CodeEmission { impl CodeEmission {
pub fn new() -> CodeEmission { pub fn new() -> CodeEmission {
CodeEmission { CodeEmission {
name: "Code Emission" name: "Code Emission",
} }
} }
} }
...@@ -85,7 +85,7 @@ fn create_emit_file(name: String, vm: &VM) -> File { ...@@ -85,7 +85,7 @@ fn create_emit_file(name: String, vm: &VM) -> File {
why why
) )
} }
Ok(file) => file Ok(file) => file,
} }
} }
...@@ -105,7 +105,7 @@ pub fn emit_mu_types(suffix: &str, vm: &VM) { ...@@ -105,7 +105,7 @@ pub fn emit_mu_types(suffix: &str, vm: &VM) {
why why
) )
} }
Ok(file) => file Ok(file) => file,
}; };
{ {
......
...@@ -209,7 +209,7 @@ pub struct BackendType { ...@@ -209,7 +209,7 @@ pub struct BackendType {
pub elem_size: Option<ByteSize>, pub elem_size: Option<ByteSize>,
/// GC type, containing information for GC (this is a temporary design) /// GC type, containing information for GC (this is a temporary design)
/// See Issue#12 /// See Issue#12
pub gc_type: P<GCType> pub gc_type: P<GCType>,
} }
rodal_struct!(BackendType { rodal_struct!(BackendType {
...@@ -217,7 +217,7 @@ rodal_struct!(BackendType { ...@@ -217,7 +217,7 @@ rodal_struct!(BackendType {
alignment, alignment,
struct_layout, struct_layout,
elem_size, elem_size,
gc_type gc_type,
}); });
impl BackendType { impl BackendType {
...@@ -243,37 +243,37 @@ impl BackendType { ...@@ -243,37 +243,37 @@ impl BackendType {
alignment: 1, alignment: 1,
struct_layout: None, struct_layout: None,
elem_size: 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 { 9...16 => BackendType {
size: 2, size: 2,
alignment: 2, alignment: 2,
struct_layout: None, struct_layout: None,
elem_size: 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 { 17...32 => BackendType {
size: 4, size: 4,
alignment: 4, alignment: 4,
struct_layout: None, struct_layout: None,
elem_size: 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 { 33...64 => BackendType {
size: 8, size: 8,
alignment: 8, alignment: 8,
struct_layout: None, struct_layout: None,
elem_size: 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 { 128 => BackendType {
size: 16, size: 16,
alignment: 16, alignment: 16,
struct_layout: None, struct_layout: None,
elem_size: 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 // reference of any type
...@@ -282,7 +282,7 @@ impl BackendType { ...@@ -282,7 +282,7 @@ impl BackendType {
alignment: 8, alignment: 8,
struct_layout: None, struct_layout: None,
elem_size: 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 // pointer/opque ref
MuType_::UPtr(_) | MuType_::UPtr(_) |
...@@ -294,7 +294,7 @@ impl BackendType { ...@@ -294,7 +294,7 @@ impl BackendType {
alignment: 8, alignment: 8,
struct_layout: None, struct_layout: None,
elem_size: 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 // tagref
MuType_::Tagref64 => BackendType { MuType_::Tagref64 => BackendType {
...@@ -302,7 +302,7 @@ impl BackendType { ...@@ -302,7 +302,7 @@ impl BackendType {
alignment: 8, alignment: 8,
struct_layout: None, struct_layout: None,
elem_size: None, elem_size: None,
gc_type: mm::add_gc_type(GCType::new_reftype()) gc_type: mm::add_gc_type(GCType::new_reftype()),
}, },
// floating point // floating point
MuType_::Float => BackendType { MuType_::Float => BackendType {
...@@ -310,14 +310,14 @@ impl BackendType { ...@@ -310,14 +310,14 @@ impl BackendType {
alignment: 4, alignment: 4,
struct_layout: None, struct_layout: None,
elem_size: 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 { MuType_::Double => BackendType {
size: 8, size: 8,
alignment: 8, alignment: 8,
struct_layout: None, struct_layout: None,
elem_size: 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 // array
MuType_::Array(ref ty, len) => { MuType_::Array(ref ty, len) => {
...@@ -344,9 +344,9 @@ impl BackendType { ...@@ -344,9 +344,9 @@ impl BackendType {
align, align,
Some(RefPattern::Repeat { Some(RefPattern::Repeat {
pattern: Box::new(RefPattern::NestedType(vec![ele_ty.gc_type])), pattern: Box::new(RefPattern::NestedType(vec![ele_ty.gc_type])),
count: len count: len,
}) }),
)) )),
} }
} }
// struct // struct
...@@ -393,10 +393,10 @@ impl BackendType { ...@@ -393,10 +393,10 @@ impl BackendType {
alignment: 1, alignment: 1,
struct_layout: None, struct_layout: None,
elem_size: 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 // vector
MuType_::Vector(_, _) => unimplemented!() MuType_::Vector(_, _) => unimplemented!(),
} }
} }
...@@ -454,12 +454,12 @@ impl BackendType { ...@@ -454,12 +454,12 @@ impl BackendType {
Some(if use_ref_offsets { Some(if use_ref_offsets {
RefPattern::Map { RefPattern::Map {
offsets: ref_offsets, offsets: ref_offsets,
size: size size: size,
} }
} else { } else {
RefPattern::NestedType(gc_types) RefPattern::NestedType(gc_types)
}) }),
)) )),
} }
} }
...@@ -501,7 +501,7 @@ pub enum RegGroup { ...@@ -501,7 +501,7 @@ pub enum RegGroup {
/// requires two general purpose register /// requires two general purpose register
GPREX, GPREX,
/// floating point register /// floating point register
FPR FPR,
} }