aboutsummaryrefslogtreecommitdiffstats
path: root/kvx/SelectOp.vp
diff options
context:
space:
mode:
authorDavid Monniaux <David.Monniaux@univ-grenoble-alpes.fr>2022-02-14 17:49:40 +0100
committerDavid Monniaux <David.Monniaux@univ-grenoble-alpes.fr>2022-02-14 17:49:40 +0100
commited6e20995761614ee7ea6235b978a463f071c123 (patch)
treec708063a2a911ae3d9b9caf1563151497b7670a5 /kvx/SelectOp.vp
parentfc384f172b72f90c8de52ec846344b7ffda76070 (diff)
downloadcompcert-kvx-ed6e20995761614ee7ea6235b978a463f071c123.tar.gz
compcert-kvx-ed6e20995761614ee7ea6235b978a463f071c123.zip
abs builtins
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 4e1087f9..f243089d 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.
+
Definition platform_builtin (b: platform_builtin) (args: exprlist) : option expr :=
match b with
| BI_fmin => Some (Eop Ominf args)
@@ -750,6 +768,8 @@ Definition platform_builtin (b: platform_builtin) (args: exprlist) : option expr
| BI_fmaxf => Some (Eop Omaxfs args)
| BI_fma => gen_fma args
| BI_fmaf => gen_fmaf args
+ | BI_abs => gen_abs args
+ | BI_absl => gen_absl args
end.
End SELECT.