diff options
| author | Graydon Hoare <[email protected]> | 2010-08-05 10:04:11 -0700 |
|---|---|---|
| committer | Graydon Hoare <[email protected]> | 2010-08-05 10:04:11 -0700 |
| commit | 29987b56e1dafff4a850eef4e668a364340fc59b (patch) | |
| tree | 6b760dd4406b6bb0087f040626f1b0e37a542f82 /src/boot/be | |
| parent | Add to std._io some formatter/type-specific-writer mechanism. Make a few typ... (diff) | |
| download | rust-29987b56e1dafff4a850eef4e668a364340fc59b.tar.xz rust-29987b56e1dafff4a850eef4e668a364340fc59b.zip | |
Move 'as' precedence up to just above relational; support indexing str and vec by all integral types. Closes #94.
Diffstat (limited to 'src/boot/be')
| -rw-r--r-- | src/boot/be/x86.ml | 19 |
1 files changed, 12 insertions, 7 deletions
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 |