Move 'as' precedence up to just above relational; support indexing str and vec by all integral types. Closes #94.

This commit is contained in:
Graydon Hoare 2010-08-05 10:04:11 -07:00
parent 718c0b5963
commit 29987b56e1
6 changed files with 67 additions and 37 deletions

View file

@ -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