aboutsummaryrefslogtreecommitdiffstats
path: root/kvx/SelectOp.vp
diff options
context:
space:
mode:
authorDavid Monniaux <David.Monniaux@univ-grenoble-alpes.fr>2022-02-14 18:51:52 +0100
committerDavid Monniaux <David.Monniaux@univ-grenoble-alpes.fr>2022-02-14 18:51:52 +0100
commit1ef9e303d7bd896b94afcc875136d8f3e94243cb (patch)
treeaf2da3d2fdbc0be85d207bf20111162bcf0a4f56 /kvx/SelectOp.vp
parent882f1a1875089298937abf4ef854b221cab4eb8e (diff)
parent2867dee21f6fb696db554679d8535306c7a9d4ea (diff)
downloadcompcert-kvx-1ef9e303d7bd896b94afcc875136d8f3e94243cb.tar.gz
compcert-kvx-1ef9e303d7bd896b94afcc875136d8f3e94243cb.zip
Merge remote-tracking branch 'origin/kvx-bits' into kvx_fp_division
Diffstat (limited to 'kvx/SelectOp.vp')
-rw-r--r--kvx/SelectOp.vp20
1 files changed, 20 insertions, 0 deletions
diff --git a/kvx/SelectOp.vp b/kvx/SelectOp.vp
index 089afe1d..63c7d73b 100644
--- a/kvx/SelectOp.vp
+++ b/kvx/SelectOp.vp
@@ -742,6 +742,24 @@ Nondetfunction gen_fmaf args :=
| _ => None
end.
+Definition select_abs (e1 : expr) :=
+ Eop (Oabsdiffimm Int.zero) (e1 ::: Enil).
+
+Definition select_absl (e1 : expr) :=
+ Eop (Oabsdifflimm Int64.zero) (e1 ::: Enil).
+
+Definition gen_abs args :=
+ match args with
+ | e1:::Enil => Some (select_abs e1)
+ | _ => None
+ end.
+
+Definition gen_absl args :=
+ match args with
+ | e1:::Enil => Some (select_absl e1)
+ | _ => None
+ end.
+
Require FPDivision32 FPDivision64.
Definition platform_builtin (b: platform_builtin) (args: exprlist) : option expr :=
@@ -770,6 +788,8 @@ Definition platform_builtin (b: platform_builtin) (args: exprlist) : option expr
| a:::b:::Enil => Some (FPDivision64.fp_modu64 a b)
| _ => None
end)
+ | BI_abs => gen_abs args
+ | BI_absl => gen_absl args
end.
End SELECT.