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.

Commit 1e392836 authored by Yi Lin's avatar Yi Lin
Browse files

Merge branch 'do-not-use-inc-dec' into 'develop'

Do not use inc/dec for add/sub with 1

See merge request !39
parents ff42dd1e f96ea6be
......@@ -2458,14 +2458,6 @@ impl<'a> InstructionSelection {
trace!("emit add-ireg-0");
self.emit_move_node_to_value(&res_tmp, op1, f_content, f_context, vm);
} else if self.match_ireg(op1) && self.match_iconst_one(op2) {
// add one is increment
trace!("emit add-ireg-1");
let reg_op1 = self.emit_ireg(op1, f_content, f_context, vm);
self.backend.emit_mov_r_r(&res_tmp, &reg_op1);
self.backend.emit_inc_r(&res_tmp);
} else if self.match_ireg(op1) && self.match_iimm(op2) {
trace!("emit add-ireg-imm");
......@@ -2528,14 +2520,6 @@ impl<'a> InstructionSelection {
trace!("emit sub-ireg-0");
self.emit_move_node_to_value(&res_tmp, op1, f_content, f_context, vm);
} else if self.match_ireg(op1) && self.match_iconst_one(op2) {
// sub one is decrement
trace!("emit sub-ireg-1");
let reg_op1 = self.emit_ireg(op1, f_content, f_context, vm);
self.backend.emit_mov_r_r(&res_tmp, &reg_op1);
self.backend.emit_dec_r(&res_tmp);
} else if self.match_ireg(op1) && self.match_iimm(op2) {
trace!("emit sub-ireg-imm");
......
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