From 29987b56e1dafff4a850eef4e668a364340fc59b Mon Sep 17 00:00:00 2001 From: Graydon Hoare Date: Thu, 5 Aug 2010 10:04:11 -0700 Subject: Move 'as' precedence up to just above relational; support indexing str and vec by all integral types. Closes #94. --- src/boot/be/x86.ml | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) (limited to 'src/boot/be') diff --git a/src/boot/be/x86.ml b/src/boot/be/x86.ml index 217149c7..2ec34890 100644 --- a/src/boot/be/x86.ml +++ b/src/boot/be/x86.ml @@ -1936,15 +1936,20 @@ let zero (dst:Il.cell) (count:Il.operand) : Asm.frag = ;; let mov (signed:bool) (dst:Il.cell) (src:Il.operand) : Asm.frag = - if is_ty8 (Il.cell_scalar_ty dst) || is_ty8 (Il.operand_scalar_ty src) + if is_ty8 (Il.cell_scalar_ty dst) then begin - (match dst with - Il.Reg (Il.Hreg r, _) - -> assert (is_ok_r8 r) | _ -> ()); - (match src with - Il.Cell (Il.Reg (Il.Hreg r, _)) - -> assert (is_ok_r8 r) | _ -> ()); + match dst with + Il.Reg (Il.Hreg r, _) -> assert (is_ok_r8 r) + | _ -> () + end; + + if is_ty8 (Il.operand_scalar_ty src) + then + begin + match src with + Il.Cell (Il.Reg (Il.Hreg r, _)) -> assert (is_ok_r8 r) + | _ -> () end; match (signed, dst, src) with -- cgit v1.2.3