aboutsummaryrefslogtreecommitdiffstats
path: root/arm
diff options
context:
space:
mode:
authorDavid Monniaux <david.monniaux@univ-grenoble-alpes.fr>2020-03-17 07:49:46 +0100
committerDavid Monniaux <david.monniaux@univ-grenoble-alpes.fr>2020-03-17 07:49:46 +0100
commit0ebdbc31c3e992e43d85699a039ebdd23e272df6 (patch)
treee8f5421825917bcad4dc0762f02dd28275463f5c /arm
parentfac63511aaf3fd3c77db69802c24474559365879 (diff)
downloadcompcert-kvx-0ebdbc31c3e992e43d85699a039ebdd23e272df6.tar.gz
compcert-kvx-0ebdbc31c3e992e43d85699a039ebdd23e272df6.zip
DuplicateOpcodeHeuristic for ARM
Diffstat (limited to 'arm')
-rw-r--r--arm/DuplicateOpcodeHeuristic.ml25
1 files changed, 22 insertions, 3 deletions
diff --git a/arm/DuplicateOpcodeHeuristic.ml b/arm/DuplicateOpcodeHeuristic.ml
index 85505245..9b6a6409 100644
--- a/arm/DuplicateOpcodeHeuristic.ml
+++ b/arm/DuplicateOpcodeHeuristic.ml
@@ -1,3 +1,22 @@
-exception HeuristicSucceeded
-
-let opcode_heuristic code cond ifso ifnot preferred = ()
+open Op
+open Integers
+
+let opcode_heuristic code cond ifso ifnot is_loop_header =
+ match cond with
+ | Ccompimm (c, n) | Ccompuimm (c, n) -> if n == Integers.Int.zero then (match c with
+ | Clt | Cle -> Some false
+ | Cgt | Cge -> Some true
+ | _ -> None
+ ) else None
+ | Ccompf c | Ccompfs c -> (match c with
+ | Ceq -> Some false
+ | Cne -> Some true
+ | _ -> None
+ )
+ | Cnotcompf c | Cnotcompfs c -> (match c with
+ | Ceq -> Some true
+ | Cne -> Some false
+ | _ -> None
+ )
+ | _ -> None
+