aboutsummaryrefslogtreecommitdiffstats
path: root/mppa_k1c/SelectLong.vp
diff options
context:
space:
mode:
authorDavid Monniaux <david.monniaux@univ-grenoble-alpes.fr>2019-04-25 17:45:44 +0200
committerDavid Monniaux <david.monniaux@univ-grenoble-alpes.fr>2019-04-25 17:45:44 +0200
commitbeb1cf4f6b56ee739e3a763de93663a875224402 (patch)
treee5ba1c623394df93e070becc088749306c8dffb4 /mppa_k1c/SelectLong.vp
parentff1e531a3f2a58b6fbdc4a5a29f2520d5367c01c (diff)
downloadcompcert-kvx-beb1cf4f6b56ee739e3a763de93663a875224402.tar.gz
compcert-kvx-beb1cf4f6b56ee739e3a763de93663a875224402.zip
added code for extfzl/extfsl (not very useful since bitfields are limited to 32 bits)
Diffstat (limited to 'mppa_k1c/SelectLong.vp')
-rw-r--r--mppa_k1c/SelectLong.vp16
1 files changed, 16 insertions, 0 deletions
diff --git a/mppa_k1c/SelectLong.vp b/mppa_k1c/SelectLong.vp
index 811a8ab1..90901e04 100644
--- a/mppa_k1c/SelectLong.vp
+++ b/mppa_k1c/SelectLong.vp
@@ -155,6 +155,14 @@ Nondetfunction shrluimm (e1: expr) (n: int) :=
if Int.ltu (Int.add n n1) Int64.iwordsize'
then Eop (Oshrluimm (Int.add n n1)) (t1:::Enil)
else Eop (Oshrluimm n) (e1:::Enil)
+ | Eop (Oshllimm n1) (t1:::Enil) =>
+ let stop := Z.sub Int64.zwordsize (Z.add (Int.unsigned n1) Z.one) in
+ let start := Z.sub (Z.add (Z.add (Int.unsigned n) stop) Z.one) Int64.zwordsize in
+ if (Z.leb start stop)
+ && (Z.geb start Z.zero)
+ && (Z.ltb stop Int64.zwordsize)
+ then Eop (Oextfzl stop start) (t1:::Enil)
+ else Eop (Oshrluimm n) (e1:::Enil)
| _ =>
Eop (Oshrluimm n) (e1:::Enil)
end.
@@ -172,6 +180,14 @@ Nondetfunction shrlimm (e1: expr) (n: int) :=
if Int.ltu (Int.add n n1) Int64.iwordsize'
then Eop (Oshrlimm (Int.add n n1)) (t1:::Enil)
else Eop (Oshrlimm n) (e1:::Enil)
+ | Eop (Oshllimm n1) (t1:::Enil) =>
+ let stop := Z.sub Int64.zwordsize (Z.add (Int.unsigned n1) Z.one) in
+ let start := Z.sub (Z.add (Z.add (Int.unsigned n) stop) Z.one) Int64.zwordsize in
+ if (Z.leb start stop)
+ && (Z.geb start Z.zero)
+ && (Z.ltb stop Int64.zwordsize)
+ then Eop (Oextfsl stop start) (t1:::Enil)
+ else Eop (Oshrlimm n) (e1:::Enil)
| _ =>
Eop (Oshrlimm n) (e1:::Enil)
end.