aboutsummaryrefslogtreecommitdiffstats
path: root/mppa_k1c
diff options
context:
space:
mode:
authorDavid Monniaux <david.monniaux@univ-grenoble-alpes.fr>2019-05-12 00:42:04 +0200
committerDavid Monniaux <david.monniaux@univ-grenoble-alpes.fr>2019-05-12 00:42:04 +0200
commit6e995893ccae975f49c250387182fcd3e3e6395a (patch)
tree30a38957a31313a071bba8e903a1890cc8dd7b98 /mppa_k1c
parent212b467687f0e3c0e3897b501cdc9e09a0d99233 (diff)
downloadcompcert-kvx-6e995893ccae975f49c250387182fcd3e3e6395a.tar.gz
compcert-kvx-6e995893ccae975f49c250387182fcd3e3e6395a.zip
directly branch to certain division functions from gcc
Diffstat (limited to 'mppa_k1c')
-rw-r--r--mppa_k1c/TargetPrinter.ml19
1 files changed, 16 insertions, 3 deletions
diff --git a/mppa_k1c/TargetPrinter.ml b/mppa_k1c/TargetPrinter.ml
index 114297c9..3c46ef16 100644
--- a/mppa_k1c/TargetPrinter.ml
+++ b/mppa_k1c/TargetPrinter.ml
@@ -34,9 +34,22 @@ module Target (*: TARGET*) =
let comment = "#"
- let symbol = elf_symbol
- let symbol_offset = elf_symbol_offset
- let label = elf_label
+ let subst_symbol = function
+ "__compcert_i64_udiv" -> "__udivdi3"
+ | "__compcert_i64_sdiv" -> "__divdi3"
+ | "__compcert_i64_umod" -> "__umoddi3"
+ | "__compcert_i64_smod" -> "__moddi3"
+ | x -> x;;
+
+ let symbol oc symb =
+ fprintf oc "%s" (subst_symbol (extern_atom symb))
+
+ let symbol_offset oc (symb, ofs) =
+ symbol oc symb;
+ let ofs = camlint64_of_ptrofs ofs in
+ if ofs <> 0L then fprintf oc " + %Ld" ofs
+
+ let label = elf_label
let print_label oc lbl = label oc (transl_label lbl)