diff options
author | Xavier Leroy <xavier.leroy@inria.fr> | 1997-11-17 14:45:22 +0000 |
---|---|---|
committer | Xavier Leroy <xavier.leroy@inria.fr> | 1997-11-17 14:45:22 +0000 |
commit | c3984c64666935a3c9a5e3c7722808f614569a87 (patch) | |
tree | 7f4588e7ccb537c4dda3457c6ffabe61c21b50b5 /asmcomp/hppa | |
parent | 86cd1df7badc807c295b62ad76321dd8c2f5775a (diff) |
Contraintes de registres sur div et mod
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@1774 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
Diffstat (limited to 'asmcomp/hppa')
-rw-r--r-- | asmcomp/hppa/selection.ml | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/asmcomp/hppa/selection.ml b/asmcomp/hppa/selection.ml index 96fc9d376..a61c116f3 100644 --- a/asmcomp/hppa/selection.ml +++ b/asmcomp/hppa/selection.ml @@ -17,6 +17,7 @@ open Misc open Cmm open Reg open Arch +open Proc open Mach let shiftadd = function @@ -88,6 +89,20 @@ method select_operation op args = | _ -> super#select_operation op args +(* Deal with register constraints *) + +method insert_op op rs rd = + match op with + Iintop(Idiv | Imod) -> (* handled via calls to millicode *) + let rs' = [|phys_reg 20; phys_reg 19|] (* %r26, %r25 *) + and rd' = [|phys_reg 22|] (* %r29 *) in + self#insert_moves rs rs'; + self#insert (Iop op) rs' rd'; + self#insert_moves rd' rd; + rd + | _ -> + super#insert_op op rs rd + end let fundecl f = (new selector ())#emit_fundecl f |