Commit f26697a0 authored by qinsoon's avatar qinsoon

[wip] fix

parent 77d5e72d
...@@ -260,6 +260,9 @@ impl Instruction_ { ...@@ -260,6 +260,9 @@ impl Instruction_ {
match self { match self {
&Instruction_::BinOp(op, op1, op2) => format!("{:?} {} {}", op, ops[op1], ops[op2]), &Instruction_::BinOp(op, op1, op2) => format!("{:?} {} {}", op, ops[op1], ops[op2]),
&Instruction_::CmpOp(op, op1, op2) => format!("{:?} {} {}", op, ops[op1], ops[op2]), &Instruction_::CmpOp(op, op1, op2) => format!("{:?} {} {}", op, ops[op1], ops[op2]),
&Instruction_::ConvOp{operation, ref from_ty, ref to_ty, operand} => {
format!("{:?} {} {} {}", operation, from_ty, to_ty, ops[operand])
}
&Instruction_::ExprCall{ref data, is_abort} => { &Instruction_::ExprCall{ref data, is_abort} => {
let abort = select_value!(is_abort, "ABORT_ON_EXN", "RETHROW"); let abort = select_value!(is_abort, "ABORT_ON_EXN", "RETHROW");
format!("CALL {} {}", data.debug_str(ops), abort) format!("CALL {} {}", data.debug_str(ops), abort)
......
...@@ -5,6 +5,7 @@ pub fn is_terminal_inst(inst: &Instruction_) -> bool { ...@@ -5,6 +5,7 @@ pub fn is_terminal_inst(inst: &Instruction_) -> bool {
match inst { match inst {
&BinOp(_, _, _) &BinOp(_, _, _)
| &CmpOp(_, _, _) | &CmpOp(_, _, _)
| &ConvOp{..}
| &ExprCall{..} | &ExprCall{..}
| &Load{..} | &Load{..}
| &Store{..} | &Store{..}
...@@ -49,6 +50,7 @@ pub fn has_side_effect(inst: &Instruction_) -> bool { ...@@ -49,6 +50,7 @@ pub fn has_side_effect(inst: &Instruction_) -> bool {
match inst { match inst {
&BinOp(_, _, _) => false, &BinOp(_, _, _) => false,
&CmpOp(_, _, _) => false, &CmpOp(_, _, _) => false,
&ConvOp{..} => false,
&ExprCall{..} => true, &ExprCall{..} => true,
&Load{..} => true, &Load{..} => true,
&Store{..} => true, &Store{..} => true,
......
...@@ -224,6 +224,7 @@ pub fn pick_op_code_for_inst(inst: &Instruction) -> OpCode { ...@@ -224,6 +224,7 @@ pub fn pick_op_code_for_inst(inst: &Instruction) -> OpCode {
match inst.v { match inst.v {
Instruction_::BinOp(op, _, _) => OpCode::Binary(op), Instruction_::BinOp(op, _, _) => OpCode::Binary(op),
Instruction_::CmpOp(op, _, _) => OpCode::Comparison(op), Instruction_::CmpOp(op, _, _) => OpCode::Comparison(op),
Instruction_::ConvOp{operation, ..} => OpCode::Conversion(operation),
Instruction_::AtomicRMW{op, ..} => OpCode::AtomicRMW(op), Instruction_::AtomicRMW{op, ..} => OpCode::AtomicRMW(op),
Instruction_::ExprCall{..} => OpCode::ExprCall, Instruction_::ExprCall{..} => OpCode::ExprCall,
Instruction_::Load{..} => OpCode::Load, Instruction_::Load{..} => OpCode::Load,
......
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