Commit 1ecd47e8 authored by Cyril SIX's avatar Cyril SIX
Browse files

MPPA - Oshr

parent a6c79438
......@@ -193,6 +193,7 @@ Inductive instruction : Type :=
| Paddiw (rd: ireg) (rs: ireg) (imm: int) (**r add immediate *)
| Pandiw (rd: ireg) (rs: ireg) (imm: int) (**r and immediate *)
| Psrliw (rd: ireg) (rs: ireg) (imm: int) (**r shift right logical immediate *)
| Psraw (rd: ireg) (rs1 rs2: ireg) (**r shift right arithmetic *)
(** 32-bit integer register-register instructions *)
| Paddw (rd: ireg) (rs1 rs2: ireg) (**r integer addition *)
......@@ -743,6 +744,8 @@ Definition exec_instr (f: function) (i: instruction) (rs: regset) (m: mem) : out
Next (nextinstr (rs#d <- (Val.and rs##s1 rs##s2))) m
| Pnegw d s =>
Next (nextinstr (rs#d <- (Val.neg rs###s))) m
| Psraw d s1 s2 =>
Next (nextinstr (rs#d <- (Val.shr rs##s1 rs##s2))) m
(** 64-bit integer register-immediate instructions *)
| Paddil d s i =>
......
......@@ -313,10 +313,10 @@ Definition transl_op
| Oshlimm n, a1 :: nil =>
do rd <- ireg_of res; do rs <- ireg_of a1;
OK (Pslliw rd rs n :: k)
| Oshr, a1 :: a2 :: nil =>
*)| Oshr, a1 :: a2 :: nil =>
do rd <- ireg_of res; do rs1 <- ireg_of a1; do rs2 <- ireg_of a2;
OK (Psraw rd rs1 rs2 :: k)
| Oshrimm n, a1 :: nil =>
(*| Oshrimm n, a1 :: nil =>
do rd <- ireg_of res; do rs <- ireg_of a1;
OK (Psraiw rd rs n :: k)
| Oshru, a1 :: a2 :: nil =>
......
......@@ -215,6 +215,8 @@ module Target : TARGET =
fprintf oc " srlw %a = %a, %a\n;;\n" ireg rd ireg rs coqint64 imm
| Psrlil (rd, rs, imm) ->
fprintf oc " srld %a = %a, %a\n;;\n" ireg rd ireg rs coqint64 imm
| Psraw (rd, rs1, rs2) ->
fprintf oc " sraw %a = %a, %a\n;;\n" ireg rd ireg rs1 ireg rs2
| Poril (rd, rs, imm) -> assert Archi.ptr64;
fprintf oc " ord %a = %a, %a\n;;\n" ireg rd ireg rs coqint64 imm
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment