From 60e5ad384e6b748a780148e9232b9bb44cd08cec Mon Sep 17 00:00:00 2001 From: Graydon Hoare Date: Tue, 10 Aug 2010 16:49:36 -0700 Subject: Put out burning tinderbox on OSX. --- src/boot/be/x86.ml | 27 +++++++++++++++++++-------- 1 file changed, 19 insertions(+), 8 deletions(-) (limited to 'src/boot/be') diff --git a/src/boot/be/x86.ml b/src/boot/be/x86.ml index 71f9cdcf..f879027b 100644 --- a/src/boot/be/x86.ml +++ b/src/boot/be/x86.ml @@ -311,14 +311,25 @@ let emit_target_specific Il.Mem (Il.next_spill_slot e (Il.ScalarTy (Il.operand_scalar_ty op))) in - let lhs_spill = next_spill_like lhs in - let rhs_spill = next_spill_like rhs in - - mov lhs_spill lhs; - mov rhs_spill rhs; - - mov lhs_eax (Il.Cell lhs_spill); - mov rhs_ecx (Il.Cell rhs_spill); + let is_eax cell = + match cell with + Il.Cell (Il.Reg (Il.Hreg hr, _)) -> hr = eax + | _ -> false + in + if is_eax lhs + then + mov rhs_ecx rhs + else + begin + let lhs_spill = next_spill_like lhs in + let rhs_spill = next_spill_like rhs in + + mov lhs_spill lhs; + mov rhs_spill rhs; + + mov lhs_eax (Il.Cell lhs_spill); + mov rhs_ecx (Il.Cell rhs_spill); + end; put (Il.Binary { b with -- cgit v1.2.3