Always bounce mul/div/mod ops. Closes #131 harder.
This commit is contained in:
parent
5b5bcf9cfb
commit
9f6dec9e13
4 changed files with 7 additions and 37 deletions
|
@ -385,11 +385,7 @@ TASK_XFAILS := test/run-pass/acyclic-unwind.rs \
|
||||||
test/run-pass/threads.rs \
|
test/run-pass/threads.rs \
|
||||||
test/run-pass/yield.rs
|
test/run-pass/yield.rs
|
||||||
|
|
||||||
TEST_XFAILS := test/run-pass/arith-0.rs
|
|
||||||
|
|
||||||
TEST_XFAILS_X86 := $(TASK_XFAILS) \
|
TEST_XFAILS_X86 := $(TASK_XFAILS) \
|
||||||
$(TEST_XFAILS) \
|
|
||||||
test/run-pass/arithmetic-interference.rs \
|
|
||||||
test/run-pass/bind-obj-ctor.rs \
|
test/run-pass/bind-obj-ctor.rs \
|
||||||
test/run-pass/child-outlives-parent.rs \
|
test/run-pass/child-outlives-parent.rs \
|
||||||
test/run-pass/clone-with-exterior.rs \
|
test/run-pass/clone-with-exterior.rs \
|
||||||
|
@ -419,13 +415,11 @@ TEST_XFAILS_X86 := $(TASK_XFAILS) \
|
||||||
test/compile-fail/writing-through-read-alias.rs
|
test/compile-fail/writing-through-read-alias.rs
|
||||||
|
|
||||||
TEST_XFAILS_LLVM := $(TASK_XFAILS) \
|
TEST_XFAILS_LLVM := $(TASK_XFAILS) \
|
||||||
$(TEST_XFAILS) \
|
|
||||||
$(addprefix test/run-pass/, \
|
$(addprefix test/run-pass/, \
|
||||||
arith-1.rs \
|
arith-1.rs \
|
||||||
acyclic-unwind.rs \
|
acyclic-unwind.rs \
|
||||||
alt-pattern-simple.rs \
|
alt-pattern-simple.rs \
|
||||||
alt-tag.rs \
|
alt-tag.rs \
|
||||||
arithmetic-interference.rs \
|
|
||||||
argv.rs \
|
argv.rs \
|
||||||
autoderef-full-lval.rs \
|
autoderef-full-lval.rs \
|
||||||
autoderef-objfn.rs \
|
autoderef-objfn.rs \
|
||||||
|
|
|
@ -303,7 +303,7 @@ let emit_target_specific
|
||||||
let dst_eax = hr_like_cell eax dst in
|
let dst_eax = hr_like_cell eax dst in
|
||||||
let lhs_eax = hr_like_op eax lhs in
|
let lhs_eax = hr_like_op eax lhs in
|
||||||
let rhs_ecx = hr_like_op ecx rhs in
|
let rhs_ecx = hr_like_op ecx rhs in
|
||||||
(* Horrible: we bounce complex mul inputs off spill slots
|
(* Horrible: we bounce mul/div/mod inputs off spill slots
|
||||||
* to ensure non-interference between the temporaries used
|
* to ensure non-interference between the temporaries used
|
||||||
* during mem-base-reg reloads and the registers we're
|
* during mem-base-reg reloads and the registers we're
|
||||||
* preparing. *)
|
* preparing. *)
|
||||||
|
@ -311,31 +311,14 @@ let emit_target_specific
|
||||||
Il.Mem (Il.next_spill_slot e
|
Il.Mem (Il.next_spill_slot e
|
||||||
(Il.ScalarTy (Il.operand_scalar_ty op)))
|
(Il.ScalarTy (Il.operand_scalar_ty op)))
|
||||||
in
|
in
|
||||||
let is_mem op =
|
|
||||||
match op with
|
|
||||||
Il.Cell (Il.Mem _) -> true
|
|
||||||
| _ -> false
|
|
||||||
in
|
|
||||||
let bounce_lhs = is_mem lhs in
|
|
||||||
let bounce_rhs = is_mem rhs in
|
|
||||||
let lhs_spill = next_spill_like lhs in
|
let lhs_spill = next_spill_like lhs in
|
||||||
let rhs_spill = next_spill_like rhs in
|
let rhs_spill = next_spill_like rhs in
|
||||||
|
|
||||||
if bounce_lhs
|
mov lhs_spill lhs;
|
||||||
then mov lhs_spill lhs;
|
mov rhs_spill rhs;
|
||||||
|
|
||||||
if bounce_rhs
|
mov lhs_eax (Il.Cell lhs_spill);
|
||||||
then mov rhs_spill rhs;
|
mov rhs_ecx (Il.Cell rhs_spill);
|
||||||
|
|
||||||
mov lhs_eax
|
|
||||||
(if bounce_lhs
|
|
||||||
then (Il.Cell lhs_spill)
|
|
||||||
else lhs);
|
|
||||||
|
|
||||||
mov rhs_ecx
|
|
||||||
(if bounce_rhs
|
|
||||||
then (Il.Cell rhs_spill)
|
|
||||||
else rhs);
|
|
||||||
|
|
||||||
put (Il.Binary
|
put (Il.Binary
|
||||||
{ b with
|
{ b with
|
||||||
|
|
|
@ -1,7 +0,0 @@
|
||||||
// Testcase for issue #131.
|
|
||||||
|
|
||||||
fn main() -> () {
|
|
||||||
let int a = 10;
|
|
||||||
log a;
|
|
||||||
check (a * (a - 1) == 90);
|
|
||||||
}
|
|
Loading…
Add table
Add a link
Reference in a new issue