summaryrefslogtreecommitdiff
path: root/bytecomp
diff options
context:
space:
mode:
authorGreta Yorsh <45005955+gretay-js@users.noreply.github.com>2020-03-26 09:58:10 +0000
committerGitHub <noreply@github.com>2020-03-26 10:58:10 +0100
commit824ce3549211f9d72ca3c58362f088a4369ebc2e (patch)
tree3f8ff9b108e586a52e35422fcad82f06fb11d8a5 /bytecomp
parentbc3246c5289dc32841509f349f90a304170fc2cc (diff)
downloadocaml-824ce3549211f9d72ca3c58362f088a4369ebc2e.tar.gz
Replace caml_int_compare and caml_float_compare with primitives (#2324)
Diffstat (limited to 'bytecomp')
-rw-r--r--bytecomp/bytegen.ml4
1 files changed, 4 insertions, 0 deletions
diff --git a/bytecomp/bytegen.ml b/bytecomp/bytegen.ml
index 567428003c..dab2976e1f 100644
--- a/bytecomp/bytegen.ml
+++ b/bytecomp/bytegen.ml
@@ -118,6 +118,7 @@ let preserve_tailcall_for_prim = function
| Pasrint | Pintcomp _ | Poffsetint _ | Poffsetref _ | Pintoffloat
| Pfloatofint | Pnegfloat | Pabsfloat | Paddfloat | Psubfloat | Pmulfloat
| Pdivfloat | Pfloatcomp _ | Pstringlength | Pstringrefu | Pstringrefs
+ | Pcompare_ints | Pcompare_floats | Pcompare_bints _
| Pbyteslength | Pbytesrefu | Pbytessetu | Pbytesrefs | Pbytessets
| Pmakearray _ | Pduparray _ | Parraylength _ | Parrayrefu _ | Parraysetu _
| Parrayrefs _ | Parraysets _ | Pisint | Pisout | Pbintofint _ | Pintofbint _
@@ -389,6 +390,9 @@ let comp_primitive p args =
Pgetglobal id -> Kgetglobal id
| Psetglobal id -> Ksetglobal id
| Pintcomp cmp -> Kintcomp cmp
+ | Pcompare_ints -> Kccall("caml_int_compare", 2)
+ | Pcompare_floats -> Kccall("caml_float_compare", 2)
+ | Pcompare_bints bi -> comp_bint_primitive bi "compare" args
| Pfield n -> Kgetfield n
| Pfield_computed -> Kgetvectitem
| Psetfield(n, _ptr, _init) -> Ksetfield n